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

Request: POST /department

Permissions to Run the Request

Account Owner, Account Administrators, or custom roles

Request Headers


HeaderDescription
X-Auth-Account-Url (required)The base URL of the account, e.g. http://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.
ParameterDescription
parentDepartmentId (required)The ID of the department wich will the parent for the added one.



Possible Response Codes

CodeTextDescription
201Successful operationnew department has been added. The body of the response contains ID of the added department.
400Bad RequestSome of the sent parameters are incorrect.
401UnauthorizedAn authorization error.
403Permission deniedThe user doesn't have enough permissions to add departments.


Sample Request


POST /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: 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

HTTP/1.1 201 Successful operation
Connection: close

<?xml version="1.0" encoding="UTF-8"?>
<response>d48bd4fa-5b70-11e9-b12b-22e9fbac4a59</response>
  • No labels