You are viewing an old version of this page. View the current version.
Compare with Current
View Page History
Version 1
Current »
Method: addDepartment
Permissions to Run the Request
Account Owner, Account Administrators, or custom roles.
Parameters
| Parameter | Type | Description |
|---|
| token (required) | string | Access token. You can obtain a token by making a request. |
| name (required) | string | The name of the new department. |
| parentDepartmentId (required) | string | The ID of the parent department. |
| code (optional) | string | The department code. |
Return Value
| Parameter | Type | Description |
|---|
| departmentId | string | The ID of the created department. |
Possible Errors
| Error | Description |
|---|
| Permission denied | The user has no permissions to add departments. |
| Wrong parameters | The system failed to process the request because it did not contain all necessary parameters. |
Sample Call
<?xml version="1.0" encoding="utf-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="https://schemas.xmlsoap.org/soap/envelope/"
xmlns="https://ispringlearn.com/go/services/api/soap">
<SOAP-ENV:Body>
<AddDepartmentRequest>
<credentials>
<token>p-1sJDjmULL5DdpXPJTcbm4jVIaWVHvNmrjAxATRbNE</token>
</credentials>
<name>string</name>
<parentDepartmentId>string</parentDepartmentId>
<code>string</code>
</AddDepartmentRequest>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Sample Response
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="https://schemas.xmlsoap.org/soap/envelope/"
xmlns="https://ispringlearn.com/go/services/api/soap">
<SOAP-ENV:Body>
<AddDepartmentResult>
<departmentId>string</departmentId>
</AddDepartmentResult>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>