GET /api/businesses

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

Supported Versions: 8.3 and later

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

This topic includes the following sections:

HTTP Method

GET

Back to top

URL

https://{hostname}/api/businesses

Back to top

Sample Request

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

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.

Back to top

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
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.

Back to top

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.

Back to top

Response

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

Back to top

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"
          }
        ]
      }
    }
  ]
}

Back to top

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

Status Code: 200 OK
Content-Type:application/vnd.soa.v83+xml
Date:  Wed, 09 Nov 2016 22:13:09 GMT

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

The example below returns all business organizations specified for the tenant.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<BusinessInfos xmlns="http://soa.com/xsd/business/1.0" xmlns:ns2="http://soa.com/xsd/api/1.0" 
xmlns:ns3="http://soa.com/xsd/dnmodel/1.0" xmlns:ns4="http://soa.com/xsd/legals/1.0">
  <Business>
    <BusinessID>tenantbusiness.acmepaymentscorp</BusinessID>
    <Name>Tenant - automation</Name>
    <Visibility>Limited</Visibility>
    <AvatarURL>http://acmepaymentscorp.com/api/businesses/avatar/_VNJ_Q40UH1GhlAHRPXZS0rg/atmo.tenant</AvatarURL>
  </Business>
  <Business>
    <BusinessID>5451af3c-83bd-4669-86d9-044c46d6ee26.acmepaymentscorp</BusinessID>
    <Name>tye</Name>
    <Description>eyrt</Description>
    <Visibility>Limited</Visibility>
    <AvatarURL>http://acmepaymentscorp.com/api/businesses/avatar/_VNJ_Q40UH1GhlAHRPXZS0rg/Department</AvatarURL>
    <ParentBusinessID>tenantbusiness.acmepaymentscorp</ParentBusinessID>
    <ns3:TargetResources>
      <ns3:TargetResource>
        <ns3:Name>Tenant - automation</ns3:Name>
        <ns3:ID>tenantbusiness.acmepaymentscorp</ns3:ID>
        <ns3:Type>business</ns3:Type>
        <ns3:Avatar>http://acmepaymentscorp.com/api/businesses/avatar/_VNJ_Q40UH1GhlAHRPXZS0rg/atmo.tenant</ns3:Avatar>
      </ns3:TargetResource>
    </ns3:TargetResources>
  </Business>
  <Business>
    <BusinessID>2d4b1202-2951-40b3-a6c5-21a8fbbb9b20.acmepaymentscorp</BusinessID>
    <Name>org1</Name>
    <Description>test</Description>
    <Visibility>Limited</Visibility>
    <AvatarURL>http://acmepaymentscorp.com/api/businesses/avatar/_VNJ_Q40UH1GhlAHRPXZS0rg/Department</AvatarURL>
    <ParentBusinessID>5451af3c-83bd-4669-86d9-044c46d6ee26.acmepaymentscorp</ParentBusinessID>
    <ns3:TargetResources>
      <ns3:TargetResource>
        <ns3:Name>tye</ns3:Name>
        <ns3:ID>5451af3c-83bd-4669-86d9-044c46d6ee26.acmepaymentscorp</ns3:ID>
        <ns3:Type>business</ns3:Type>
        <ns3:Avatar>http://acmepaymentscorp.com/api/businesses/avatar/_VNJ_Q40UH1GhlAHRPXZS0rg/Department</ns3:Avatar>
      </ns3:TargetResource>
    </ns3:TargetResources>
  </Business>
</BusinessInfos>

Back to top

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

Back to top

Response Body

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

Back to top

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 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.

Back to top

Related Topics