Skip to main content

Search User By User Attribute

API to search and fetch the user list using user's attributes.

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/users/search/attribute?key={attribute_name}&value={attribute_value}

HTTP request URL for SHIFT

GET https://{hostname}/auth/realms/{tenantId}/v3_user/search/attribute?key={attribute_name}&value={attribute_value}
note

API requests must be made over https. Calls made over plain http will fail.

Parameters

Parameter NameTypeDescription
KeyStringProvide Attribute Name
ValueStringProvide Attribute value to search
important

In the value column while searching the user with string values make sure the special character (+) is replaced with (%2b). (Example: On using the phone number (+123456) to search, the user should use this format (%2b123456).

Request body

No request body fields 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.
dataObjectList of all User details for the given attributes. Refer Data Representation for details.

Sample Response

{
"message": "Users fetched successfully",
"status": "Success",
"subSystem": 5,
"data": [{
"username": "demotest",
"id": "89df9532-0990-46eb-93f3-920137063ab9",
"email": "testemail@email.com",
"firstName": "demo",
"lastName": "user",
"enabled": true,
"emailVerified": false,
"attributes": {
"attribute1": ["value1", "value2"],
"attribute2": ["value1"]
},
"requiredActions": [],
"admin": false
}]
}

Data Representation

Field NameTypeDescription
usernameStringUnique username of the user
idStringUnique system UUID, which will be generated automatically.
emailStringUnique email corresponding to the user
firstNameStringFirst name of user
lastNameStringLast name of user
enabledBooleanIndicates whether the user is enabled or not. true = enable & false = disable, Defaults to true.
emailVerifiedBooleanIs this enabled or not? true = enable & false = disable, Defaults to true.
attributesListBased on the user requirement the user attributes can be updated. User can add any customized attribute in form of key value pair.
requiredActionsList(String)List the actions which need to be performed during initial login. Refer Required Actions to know the supported actions.
adminBooleanIf set to true the user has admin role mapped, else not.

Response Status Information

Status CodeStatusMessage
200SuccessUsers fetched successfully.
400GENERAL ERRORFailed to get userCaused by null.
401UnauthorizedHTTP 401 Unauthorized.
404USER_NOT_FOUNDUser does not exist.