You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Request: GET/user

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

To differentiate between these statuses, use the GET /user/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 lists of users belonging to the departments they manage and their sub-departments.

If you have more than 1000 users in your account, use the Getting a List of Users (Page-by-Page) request.

Request Headers

HeaderDescription
Authorization (required)Access token. You can obtain a token by making a request
ParameterDescription
departments (optional)

The array of departments IDs you want to get user lists of

groups (optional)The array of groups IDs you want to get user lists of
workLeaveStatus (optional)

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 Response Codes

CodeTextDescription
200OKThe request has been processed successfully
400Bad Requestrequest error
401UnauthorizedAn authorization error
403Permission deniedThe user doesn't have enough permissions to complete the request

Sample Request

GET /user?departments[]=e95b4ad0-5f50-11e9-80c4-0a580af406eb&groups[]=e0b394fc-44b9-11e9-92c8-0a580af401f6 https/1.1
Host: api-learn.ispringlearn.com 
Authorization: p-1sJDjmULL5DdpXPJTcbm4jVIaWVHvNmrjAxATRbNE

Sample Response

https/1.1 200 OK

<?xml version="1.0" encoding="UTF-8"?>
<response>
    <userProfile>
        <role>owner</role>
        <roleId>eaefe76e-2ae1-11e9-b90a-0242ac13000a</roleId>
        <userId>114dba08-a75e-11eb-b4e5-0242ac13002a</userId>
        <departmentId>1141d74c-a75e-11eb-ad56-0242ac13002a</departmentId>
        <status>1</status>
        <fields>
            <field>
                <name>FIRST_NAME</name>
                <value>Account</value>
            </field>
            <field>
                <name>LAST_NAME</name>
                <value>Owner</value>
            </field>
            <field>
                <name>LOGIN</name>
                <value>owner</value>
            </field>
            <field>
                <name>EMAIL</name>
                <value>owner@test.com</value>
            </field>
            <field>
                <name>PHONE</name>
                <value></value>
            </field>
            <field>
                <name>JOB_TITLE</name>
                <value></value>
            </field>
            <field>
                <name>COUNTRY</name>
                <value></value>
            </field>
        </fields>
        <addedDate>2021-04-27</addedDate>
        <lastLoginDate>2021-09-14</lastLoginDate>
        <manageableDepartmentIds>
            <id>1141d74c-a75e-11eb-ad56-0242ac13002a</id>
        </manageableDepartmentIds>
        <userRoles>
            <userRole>
                <roleId>eaefe76e-2ae1-11e9-b90a-0242ac13000a</roleId>
                <roleType>owner</roleType>
                <manageableDepartmentIds>
                    <id>1141d74c-a75e-11eb-ad56-0242ac13002a</id>
                </manageableDepartmentIds>
            </userRole>
            <userRole>
                <roleId>ab513fba-fc2e-11eb-a2f0-0242ac130034</roleId>
                <roleType>custom</roleType>
                <manageableDepartmentIds>
                    <id>1141d74c-a75e-11eb-ad56-0242ac13002a</id>
                </manageableDepartmentIds>
            </userRole>
        </userRoles>
    </userProfile>
    <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>+12345678910</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>
  • No labels