Search users in your organization
Introduction
For the complete control and overlook of the access in your organization you need to be able to export a list of users that have access to the application. If you wish to do so through the API this guide is for you.
In this guide, we're walking you through these scenarios:
Extract basic and full info about the users
Filter the results based on the group the user is assigned to
Each scenario uses the same endpoint, but the queries vary depending to what results you need.
Requirements
Circularo admin account: This grants you the necessary permissions to access user data.
Read more about Circularo administration - User administration
Group ID: we will show you in this guide how to retrieve it
Before we start
Please keep in mind that the maximum results of one query is 100.
This cannot be raised so if you have more users in your organization you need to loop through the results.
You can display results starting from a certain number using the from
value.
Also the default number of records per response is 10 so if you need to have more you need to specify size
value.
For example if you have 150 users in your organization and you need to show results from 100 - 150:
{
"userQuery":{
"from": 100,
"size": 50,
}
}
1. Get basic and full info
Basic info
This will let you see some basic information about the user.
Endpoint
POST /users/search
Request
POST /users/search?token=Hgfe4vcstYTbtJtNwJJRRM59lbl3C9AsKSaVJSXM0zGv3zbXZmW5CuuTWVHAGTEF
Response
{
"results": [
{
"fullname": "Hugo Sonda",
"image": null,
"mail": "hugo@circularo.com",
"recordType": "internal",
"customFields": {},
"hasActiveDelegation": false,
"language": "en",
"name": "hugo@circularo.com"
},
{
"fullname": "Adam Smith",
"image": null,
"mail": "adam.smith@circularo.com",
"recordType": "internal",
"role": "Senior Retail Operations Assistant",
"customFields": {},
"hasActiveDelegation": false,
"language": "en",
"name": "adam.smith@circularo.com",
"phone": "+971555666055"
},
{
"fullname": "John Doe",
"image": null,
"mail": "john.doe@circularo.com",
"recordType": "internal",
"customFields": {},
"hasActiveDelegation": false,
"language": "en",
"name": "john.doe@circularo.com"
}
],
"total": 3
}
Full info
This will let you see full information about each user.
Endpoint
POST /users/search
Request
POST /users/search?token=Hgfe4vcstYTbtJtNwJJRRM59lbl3C9AsKSaVJSXM0zGv3zbXZmW5CuuTWVHAGTEF
Content-Type: application/json
{
"format": "full"
}
Response
{
"results": [
{
"fullname": "Hugo Sonda",
"image": null,
"mail": "hugo@circularo.com",
"recordType": "internal",
"customFields": {},
"hasActiveDelegation": false,
"language": "en",
"name": "hugo@circularo.com",
"allowBiometricSignature": false,
"autoTimezone": true,
"backgroundJobs": [],
"config": {
"delegation": {
"time": {}
},
"language": "en",
"navigationOpen": true,
"notifications": {
"enableAlerts": false,
"inApp": [
...
],
"mail": [
...
]
},
"photo": {},
"scheduler": true,
"view": "tableView"
},
"createType": "internal",
"dateformat": "dd/MM/yyyy",
"disabledIntros": [
"first_login"
],
"filters": [],
"firstDayOfWeek": 1,
"group": [
"57f03d46-59e5-464c-9476-6d11aca88395",
"f8b8db2d-094d-4644-9991-9d7cf3832416",
"2bfc3601-44b4-4d20-ac41-b108dd743b7e",
"494f4f2f-4215-452c-b004-1bcad4706626"
],
"id": "hugo@circularo.com",
"identities": [],
"lastReleaseAnnouncementSeen": "22.1.0",
"marketing": false,
"providers": [],
"registeredOn": "2022-11-07T21:09:36.419Z",
"stamp": [],
"status": "active",
"statusChangedOn": "2023-08-10T13:00:39.866Z",
"team": "494f4f2f-4215-452c-b004-1bcad4706626",
"templateUsage": [
{
"count": 1,
"custom": false,
"lastUsed": "2022-11-07T21:09:40.652Z",
"template": "d_default"
}
],
"termsAccepted": true,
"termsAcceptedOn": "2022-11-07T21:09:36.419Z",
"timeformat": "h:mm a",
"timezone": "Europe/Prague",
"version": 2
},
...
],
"total": 3
}
2. Filter results based on user group
Since you can divide your users into different groups you can also retrieve a list of users that are inside these groups.
Step 1 - Retrieve Organization ID
Lets fetch the info from our account:
Endpoint
GET /users/:id
Request
GET /users/john.doe@circularo.com?token=Hgfe4vcstYTbtJtNwJJRRM59lbl3C9AsKSaVJSXM0zGv3zbXZmW5CuuTWVHAGTEF
Response
{
...
"team": "57f03d46-59e5-464c-9476-6d11aca88395"
}
Note following properties in response object:
organizationId - In response object at position
team
.It may have value of
57f03d46-59e5-464c-9476-6d11aca88395
.
Step 2 - Obtain Group ID
Upon determining our organization's ID, we can find out internal group IDs. The essential information we require is nested in the teamGroups
object:
Endpoint
GET /groups/:organizationId
Request
GET /groups/57f03d46-59e5-464c-9476-6d11aca88395?token=Hgfe4vcstYTbtJtNwJJRRM59lbl3C9AsKSaVJSXM0zGv3zbXZmW5CuuTWVHAGTEF
Response
{
"_id": "57f03d46-59e5-464c-9476-6d11aca88395", //Organization ID
...
"name": "57f03d46-59e5-464c-9476-6d11aca88395",
"team": "57f03d46-59e5-464c-9476-6d11aca88395",
"teamGroups": { //IDs of the different groups according to user role
"admin": "ba2365e5-e436-4ac3-9072-dd6e47a4cbab",
"prepare": "f8b8db2d-094d-4644-9991-9d7cf3832416",
"read": "51767309-26a5-4189-b398-03a539478515",
"sign": "fc9d90b5-56b6-454c-99ba-8962bfe70361",
"user": "12c4ce16-8216-485f-adba-7e44292af1df"
},
"type": [
"team"
]
}
Note following properties in response object:
userGroupId - In response object at position
teamGroups.user
.It may have value of
12c4ce16-8216-485f-adba-7e44292af1df
.
Step 3 - Search users in group
Endpoint
POST /users/search
Request
POST /users/search?token=Hgfe4vcstYTbtJtNwJJRRM59lbl3C9AsKSaVJSXM0zGv3zbXZmW5CuuTWVHAGTEF
Content-Type: application/json
{
"userQuery": {
"query": {
"filter": [
{
"type": "terms",
"field": "group",
"value": [
"12c4ce16-8216-485f-adba-7e44292af1df" //Replace with your group ID
]
}
]
}
}
}
Response
{
"results": [
{
"fullname": "Adam Smith",
"image": null,
"mail": "adam.smith@circularo.com",
"recordType": "internal",
"role": "Senior Retail Operations Assistant",
"customFields": {},
"hasActiveDelegation": false,
"language": "en",
"name": "adam.smith@circularo.com",
"phone": "+971555666055"
}
],
"total": 1
}