AVAILABLE WITH BUSINESS SUBSCRIPTION

Method: ListUsers

When requesting ListUsers, the values for the "Inactive" and "Employment Ended" statuses are the same — 3.

To differentiate between these statuses, use the ListUsers/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 Request

Account Owner, Account Administrators, Department Administratorsor custom roles

Department Administrators and users with a custom role can get lists of users belonging to the department they manage and its sub-departments.

Request Parameters

ParameterTypeDescription
token (required)stringAccess token. You can obtain a token by making a request
groupId (optional)string

If this parameter is used, only users belonging to the specified group will be retrieved

departmentId (optional)stringIf this parameter is used, only users belonging to the specified department will be retrieved
pageSize (optional)stringThe number of entries per page. If not indicated, equal to 1000
pageToken  (optional)stringThe token needed to continue to the next page
logins (optional)stringAn array of logins whose users you want to retrieve
emails (optional)stringAn array of emails whose users you want to retrieve

Return Values

After the request is successfully processed, the system returns an object with the following properties:

ParameterTypeDescription
usersUserProfile[]

An array containing user profiles.The UserProfile object has the same properties as the getUserProfile method

nextPageTokenstringThe token needed to continue to the next page
workLeaveStatus (optional)string

A work leave status. An array with the following parameters:

  • workLeaveReason  
    Reasons for work leave status
  • startDate
    The work leave status start date. You can add it in the yyyy-mm-dd format
  • endDate
    The work leave status end date. You can add it in the yyyy-mm-dd format

Possible Errors

ErrorDescription
Permission denied

The user doesn't have permission to complete the request. For example, Department Administrator can't get a list of users belonging to a department they don't manage

Sample Request

<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope xmlns:soapenv="https://schemas.xmlsoap.org/soap/envelope/" xmlns:soap="https://ispringlearn.com/go/services/api/soap">
   <soapenv:Header/>
   <soapenv:Body>
      <soap:ListUsersRequest>
         <soap:credentials>
             <soap:token>p-1sJDjmULL5DdpXPJTcbm4jVIaWVHvNmrjAxATRbNE</soap:token>
         </soap:credentials>
           <soap:groupIds>
                <soap:id>string</soap:id>
          </soap:groupIds>
         <soap:departmentIds>
            <soap:id>string</soap:id>
         </soap:departmentIds>
         <soap:pageToken>string</soap:pageToken>
         <soap:pageSize>1000</soap:pageSize>
      </soap:ListUsersRequest>
   </soapenv:Body>
</soapenv:Envelope>
XML

Sample Response

<?xml version="1.0" encoding="utf-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="https://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="https://ispringlearn.com/go/services/api/soap">
   <SOAP-ENV:Body>
      <ns1:ListUsersResult>
         <ns1:userProfiles>
            <ns1:userProfile>
               <ns1:userId>string</ns1:userId>
               ...
            </ns1:userProfile>
            <ns1:userProfile>
               <ns1:userId>string</ns1:userId>
               ...
            </ns1:userProfile>
            <ns1:userProfile>
               <ns1:userId>string</ns1:userId>
               ...
            </ns1:userProfile>
         </ns1:userProfiles>
         <ns1:nextPageToken>string</ns1:nextPageToken>
      </ns1:ListUsersResult>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope>
XML