Getting a List of Departments
AVAILABLE WITH BUSINESS SUBSCRIPTION
Request: GET /department
Permissions to Run the Request
Account Owner, Account Administrators, Department Administrators, Publishers, or custom roles.
Department Administrators, Publishers, and users with a custom role can get information only on the department they manage and its enclosed departments.
Request Headers
Parameter | Description |
---|---|
X-Auth-Account-Url (required) | The base URL of the account, e.g. https://myaccount.ispringlearn.com |
X-Auth-Email (required) | The login of Account Owner,Administrator, Department Administrator, Publisher, or a user with a custom role. |
X-Auth-Password (required) | The password of Account Owner,Administrator, Department Administrator, Publisher, or a user with a custom role. |
Response Parameters
Parameter | Description | |
---|---|---|
departmentId | The department ID. | |
name | The name of department. | |
parentDepartmentId | The parent department ID. | |
code | The 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.
| |
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. |
Possible Response Codes
Code | Text | Description |
---|---|---|
200 | OK | The request was successfully processed. The response body contains xml info on the departments. |
400 | Bad Request | A request error. |
401 | Unauthorized | An authorization error. |
403 | Permission Denied | The user doesn't have enough permissions to get the list of departments. |
Sample Request
GET /department https/1.1
Host: api-learn.ispringlearn.com
X-Auth-Account-Url: https://myaccount.ispringlearn.com
X-Auth-Email: email@email.com
X-Auth-Password: password
XML
Sample Response
https/1.1 200 OK
<?xml version="1.0"?>
<response>
<department>
<departmentId>b012a71c-5b6f-11e9-b659-0a580af40556</departmentId>
<name>Sales Department</name>
<parentDepartmentId>b00ba37c-5b6f-11e9-bb45-0a580af40556</parentDepartmentId>
<code>5</code>
</department>
<department>
<departmentId>76b2a17a-5cff-11e9-8920-0a580af40692</departmentId>
<name>Call Center</name>
<parentDepartmentId>b012a71c-5b6f-11e9-b659-0a580af40556</parentDepartmentId>
<code>12</code>
</department>
<department>
<departmentId>a1c0e836-5cff-11e9-b0e0-0a580af40692</departmentId>
<name>VIP Sales Department</name>
<parentDepartmentId>b012a71c-5b6f-11e9-b659-0a580af40556</parentDepartmentId>
<code>13</code>
</department>
</response>
XML