Updating User Profile
AVAILABLE WITH BUSINESS SUBSCRIPTION
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
Header | Description |
---|---|
X-Auth-Account-Url (required) | The base URL of the account, e.g. https://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. |
Parameter | Description |
user_id (required) | The ID of the user whose profile you would like to edit. |
email (optional) | The email of the user. The parameter is passed as part of fields. |
login (required) | The login of the user. The parameter is passed as part of fields. |
first_name (optional) | The first name of the user. The parameter is passed as part of fields. |
last_name (optional) | The last name of the user. The parameter is passed as part of fields. |
job_title (optional) | The job title of the user. The parameter is passed as part of fields. |
departmentId (optional) | The ID of the department the user belongs to. |
role (optional) | If you assign one of the standard roles to the user (except for Account Owner and Publisher), use one of the following values for the role parameter:
If you assign the Publisher role or one of the custom roles to the users, use the custom value for the role parameter. |
roleId (required if the custom value is used for the role parameter) | The roleId parameter is used, if you assign or the Publisher role or one of the custom roles to the user. In this case, you will need to use the needed role ID for the roleId parameter. |
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. |
groupIds (optional) | An array with the IDs of the groups the user will be added to. |
roles (optional) | An array of data using which you can assign one or two roles to a user. You will need to use the needed role ID for the roleId parameter inside the array. If you assign two roles, one of them will be Learner, and the second role — one of the administrative roles (Account Administrator, Department Administrator, Publisher, or a custom role). Learn more about using the roles parameter in the Important section. |
about_me (optional) | A user's personal information in the About me field. |
Important:
- 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.
- The user role can be assigned in one of two ways:
- Using the role (if the assigned role is Account Administrator, Department Administrator, or Learner) and roleId (if the role is Publisher or a custom role) tags,
- Using the roles array of data.
- Using the role (if the assigned role is Account Administrator, Department Administrator, or Learner) and roleId (if the role is Publisher or a custom role) tags,
- If you use the roles array of data to assign a user role, you will be able to select two roles at once.
One of the roles will be Learner and the second role will be one of the administrative roles (Account Administrator, Department Administrator, Publisher, or a custom role).
If you add two administrative role to the roles array of data, the user won't be added. - If you have assigned a user role both with the role/roleId tags and the roles array of data, the user will be assigned to a role or roles specified in the roles array of data and the value specified in the role/roleId tags will be then ignored.
- If you haven't specified the user role with the role/roleId tags or with the roles array of data, the user will be assigned to the Learner role.
Possible Response Codes
Code | Text | Description |
---|---|---|
200 | OK | A user's profile is updated. |
400 | Bad Request | A request error. |
401 | Unauthorized | An authorization error. |
403 | Permission Denied | The 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 https/1.1
Host: api-learn.ispringlearn.com
X-Auth-Account-Url: https://myaccount.ispringlearn.com
X-Auth-Email: email@gmail.com
X-Auth-Password: password
Content-Type:application/xml
<?xml version="1.0" encoding="UTF-8"?>
<request>
<fields>
<login>kate.smith</login>
<email>kate.smith@ispringsolutions.com</email>
<first_name>Kate</first_name>
<last_name>Smith</last_name>
<job_title>Sales Manager</job_title>
</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>
<about_me>I provide professional development for the teams and set quarterly goals based on the team's performance to date.</about_me>
</request>
Sample Response
https/1.1 200 OK