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

You can add a department by sending the POST request to the following URL:  /department.

Permission to run the request: Account Owner, Administrators.


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 Owner or Administrator.
X-Auth-Password (required)Password of Account Owner or Administrator.
parentDepartmentId (required)ID of the department wich will the parent for the added one.

After the request has been completed, the system returns the response with the 201 code. The body of the response contains ID of the added department.


Possible Response Codes

CodeTextDescription
201Successful operationnew department has been added.
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