Get user list
OVERVIEW
Get a list of users
This API call is used to retrieve a list of users from the system.
Note:
1. New query parameters introduced with this version are:
neverlogin, neverinvited, notingroup, ordertype, orderby, orgid, groupid, externalid, firstname, lastname, email, search
2. Introduced fields totalcount, total
3. Introduced the following fields for the response body
emaildomain, org, invitationsent, createdby, createddate, modifiedby, modifieddate, ifpartner, lastlogindate, invalidlogins, externalid, publicwebsiteprofileid, systemuser, resetpassworddate, usertypeid, avatar, practicegroup, langcode, publicprofile, dateOfBirth
4. The "location" tag has been renamed to "address" tag to make it consistent with the Collaborate UI
5. In every GET API # value for search is not supported because the jersey framework itself does not support #.
After # all the parameters/values will be ignored.
The response will now display the address as
<address>
<addressid>1</addressid>
<addressline1>2nd floor</addressline1>
<addressline2>additional</addressline2>
<city>london</city>
<state>state</state>
<country>uk</country>
<postCode>EC4R</postCode>
</address>
instead of
<location>
<addressline1>2nd floor, 55 King William Street</addressline1>
<addressline2>additional</addressline2>
<addressline3>state</addressline3>
<city>London</city>
<country>United Kingdom</country>
<postcode>EC4R 9AD</postcode>
</location>
HTTP Request
GET /api/3/users?status={status}& offset={offset}&limit={limit}&
neverlogin={true|false}&
neverinvited={true|false}&
notingroup={true|false}
ordertype={ordertype}&
orderby={orderby}&
orgid={organisation id csv}&
groupid={group id csv}&
externalid={external id}&
firstname={first name}&
lastname={last name}&
email={email}&
search={firstname OR lastname OR email OR externalid}
alphabets={lastname starting with}&
jobtitle={job title pipe separated value}&
departments={department id pipe separated value}&
locations={address city pipe separated value}&
organisations={org name pipe separated value}&
specialities={user specialities pipe separated value}
URL Query Parameters
Parameter | Format | Description |
---|---|---|
status (optional) | String |
Possible values for the status are Active, Archived, Inactive and Locked. If more than one is specified, this should be in a comma separated list If a value is not provided, the API endpoint will return a list of all users with any status in the system. i.e if the user is active, archived or inactive,locked |
limit (optional) | String | The number of items to return in an individual get call |
offset (optional) | String | The starting position of the user list from when the user list should be returned. This is to allow pagination |
orgid(optional) | String | Organisations - if more than one is specified, this should be in a comma separated list |
groupid(optional) | String | User Groups - if more than one is specified, this should be in a comma separated list |
notingroup(optional) | Boolean | Returns a list of users who are not in any group. The value can be either true or false. |
neverinvited(optional) | Boolean | Returns a list of users who have never been invited. The value can be either true or false. |
neverlogin(optional) | Boolean | Returns a list of users who have never logged in. The value can be either true or false. |
ordertype(optional) | String |
This returns a list of users on a specified sort type. The default sort type is organisation. Possible fields: name, organisation, status, invited, lastlogin, fname, lname, email, jobtitle, department, createddate, modifieddate, userid |
orderby(optional) | String |
This sorts the result on ordertype. The default value of orderby is asc. Possible Values: asc and desc |
externalid(optional) | String | Returns a user who has the given externalid |
firstname(optional) | String | Returns a list of users whose first name is given in the parameter |
lastname(optional) | String | Returns a list of users whose last name is given in the parameter |
email(optional) | String | Returns a user who has given the email id |
search | String | This returns a list of users whose first name, Last Name, Email and externalID are like what has been given in the parameter. |
alphabets(optional) | String | Returns list of users whose last name starts with the value given in parameter |
jobtitle(optional) | String | Returns list of users whose jobtitle matches any of the exact values given in the parameter pipe separated values (|) |
departments(optional) | String | Returns list of users whose department matches any of the exact values given in the parameter pipe separated values (|) |
locations(optional) | String | Returns list of users whose address city matches any of the exact values given in the parameter pipe separated values (|) |
organisations(optional | String | Returns list of users whose organisation name matches any of the exact values given in the parameter pipe separated values (|) |
specialities(optional) | String | Returns list of users whose specialities consist any of the exact values given in the parameter pipe separated values (|) |
Example
GET /api/3/users? status=active&offset=10&limit=50&
neverlogin=false&
neverinvited=true&
notingroup=true
ordertype=organisation&
orderby=desc&
orgid=1001,1002&
groupid=3,5&
externalid=user_123&
firstname=abc&
lastname=xyz&
email=abc.xyz@gmail.com&
search=xyz
alphabets=c
jobtitle=business analyst|qa engineer
departments=IT|Research and Developement
locations=Calgary|London city
organisations=HighQ|Allen and Overy
specialities=abc def|uv wxyz
Notes :
- The value of limit parameter has the following behaviour:
- If no value is provided in the limit, 100 is used as the default value.
- If the limit is higher than 0, then it uses that value as limit.
- To return all the records use -1 for the limit.
- If the limit is lower than -1 then the limit value is set to a default value of 100.
- The value of the offset parameter has the following behaviour:
- If no value is provided in the offset, 0 is used as the default value.
- If the offset is lower than 0, then an offset value is set to be a default value of 0.
- If the offset is higher than 0 and less than the number of records in the user list, then the records starting from the offset value are returned.
- If the offset is higher than the total number of records in the user list, then the offset has a default value of 0.
HTTP Response
Success
HTTP response is 200 with a list of user summary object
Error
XML response
<users>
<total>506</total>
<totalcount>1</totalcount>
<user>
<userid>134</userid>
<name>
<firstname>Tom</firstname>
<lastname>Chick</lastname>
</name>
<email>tom.chick7@highq.com</email>
<jobtitle>Senior Solution Architect</jobtitle>
<mobile>91$8918291212</mobile>
<department>IT</department>
<status>Active</status>
<organisation>
<orgname>HighQ</orgname>
<orgid>1</orgid>
</organisation>
<invited></invited>
<lastlogin></lastlogin>
<externalid></externalid>
<avatar>0</avatar>
<address>
<addressline1>404, 5th Ave</addressline1>
<addressline2></addressline2>
<city>New York</city>
<country>USA</country>
<state></state>
</address>
<specialities> java, dotnet</specialities>
<phone>91$079$81716551</phone>
<invalidlogins>0</invalidlogins>
</user>
</users>
JSON response
{
"total": "506",
"totalcount": "1",
"user": [
{
"userid": 134,
"name": {
"firstname": "Tom",
"lastname": "Chick"
},
"email": "tom.chick7@highq.com",
"jobtitle": "Senior Solution Architect",
"mobile": "91$8918291212",
"department": "IT",
"status": "Active",
"organisation": {
"orgname": "HighQ",
"orgid": 1
},
"invited": "",
"lastlogin": "",
"externalid": "",
"avatar": 0,
"address": {
"addressline1": "404, 5th Ave",
"addressline2": "",
"city": "New York",
"state": "",
"country": "USA"
},
"specialities": " java, dotnet",
"phone": "91$079$81716551",
"invalidlogins": 0
}
]
Error messages
Summary | Ref Code (before V4) | Ref Code (V4) |
Invalid input for user status. It would be ACTIVE,ARCHIVED or INACTIVE | 147 | 147 |
The Organisation id is invalid | N/A | 260 |
The neverinvited value is invalid. True and false are supported neverinvited values. | N/A | 387 |
The neverlogin value is invalid. True and false are supported neverlogin values. | N/A | 388 |
The groupids are invalid. | N/A | 214 |
The notingroup value is invalid. True and false are supported notingroup values. | N/A | 389 |
The ordertype is invalid. name, organisation, status, invited,lastlogin,lname,fname,email,jobtitle,department, createddate,modifieddate and userid are supported ordertypes |
N/A | 289 |
The orderby value is invalid. asc and desc are supported orderby values. | N/A | 290 |
The offset value is invalid. | 138 | 138 |
The limit value is invalid. | 137 | 137 |
Comments
0 Comments