Getting a List of Departments (Page-by-Page)
AVAILABLE WITH BUSINESS SUBSCRIPTION
Method: listDepartments
Permissions to Run Request
Account Owner, Account Administrators, Department Administrators, or custom roles.
Department Administrators and users with a custom role can retrieve information about departments they manage and their sub-departments.
Request Parameters
| Parameter | Type | Description |
|---|---|---|
| token (required) | string | Access token. You can obtain a token by making a request |
| pageSize (optional) | string | The number of entries per page. If not indicated, equal to 1000 |
| pageToken (optional) | string | The token needed to continue to the next page |
Return Values
After the request is successfully processed, the system returns an object with the following properties:
| Parameter | Type | Description | |
|---|---|---|---|
| department | array | An array containing ’departmentId’, ’name’, ’code’, ’parentDepartmentId’ values | |
| departmentId | string | The department ID | |
| name | string | The department name | |
| code | string | The department code | |
| nextPageToken | string | The token needed to continue to the next page | |
| subordination (optional) | array | An array with data on the type of department supervisor subordination | |
| coSubordination (optional) | array | An array with data on the type of functional manager subordination | |
| subordinationType (required) | string | The type of supervisor and functional manager subordination
| |
| supervisorId (optional) | string | 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 | ||
Sample Request
<soapenv:Envelope xmlns:soapenv="https://schemas.xmlsoap.org/soap/envelope/" xmlns:soap="https://ispringlearn.com/go/services/api/soap">
<soapenv:Header/>
<soapenv:Body>
<soap:ListDepartmentsRequest>
<soap:credentials>
<soap:token>p-1sJDjmULL5DdpXPJTcbm4jVIaWVHvNmrjAxATRbNE</soap:token>
</soap:credentials>
<soap:pageToken>string</soap:pageToken>
<soap:pageSize>1000</soap:pageSize>
</soap:ListDepartmentsRequest>
</soapenv:Body>
</soapenv:Envelope>
XML
Sample Response
<SOAP-ENV:Envelope xmlns:SOAP-ENV="https://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="https://ispringlearn.com/go/services/api/soap">
<SOAP-ENV:Body>
<ns1:ListDepartmentsResult>
<ns1:departments>
<ns1:department>
<ns1:departmentId>string</ns1:departmentId>
<ns1:name>string</ns1:name>
<ns1:code>string</ns1:code>
</ns1:department>
<ns1:department>
...
</ns1:department>
</ns1:departments>
<ns1:nextPageToken>string</ns1:nextPageToken>
</ns1:ListDepartmentsResult>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
XML