GET /api/businesses

Returns information about business organizations on the platform, as a JSON object.

Authorization Roles/Permissions: Must be logged in. Must have Read permission for the resource.

This topic includes the following sections:

HTTP Method

GET

URL

https://{hostname}/api/businesses

Sample Request

The example below shows a request for information about organizations on the platform.

Sample Request URL

https://{hostname}/api/businesses[?][Federation=true][&][BusinessID={BusinessID}]

Sample request headers

GET /api/businesses HTTP/1.1
Host: {hostname}
Accept: application/vnd.soa.v83+json

Sample request body

Not applicable.

Request Headers

For general information on request header values, refer to HTTP Request Headers.

Header Description
Accept

Any of the following media types is valid for the Accept header:

application/vnd.soa.v83+json, application/vnd.soa.v83+xml

Cookie AtmoAuthToken_{fedmemberid}={cookie value, which usually starts with TokenID}—The platform cookie. This is the Akana API Platform authorization token, and must be sent with every API request that requires login. For more information and an example, see Session cookies.
X-Csrf-Token_{fedmemberID} The CSRF prevention header; may or may not be required, depending on platform settings. See CSRF Prevention on the Platform. By default, the CSRF header is not required for GET operations and is required for all others, with a few exceptions relating to user login.

Request Parameters

Parameter Parm Type Data Type Required Description
Federation Query Boolean Optional If this parameter is included and set to true, businesses in the federation are included in the response. Default: false.
BusinessID Query string Optional

The unique ID for a specific business organization on the platform.

If specified, only child businesses for the specified business are returned.

Response

If successful, this operation returns HTTP status code 200, with information about the businesses set up for the platform.

Sample Response

The sample response below shows successful completion of this operation.

Sample response headers: application/vnd.soa.v83+json

Status Code: 200 OK
Content-Type: application/vnd.soa.v83+json
Date: Fri, 02 Sep 2016 20:59:02 GMT

Sample response body: application/vnd.soa.v83+json

The example below returns child business organizations to the specified parent organization.

{
  "Business":[
    {
      "BusinessID":"249203f7-58ed-4e5d-a3e8-e1c020f51a6e.acmepaymentscorp",
      "Name":"ACME Payments Corporation Billing Department",
      "Description":"ACME Payments Corporation Billing Department",
      "Visibility":"Public",
      "AvatarURL":"http://{hostname}/api/businesses/avatar/_VxZnW6AUoRKFwfqp0DGpuRA",
      "ParentBusinessID":"65a4afbe-9a56-46b2-8e41-862a15c36bc2.acmepaymentscorp",
      "TargetResources":{
        "TargetResource":[
          {
            "Name":"ACME Payments Corporation",
            "ID":"65a4afbe-9a56-46b2-8e41-862a15c36bc2.acmepaymentscorp",
            "Type":"business",
            "Avatar":"http://acmepaymentscorp.com/api/businesses/avatar/_VxZnW6AUoRKFwfqp0DGpuRA"
          }
        ]
      }
    },
    {
      "BusinessID":"8ec969c1-eeb4-44c7-aa11-6ca721603ef2.acmepaymentscorp",
      "Name":"ACME Payments Corporation Collections Department",
      "Description":"ACME Payments Corporation Collections Department",
      "Visibility":"Public",
      "AvatarURL":"http://{hostname}/api/businesses/avatar/_VxZnW6AUoRKFwfqp0DGpuRA",
      "ParentBusinessID":"65a4afbe-9a56-46b2-8e41-862a15c36bc2.acmepaymentscorp",
      "TargetResources":{
        "TargetResource":[
          {
            "Name":"ACME Payments Corporation",
            "ID":"65a4afbe-9a56-46b2-8e41-862a15c36bc2.acmepaymentscorp",
            "Type":"business",
            "Avatar":"http://acmepaymentscorp.com/api/businesses/avatar/_VxZnW6AUoRKFwfqp0DGpuRA"
          }
        ]
      }
    }
  ]
}

Response Headers

For general information on response header values, refer to HTTP Response Headers.

Header Description
Content-Type application/vnd.soa.v83+json, application/vnd.soa.v83+xml

Response Body

Name Type Description
Businesses Businesses Contains information about one or more businesses.

Error Codes/Messages

If the call is unsuccessful an error code/message is returned. One or more examples of possible errors for this operation are shown below.

Item Value
400 Bad request: Returned if the client sends a malformed request; for example, invalid parameters or body content.For example, you might get this response if you had a typo in the URL, or specified the wrong media type in the Content-Type header.
401 Unauthorized. For example, you would get this response if you didn't include the custom X-Csrf-Token_{fedmemberID} header in the request, when it was required by the platform settings; or if you included an invalid or expired value for this header. You would also get this response for any operation that requires login (almost all) if the login cookie was missing.
500 An error occurred processing the call.

More information about Akana API Platform API error messages.