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

Request: POST /user/{user_id}

Permissions to Run the Request

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

Department Administrators, and users with a custom role can edit profiles of the users belonging to the departments they manage and their sub-departments.

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 Department Administrator, or a user with a custom role.
X-Auth-Password (required)The password of Account Owner, Account Administrator, or Department Administrator, or a user with a custom role.
ParameterDescription
user_id (required)The ID of the user whose profile you would like to edit.
email (optional)The email of the user.
login (required)The login of the user.
password (optional)The password of the user. 
departmentId (required)The ID of the department the user belongs to.
role (required)

If you assign one of the standard roles to the user (apart from Account Owner and Publisher), set one of the following values to the role parameter:

  • learner
  • department_administrator
  • administrator

If you assign one of the custom roles to the users, set the custom value to the role parameter. 

roleId (required if the user role is Publisher or a custom role)

The roleId parameter is used, if you assign one of the custom roles or the Publisher role to the user.

manageableDepartmentIds (required if the user's role is Department Administrator, Publisher, or a custom role)

An array with the IDs of the departments the user will manage.
groups (optional)An array with the IDs of the groups the user will be added to.

If in the account there are required user profile fields (apart from the fields of the 'Country' format), they should be also put into the request.

Possible Response Codes

CodeTextDescription
200Successful operationA user's profile is updated.
400Bad RequestA request error.
401UnauthorizedAn authorization error.
403Permission DeniedThe user doesn't have enough permissions to update another users' profiles, For instance, Department Administrators can't change profiles of users belonging to a department they don't manage.

Sample Request

POST /user/43f4a84c-6280-11e9-8686-a6210366ac32 HTTP/1.1
Host: api-learn.ispringlearn.com
X-Auth-Account-Url: https://myaccount.ispringlearn.com
X-Auth-Email: email@gmail.com
X-Auth-Password: 12345Q
Content-Type:application/xml

<?xml version="1.0" encoding="UTF-8"?>
<request>
	<fields>
      <login>kate.smith</login>
      <email>kate@gmail.com</email>
      <first_name>Kate</first_name>
      <last_name>Smith</last_name>
      <job_title>Sales Manager</job_title>
    </fields>  
	</fields>
	<departmentId>3fa85f64-5717-4562-b3fc-2c963f66afa6</departmentId>
	<groupIds>
		<id>3fa85f64-5717-4562-b3fc-2c963f66afa6</id>
	</groupIds>
	<role>department_administrator</role>
	<manageableDepartmentIds>
		<id>3fa85f64-5717-4562-b3fc-2c963f66afa6</id>
	</manageableDepartmentIds>
</request>

Sample Response

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