Fetch User by UserId
👤 Fetch User by UserId API
This API allows enterprise backend systems to retrieve complete details of a specific REL-ID user using their unique userId
.
🔗 Endpoint
GET https://REL-ID-SERVER-IP:9442/v1/users/{userId}
🔐 Authorization
Authorization: Bearer <access_token>
📥 Path Parameter
Parameter | Required | Description |
---|---|---|
userId | ✅ Yes | REL-ID user ID for which details need to be fetched. |
📤 Request Body
- None (leave the body blank)
📤 Response Parameters
Field | Type | Description |
---|---|---|
firstName | String | First name of the user. |
lastName | String | Last name of the user. |
userId | String | Unique REL-ID user identifier. |
primaryGroup | String | The primary group to which the user belongs. |
secondaryGroups | Array | List of additional group names the user is associated with. |
emailId | String | Email address associated with the user. |
mobileNumber | String | Mobile number associated with the user. |
status | String | Current status of the user. Possible values: CREATED , ACTIVE , BLOCKED , RESET , DELETED , PAUSED , ONBOARDING . |
createdTs | Long (ms) | Epoch timestamp in milliseconds when the user was created. |
updatedTs | Long (ms) | Epoch timestamp in milliseconds when the user's record was last updated. See explanation below. |
sourceType | String | Source of the user. Possible values: RELID , UNIKEN-AD . |
createdBy | String | Username of the admin or system that created the user. |
webOnlyUser | String | Indicates if the user is for web-only access. Default: "NA" unless explicitly set. |
🕒 updatedTs
- Possible Value Meanings
updatedTs
- Possible Value MeaningsThe value of updatedTs
depends on the latest change to the user record. Possible scenarios include:
User Status | Meaning of |
---|---|
| Timestamp when the user was created. |
| Timestamp when the user was reset. |
| Timestamp when the user status was updated to the respective state. |
| Timestamp when any of the following occurred: a. Device was deleted using GM b. Device was blocked/unblocked using GM c. User was unblocked using GM or API. |
This field helps track the most recent update made to the user.
✅ Success Response
HTTP Code | Response Type | Description |
---|---|---|
200 OK | JSON Object | Returns the user's complete profile details. |
🔄 Sample Response
{
"firstName": "myname",
"lastName": "mylastname",
"userId": "u1",
"primaryGroup": "WebAuthGroup",
"secondaryGroups": [],
"emailId": "[email protected]",
"mobileNumber": "",
"status": "CREATED",
"createdTs": 1707289562023,
"updatedTs": 1707289596534,
"sourceType": "RELID",
"createdBy": "gmuser",
"webOnlyUser": "NA"
}
❌ Error Responses (Collapsible)
🔍 404 - User Not Found
{
"timeStamp": "2023-05-30T12:33:32IST",
"status": 404,
"error": "Data not present.",
"message": "User does not exist: abc",
"path": "/v1/users/abc"
}
💥 500 - Internal Server Error
{
"timeStamp": "2024-02-10T10:03:57UTC",
"status": 500,
"error": "Internal Server Error",
"message": "Unexpected error occurred while processing request",
"path": "/v1/users/abc"
}
📝 Notes
- Ensure the
userId
exists in the REL-ID system. If not, the API will return a404 Not Found
. - This API retrieves data for a single user. For listing users, use:
GET /v1/users
.
Updated 3 months ago