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

You can edit the name and the code of a department or change its parent department by sending the POST request with the XML data to the following URL:  /department/{departmentId}.

Permissions to run the request: Account OwnerAdministratorsDepartment Administrators or users with a role with custom settings allowing to edit departments.

Department Administrators and users with a role with custom settings can update only the department they manage and its sub-departments.

Request Headers

Parameter

Description

X-Auth-Account-Url (required)Base URL of the account, e.g. http://myaccount.ispringlearn.com
X-Auth-Email (required)Login of Account Owner, Administrator, or Department Administrator.
X-Auth-Password (required)

Password of Account Owner, Administrator, or Department Administrator.

departmentId (required)ID of a department you want to edit.
name (optional)Department name.
parentDepartmentId (optional)ID of the parent department.
code (optional)Department code.

Response Codes

Code

Text

Description

200Successful operationThe parameter is successfully updated.
400Bad RequestA request error.
401UnauthorizedAn authorization error.
403Permission deniedThe user doesn't have enough permissions to update a department. For instance, Department Administrators can't edit departments they don't manage.

Sample Request

POST /department/d48bd4fa-5b70-11e9-b12b-22e9fbac4a59/ 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: password
Content-Type:application/xml

<?xml version="1.0" encoding="UTF-8"?>
<request>
	<name>Quality Assurance</name>    
    <parentDepartmentId>be676588-5448-11e9-b7f7-62fb686e6fbe</parentDepartmentId>
    <code>5</code>
</request>

Sample Response

HTTP/1.1 200 Successful operation
Connection: close
  • No labels