AVAILABLE WITH BUSINESS SUBSCRIPTION

Request: GET /departments

Permissions to Run the Request

 Account Owner, Account Administrators, Department Administrators, Publishers, or custom roles.

Department Administrators, Publishers,andusers with a custom role can get information about departments they manage and their sub-departments.

Request Headers

Header

Description

Authorization (required)Access token. You can obtain a token by making a request.
ParameterDescription

pageSize (optional)

The number of entries per page. If not indicated, equal to 1000.

pageToken (optional)

The token needed to continue to the next page.

Response Parameters

ParameterDescription
departmentIdThe department ID.
nameThe name of department.
codeThe department code.
subordination (optional)An array with data on the type of department supervisor subordination.
coSubordination (optional)An array with data on the type of functional manager subordination.
subordinationType (required)

The type of supervisor and functional manager subordination.

  • inherit — Inherit from parent department.
  • manual — Assign manually.
  • no_supervisor — No supervisor.
supervisorId (optional)The supervisor and functional manager ID.Specify the supervisor ID, if subordinationType = manual.
-If subordinationType = inherit, no_supervisor, there is no need to specify the supervisor ID.

Response Codes

Code

Text

Description

200OKThe request has been successfully processed. The response body contains the XML data regarding departments. 
400Bad RequestA request error.
401UnauthorizedAn authorization error.
403Permission DeniedThe user doesn't have enough permissions to retrieve a list of departments.

Sample Request

GET /departments?pageSize=1000&pageToken=ODE1YjhiOTgtMDYxMi0xMWVhLTliZDYtMGE1ODBhZjQwNzg4
Host: api-learn.ispringlearn.com
Authorization: p-1sJDjmULL5DdpXPJTcbm4jVIaWVHvNmrjAxATRbNE
XML

Sample Response

https/1.1 200 OK

<?xml version="1.0" encoding="UTF-8"?>
<response>
    <departments>
        <department>
            <departmentId>2a3e04a2-fa51-11e9-90a8-0a580af40a83</departmentId>
            <name>Sample Company, LLC</name>
            <code>0</code>
        </department>
    </departments>
    <nextPageToken>MmEzZTA0YTItZmE1MS0xMWU5LTkwYTgtMGE1ODBhZjQwYTgz</nextPageToken>
</response>
XML

Recommended articles