AVAILABLE WITH BUSINESS SUBSCRIPTION

Request: POST /department

Permissions to Run the Request

Account Owner, Account Administrators, or custom roles

Request Headers


HeaderDescription
Authorization (required)Access token. You can obtain a token by making a request.
ParameterDescription
parentDepartmentId (required)The ID of the department wich will the parent for the added one.


Possible Response Codes

CodeTextDescription
201Creatednew 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 https/1.1
Host: api-learn.ispringlearn.com
Authorization: p-1sJDjmULL5DdpXPJTcbm4jVIaWVHvNmrjAxATRbNE
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>
XML


Sample Response


https/1.1 201 Created

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