Skip to main content

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

NameValue
Requires authentication?Yes
Rate limited?No

Request

Request headers

KeyValue
AuthorizationBearer token
Content-Typeapplication/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 NameTypeDescription
limitIntegerprovide limit
offsetIntegerprovide offset
isUserEnabledBooleanEnable user. Per Default false
usernameStringUnique username of the user
firstNameStringFirst name of user
lastNameStringLast name of user
isEmailVerifiedStringUnique email corresponding to the user
emailStringEmail corresponding to the user
genericSearchValStringIt 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.
orderByStringProvide "asc or desc" to order it.
orderByKeyStringfirstName 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 NameTypeDescription
messageStringMessage explains result of the API call. Refer Response status Information for details.
statusStringThe status of the API call. Refer Response status Information for details.
subSystemIntegersubSystem categorizes the type of API that has been called. Refer Subsystem details for details.
dataObjectUser 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 CodeStatusMessage
200SuccessUsers fetched successfully
400BAD_REQUESTROLE_NOT_FOUND
401UnauthorizedHTTP 401 Unauthorized
404Not FoundNot Found