Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Department Administrators and users 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 IDSpecify 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

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

...

Code Block
languagexml
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>

Recommended articles