# Get Organizations

**Organizations** is a feature of the AdvancedContacts TonicDM license. Without that licence, the API user should work one level down with **Brands**.
If called with no parameters (ie. `/organizations`) it will return paged data for the Brands and Locations in the User's Tenant and all Contact Organizations, in no specific order.
A specific set of organizations' data can be returned by providing the `filterIds` parameter with an array of Organization `id`
(ie. `/organizations` with `filterIds={organizationId},{organizationId}`).
If caching the organization data on the client side, the `dataQuantity=idOnly` option can be chosen to get the list of UUIDs that match the filtering/sorting/paging requirements
with the organization data coming from your client side cache, having been retrieved by providing the `filterIds` parameter with an array of `id`.
You can also get the list of Locations (offices) or Brands for an Organization by
calling `/locations` with `filterOrganizationIds={organizationId}` or `/brands` with `filterOrganizationIds={organizationId}`.
Locations and Brands for Organizations other than your own are a feature of the AdvancedContacts TonicDM license.

Endpoint: POST /core/organizations/select
Version: 0.0.5
Security: OAuth2

## Request fields (application/json):

  - `filterIds` (array)
    Returns data for the specified UUIDs. If this filter is specifed, all other filters will be ignored.

  - `dataQuantity` (string)
    If caching data on the client side, the `dataQuantity=idOnly|basic|complete` option can be passed to manage the completeness of the data received and therefore rate limiting.
    Enum: "idOnly", "basic", "complete"

  - `pageSize` (integer)
    The number of results to return per page

  - `pageNumber` (integer)
    Which page of the results to return

## Response 200 fields (application/json):

  - `status` (string, required)
    Enum: "success"

  - `data` (array, required)

  - `data.id` (string)
    Example: 8e8aa42241794371ae9d0ed7b67a8c86

  - `data.brands` (array)
    One or more Brands that belong to this Organization. All Organizations are have at least one Brand.
Refer to the `dataQuantity` Request parameter to understand the level of detail returned.

  - `data.brands.datetimeCreated` (string)
    The date and time this Brand was created.

  - `data.brands.datetimeUpdated` (string)
    The date and time this Brand was last updated.

  - `data.brands.status` (string)
    Whether the item is active or inactive in TonicDM. Potentially the item could be (soft) deleted.
    Enum: "active", "inactive", "deleted"

  - `data.brands.domains` (array)
    Currently one and only one domain must be present.
# Zero or more domains that belong to this organization and represent the Brand, eg. `firm.com`, `firm.co.us`.
In the case of a shared domain contact, the "domain" of their Brand is their full email address, eg. `steven.novosel@gmail.com`.

  - `data.brands.brandNameLegal` (string)
    The full official name of the Brand (used on transmittals).

  - `data.brands.brandNameKnownAs` (string)
    The friendly name of the Brand (used within the TonicDM app).

  - `data.brands.brandInitials` (string)
    The initials of the Brand (used in very small spaces)

  - `data.brands.brandColor` (string)
    Brand color for the Brand.

  - `data.brands.disciplines` (array)
    limits the disciplines that can be chosen for any person in this Brand to help consistency.

  - `data.brands.certifications` (array)
    Zero or more certifications that this Brand has obtained, or previously obtained, for example Women Owned Business. REQUIRES the TonicDM AdvancedContacts license. 
REQUIRES the TonicDM AdvancedContacts license.

  - `data.brands.isPrime` (boolean)
    Indicates that this Brand is the primary Brand for this organization. 
When displaying an organization, the Prime Brand info will be used for their Name, etc.
REQUIRES the TonicDM AdvancedContacts license.

  - `data.brands.customerDataWarehouseId` (string)
    The ID of the Person in the Customer's Data Warehouse.
FOR USE BY CUSTOMER. NOT YET IMPLEMENTED.
REQUIRES the TonicDM AdvancedMetrics license.

  - `data.brands.customerErpId` (string)
    The ID of the Person in the Customer's ERP system (eg. Deltek Vantagepoint).
FOR USE BY CUSTOMER. NOT YET IMPLEMENTED.
REQUIRES the TonicDM AdvancedMetrics license.

  - `data.brands.customerCrmId` (string)
    The ID of the Person in the Customer's CRM system (eg. Deltek Salesforce).
FOR USE BY CUSTOMER. NOT YET IMPLEMENTED.
REQUIRES the TonicDM AdvancedMetrics license.

  - `data.locations` (array)
    Zero or more Locations that belong to this Organization.
Refer to the `dataQuantity` Request parameter to understand the level of detail returned.

  - `data.locations.datetimeCreated` (string)
    The date and time this Location was created.

  - `data.locations.datetimeUpdated` (string)
    The date and time this Location was last updated.

  - `data.locations.name` (string)
    The name given to this Location. It is used in the TonicDM app only (not put onto anything externally facing).

  - `data.locations.address` (string)
    The address of the location. Use `\n` for new lines when submitting (they will be returned as `<br>`).

  - `data.locations.phoneCountryCode` (string)
    Numbers only, no spaces or `+` character

  - `data.locations.phoneNumber` (string)
    Numbers only, no spaces or formatting

  - `data.locations.customerDataWarehouseId` (string)
    The ID of the Person in the Customer's Data Warehouse.
