Get Users Based On Role
The Get Users Based On Role API returns a list of users who have the specified role. The user's list will be ordered alphabetically according to the username.
Resource Informations
Name | Value |
---|---|
Requires authentication? | Yes |
Rate limited? | No |
Request
Request headers
Key | Value |
---|---|
Authorization | Bearer token |
Content-Type | application/json |
HTTP request URL for SSMS
GET https://{tenantId}.{hostname}/digitanium/v4/roles/{role-name}/users?limit=1&offset=1&isUserEnabled=boolean&isEmailVerified=boolean&firstName={firstname}&lastName={lastname}&email={emailID}&username={username}&orderBy=desc&orderByKey=lastname&genericSearchVal={string}
HTTP request URL for SHIFT
GET https://{hostname}/auth/realms/{tenantId}/v3_role/$role/users?limit=1&offset=1&isUserEnabled=boolean&isEmailVerified=boolean&firstName={firstname}&lastName={lastname}&email={emailID}&username={username}&orderBy=desc&orderByKey=lastname&genericSearchVal={string}
note
API requests must be made over https. Calls made over plain http will fail.
Parameters
Parameter Name | Type | Description |
---|---|---|
limit | Integer | provide limit |
offset | Integer | provide offset |
isUserEnabled | Boolean | Enable user. Per Default false |
username | String | Unique username of the user |
firstName | String | First name of user |
lastName | String | Last name of user |
isEmailVerified | String | Unique email corresponding to the user |
String | Email corresponding to the user | |
genericSearchVal | String | It is a customized search for first name, last name, email, or username, and if the search is empty, we will consider the firstname, lastname, email, and username parameters, else these four parameters will be ignored. |
orderBy | String | Provide "asc or desc" to order it. |
orderByKey | String | firstName or lastName or email or username |
info
offset - Page Number
limit - Page size
If offset = 3 and limit = 10, 3rd page with 10 records (21-30) are returned.
Request body
No request body fields are required.
Response
Field Name | Type | Description |
---|---|---|
message | String | Message explains result of the API call. Refer Response status Information for details. |
status | String | The status of the API call. Refer Response status Information for details. |
subSystem | Integer | subSystem categorizes the type of API that has been called. Refer Subsystem details for details. |
data | Object | User Profile Information |
Sample Response
{
"message": "Users fetched successfully",
"status": "Success",
"subSystem": 5,
"data": {
"userList": [
{
"username": "Adam",
"id": "f81a9eae-e402-4a10-8285-51df86874fb4",
"email": "adam@demomail.com",
"firstName": "Adam",
"lastName": "",
"enabled": true,
"emailVerified": false,
"attributes": {
"birthdate": ["DD.MM.YYYY"],
"phone_number": ["0987654321"]
},
"requiredActions": [],
"admin": false
},
{
"username": "eve",
"id": "b9571a83-7770-44b9-aada-f17443e8d11d",
"email": "eve@demomail.com",
"firstName": "Eve",
"lastName": "",
"enabled": true,
"emailVerified": false,
"attributes": {
"phone_number": ["0123456789"]
},
"requiredActions": [],
"admin": false
}
],
"page": {
"pageSize": 1,
"totalRecords": 40542,
"totalPages": 40542,
"currentPage": 1
}
}
}
Response Status Information
Status Code | Status | Message |
---|---|---|
200 | Success | Users fetched successfully |
400 | BAD_REQUEST | ROLE_NOT_FOUND |
401 | Unauthorized | HTTP 401 Unauthorized |
404 | Not Found | Not Found |