Page tree
Skip to end of metadata
Go to start of metadata

You can get a list of departments by sending the GET request to the following URL: /department.

Permission to run the request: Account Owner, Administrators, Department Administrators, Publishers

Department Administrators and Publishers can get information only on the department they manage and its daughter departments.

Request Headers

ParameterDescription
X-Auth-Account-Url (required)Base URL of the account, e.g. http://myaccount.ispringlearn.com
X-Auth-Email (required)Login of Account OwnerAdministratorDepartment Administrator, or Publisher.
X-Auth-Password (required)Password of Account OwnerAdministratorDepartment Administrator, or Publisher.

After the request has been completed, the system returns the response with the 200 code. The response code contains xml info on the departments.

Possible Response Codes

Code

Text

Description

200Successful operation

The request was successfully processed.

400Bad RequestA request error.
401UnauthorizedAn authorization error.
403Permission Denied

The user doesn't have enough permissions to get the list of departments.

Sample Request

GET /department HTTP/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

Sample Response

HTTP/1.1 200 Successful operation
Connection: close

<?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>
  • No labels