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

Request: POST /department/{departmentId}

Permissions to Run the Request

Account Owner, Account Administrators, Department Administrators, or custom roles

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

Request Headers

Header

Description

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, Department Administrator, or a user with a custom role.
X-Auth-Password (required)

The password of Account Owner, Account Administrator, Department Administrator, or a user with a custom role.

ParameterDescription
departmentId (required)The ID of a department you want to edit.
name (optional)The department name.
parentDepartmentId (optional)The ID of the parent department.
code (optional)The 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