Getting User Info
AVAILABLE WITH BUSINESS SUBSCRIPTION
Request: GET /user/{user_id}
When requesting GET /user/{user_id}, the values for the "Inactive" and "Employment Ended" statuses are the same — 3.
To differentiate between these statuses, use the GET /user/{user_id}/v2 request. In this way, in the status parameter, inactive users will be indicated by status 3, while users who are identified as "Employment Ended" will be indicated by status 5.
Permissions to Run the Request
Account Owner, Account Administrators, Department Administrators, or custom roles.
Department Administrators and users with a custom role can get information about users belonging only to the departments they manage and their sub-departments.
Request Headers
Parameter | 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, 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. |
Parameter | Description |
user_id (required) | The user`s ID. |
Response Parameters
Parameter | Description | |
---|---|---|
userProfile | An array with user`s data. | |
userId | The user ID. | |
role | The user's role.
| |
departmentId | The ID of the department. | |
status | The user's status. Possible values:
| |
fields | An array with data about user profile fields. It includes profile field names and their values. | |
groups | An array with the group IDs the user is a member of. | |
manageableDepartmentIds | An array with the IDs of the departments the user manages. | |
userRoles | An array with data about the user's roles. | |
addedDate | The date the user was added to the account. | |
lastLoginDate | The date the user last timed logged in to the account. | |
subordination (optional) | An array with data on the type of department supervisor subordination. | |
coSubordination (optional) | An array with data on the type of functional manager subordination. | |
subordinationType (required) | The type of supervisor and functional manager subordination.
| |
supervisorId (optional) | The supervisor and functional manager ID. | Specify the supervisor ID, if subordinationType = manual. |
- | If subordinationType = inherit, no_supervisor, there is no need to specify the supervisor ID. |
Possible Response Codes
Code | Text | Description |
---|---|---|
200 | OK | The request was successfully processed. The body of the response will contain xml data with user info. |
400 | Bad Request | A request error. |
401 | Unauthorized | An authorization error. |
403 | Permission Denied | The user doesn't have enough permissions to complete the request. |
Sample Request
GET /user/f29d887c-5cff-11e9-9e6a-0a580af40692 https/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
Sample Response
https/1.1 200 OK
<?xml version="1.0" encoding="UTF-8"?>
<response>
<userProfile>
<role>department_administrator</role>
<roleId>eaf01e14-2ae1-11e9-89a5-0242ac13000a</roleId>
<userId>3d7e1028-1545-11ec-b8d1-0242ac17002a</userId>
<departmentId>1141d74c-a75e-11eb-ad56-0242ac13002a</departmentId>
<status>1</status>
<fields>
<field>
<name>FIRST_NAME</name>
<value>Kate</value>
</field>
<field>
<name>LAST_NAME</name>
<value>Smith</value>
</field>
<field>
<name>LOGIN</name>
<value>kate.smith</value>
</field>
<field>
<name>EMAIL</name>
<value>kate.smith@test.com</value>
</field>
<field>
<name>PHONE</name>
<value></value>
</field>
<field>
<name>JOB_TITLE</name>
<value>Sales Manager</value>
</field>
<field>
<name>COUNTRY</name>
<value></value>
</field>
</fields>
<addedDate>2021-09-14</addedDate>
<groups>
<id>14b5893c-a75e-11eb-a87c-0242ac13002a</id>
<id>ee5a6cca-154a-11ec-a6a8-0242ac17002a</id>
</groups>
<manageableDepartmentIds>
<id>1141d74c-a75e-11eb-ad56-0242ac13002a</id>
</manageableDepartmentIds>
<userRoles>
<userRole>
<roleId>eaf01e14-2ae1-11e9-89a5-0242ac13000a</roleId>
<roleType>department_administrator</roleType>
<manageableDepartmentIds>
<id>1141d74c-a75e-11eb-ad56-0242ac13002a</id>
</manageableDepartmentIds>
</userRole>
</userRoles>
</userProfile>
</response>