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

ParameterRequiredDescription
userId✅ YesREL-ID user ID for which details need to be fetched.

📤 Request Body

  • None (leave the body blank)

📤 Response Parameters

FieldTypeDescription
firstNameStringFirst name of the user.
lastNameStringLast name of the user.
userIdStringUnique REL-ID user identifier.
primaryGroupStringThe primary group to which the user belongs.
secondaryGroupsArrayList of additional group names the user is associated with.
emailIdStringEmail address associated with the user.
mobileNumberStringMobile number associated with the user.
statusStringCurrent status of the user. Possible values: CREATED, ACTIVE, BLOCKED, RESET, DELETED, PAUSED, ONBOARDING.
createdTsLong (ms)Epoch timestamp in milliseconds when the user was created.
updatedTsLong (ms)Epoch timestamp in milliseconds when the user's record was last updated. See explanation below.
sourceTypeStringSource of the user. Possible values: RELID, UNIKEN-AD.
createdByStringUsername of the admin or system that created the user.
webOnlyUserStringIndicates if the user is for web-only access. Default: "NA" unless explicitly set.

🕒 updatedTs - Possible Value Meanings

The value of updatedTs depends on the latest change to the user record. Possible scenarios include:


User Status

Meaning ofupdatedTs Value

CREATED

Timestamp when the user was created.

RESET

Timestamp when the user was reset.

BLOCKED, DELETED, PAUSED, INACTIVE

Timestamp when the user status was updated to the respective state.

ACTIVE

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 CodeResponse TypeDescription
200 OKJSON ObjectReturns 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 a 404 Not Found.
  • This API retrieves data for a single user. For listing users, use: GET /v1/users.