AVAILABLE WITH BUSINESS SUBSCRIPTION

Method: listDepartments

Permissions to Run Request

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

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

Request Parameters

ParameterTypeDescription
token (required)stringAccess token. You can obtain a token by making a request.
pageSize (optional)stringThe number of entries per page. If not indicated, equal to 1000.
pageToken  (optional)stringThe 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:

ParameterTypeDescription
departmentarray

An array containing ’departmentId’, ’name’, ’code’, ’parentDepartmentId’ values.

departmentIdstringThe department ID.
namestringThe department name.
codestringThe department code.
nextPageTokenstringThe token needed to continue to the next page.
subordination (optional)arrayAn array with data on the type of department supervisor subordination.
coSubordination (optional)arrayAn array with data on the type of functional manager subordination.
subordinationType (required)string

The type of supervisor and functional manager subordination.

  • inherit — Inherit from parent department.
  • manual — Assign manually.
  • no_supervisor — No supervisor.
supervisorId (optional)stringThe 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