Getting a List of Users (Page-by-Page)
AVAILABLE WITH BUSINESS SUBSCRIPTION
Request: GET /users
When requesting GET /users, the values for the "Inactive" and "Employment Ended" statuses are the same — 3.
To differentiate between these statuses, use the GET /users/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, Author, or custom roles.
Department Administrators and Publishers can get users belonging to the departments they manage and their sub-departments.
Request Headers
Header | Description |
---|---|
Authorization (required) | Access token. You can obtain a token by making a request |
Parameter | Description |
departments (optional) | An array of IDs of the departments whose users you want to retrieve |
groups (optional) | An array of IDs of the groups whose users you want to retrieve |
pageSize (optional) | The number of entries per page. If not indicated, equal to 1000 |
pageToken (optional) | The token to continue to the next page |
logins (optional) | An array of logins whose users you want to retrieve |
emails (optional) | An array of emails whose users you want to retrieve |
workLeaveStatus (optional) | A work leave status. An array with the following parameters:
|
Response Codes
Code | Text | Description |
---|---|---|
200 | OK | The request has been successfully processed |
400 | Bad Request | A request error |
401 | Unauthorized | An authorization error |
403 | Permission Denied | The user doesn't have enough permissions to retrieve a list of users |
Sample Request
GET/users?departments[]=f0050578-c3dd-11e9-9d5d-4a54cfb3a702&groups[]=2aa6c5d2-fa51-11e9-b3bf-0a580af40a83&pageSize=1&pageToken=MmFiZmJhNDItZmE1MS0xMWU5LTk1ZjAtMGE1ODBhZjQwYTgz 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>
<userProfiles>
<userProfile>
...
</userProfile>
<userProfile>
...
</userProfile>
</userProfiles>
<nextPageToken>string</nextPageToken>
</response>