Request: POST /department
Permissions to Run the Request
Account Owner, Account Administrators, or custom roles.
Request Headers
Header | 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, Account Administrator, or a user with a custom role. |
X-Auth-Password (required) | The password of Account Owner, Account Administrator, or a user with a custom role. |
Parameter | Description |
parentDepartmentId (required) | The ID of the department wich will the parent for the added one. |
Possible Response Codes
Code | Text | Description |
---|---|---|
201 | Successful operation | A new department has been added. The body of the response contains ID of the added department. |
400 | Bad Request | Some of the sent parameters are incorrect. |
401 | Unauthorized | An authorization error. |
403 | Permission denied | The user doesn't have enough permissions to add departments. |
Sample Request
POST /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: 12345Q Content-Type:application/xml <?xml version="1.0" encoding="UTF-8"?> <request> <name>New Department</name> <parentDepartmentId>3fa85f64-5717-4562-b3fc-2c963f66afa6</parentDepartmentId> <code>12345W</code> </request>
Sample Response
https/1.1 201 Successful operation Connection: close <?xml version="1.0" encoding="UTF-8"?> <response>d48bd4fa-5b70-11e9-b12b-22e9fbac4a59</response>