FOR USE BY CUSTOMER. NOT YET IMPLEMENTED.
REQUIRES the TonicDM AdvancedMetrics license.

  - `data.locations.customerErpId` (string)
    The ID of the Person in the Customer's ERP system (eg. Deltek Vantagepoint).
FOR USE BY CUSTOMER. NOT YET IMPLEMENTED.
REQUIRES the TonicDM AdvancedMetrics license.

  - `data.locations.customerCrmId` (string)
    The ID of the Person in the Customer's CRM system (eg. Deltek Salesforce).
FOR USE BY CUSTOMER. NOT YET IMPLEMENTED.
REQUIRES the TonicDM AdvancedMetrics license.

  - `metadata` (object, required)
    Present on every JSON response. For non-paginated operations, `page` will be 1, `total_pages` will be 1,
and `total_records` equal to the number of elements in `data`.

  - `metadata.timestamp` (string, required)

  - `metadata.correlation_id` (string, required)

  - `metadata.page` (integer, required)

  - `metadata.total_pages` (integer, required)

  - `metadata.total_records` (integer, required)

## Response 400 fields (application/json):

  - `status` (string, required)
    Enum: "fail", "error"

  - `error` (object, required)

  - `error.code` (string, required)
    Example: VALIDATION_ERROR

  - `error.message` (string, required)
    Example: Invalid input

  - `metadata` (object, required)
    Present on every JSON response. For non-paginated operations, `page` will be 1, `total_pages` will be 1,
and `total_records` equal to the number of elements in `data`.

  - `metadata.timestamp` (string, required)

  - `metadata.correlation_id` (string, required)

  - `metadata.page` (integer, required)

  - `metadata.total_pages` (integer, required)

  - `metadata.total_records` (integer, required)

## Response 401 fields (application/json):

  - `status` (string, required)
    Enum: "fail", "error"

  - `error` (object, required)

  - `error.code` (string, required)
    Example: VALIDATION_ERROR

  - `error.message` (string, required)
    Example: Invalid input

  - `metadata` (object, required)
    Present on every JSON response. For non-paginated operations, `page` will be 1, `total_pages` will be 1,
and `total_records` equal to the number of elements in `data`.

  - `metadata.timestamp` (string, required)

  - `metadata.correlation_id` (string, required)

  - `metadata.page` (integer, required)

  - `metadata.total_pages` (integer, required)

  - `metadata.total_records` (integer, required)

## Response 403 fields (application/json):

  - `status` (string, required)
    Enum: "fail", "error"

  - `error` (object, required)

  - `error.code` (string, required)
    Example: VALIDATION_ERROR

  - `error.message` (string, required)
    Example: Invalid input

  - `metadata` (object, required)
    Present on every JSON response. For non-paginated operations, `page` will be 1, `total_pages` will be 1,
and `total_records` equal to the number of elements in `data`.

  - `metadata.timestamp` (string, required)

  - `metadata.correlation_id` (string, required)

  - `metadata.page` (integer, required)

  - `metadata.total_pages` (integer, required)

  - `metadata.total_records` (integer, required)

## Response 404 fields (application/json):

  - `status` (string, required)
    Enum: "fail", "error"

  - `error` (object, required)

  - `error.code` (string, required)
    Example: VALIDATION_ERROR

  - `error.message` (string, required)
    Example: Invalid input

  - `metadata` (object, required)
    Present on every JSON response. For non-paginated operations, `page` will be 1, `total_pages` will be 1,
and `total_records` equal to the number of elements in `data`.

  - `metadata.timestamp` (string, required)

  - `metadata.correlation_id` (string, required)

  - `metadata.page` (integer, required)

  - `metadata.total_pages` (integer, required)

  - `metadata.total_records` (integer, required)

## Response 429 fields (application/json):

  - `status` (string, required)
    Enum: "fail", "error"

  - `error` (object, required)

  - `error.code` (string, required)
    Example: VALIDATION_ERROR

  - `error.message` (string, required)
    Example: Invalid input

  - `metadata` (object, required)
    Present on every JSON response. For non-paginated operations, `page` will be 1, `total_pages` will be 1,
and `total_records` equal to the number of elements in `data`.

  - `metadata.timestamp` (string, required)

  - `metadata.correlation_id` (string, required)

  - `metadata.page` (integer, required)

  - `metadata.total_pages` (integer, required)

  - `metadata.total_records` (integer, required)

## Response 500 fields (application/json):

  - `status` (string, required)
    Enum: "fail", "error"

  - `error` (object, required)

  - `error.code` (string, required)
    Example: VALIDATION_ERROR

  - `error.message` (string, required)
    Example: Invalid input

  - `metadata` (object, required)
    Present on every JSON response. For non-paginated operations, `page` will be 1, `total_pages` will be 1,
and `total_records` equal to the number of elements in `data`.

  - `metadata.timestamp` (string, required)

  - `metadata.correlation_id` (string, required)

  - `metadata.page` (integer, required)

  - `metadata.total_pages` (integer, required)

  - `metadata.total_records` (integer, required)

