Fetch User Devices

📱 Fetch User Devices API

This API returns a list of all devices associated with a given REL-ID user. It is commonly used by enterprise applications for device auditing, monitoring, and management workflows.


🔗 Endpoint

GET https://REL-ID-SERVER-IP:9442/v1/users/{userId}/devices

🔐 Authorization

Authorization: Bearer <access_token>

📥 Path Parameter

ParameterLocationTypeRequiredDescription
userIdPathString✅ YesREL-ID user ID for whom the associated devices should be fetched.

❌ Request Body

  • None (leave body blank)

✅ Success Response

HTTP CodeResponse TypeDescription
200 OKArray of JSON ObjectsList of devices associated with the user.

🔄 Sample Success Response

[
  {
    "deviceName": "Windows_011124075739",
    "deviceUUID": "2QIVSXR6D8M36AWM2I5MD8FELN9CM9W2WLJ4HB21FOK7H",
    "platform": "Windows",
    "status": "ACTIVE",
    "createdTs": 1704959869216,
    "lastAccessedTs": 1704959869909,
    "verificationKey": "xyz123",
    "deviceToken": "XYZ456ABC"
  }
]

📤 Response Fields

FieldTypeDescription
deviceNameStringName of the device assigned by the platform or user.
deviceUUIDStringUnique identifier for the device.
platformStringOperating system of the device (e.g., Android, iOS, Windows).
statusStringDevice status (e.g., ACTIVE, BLOCKED).
createdTsLong (ms)Epoch time when the device was registered with REL-ID.
lastAccessedTsLong (ms)Epoch time of the last interaction with REL-ID services.
verificationKeyStringKey shown during activation; used for visual confirmation.
deviceTokenStringToken used for push notifications to this device.

❌ Error Responses

🔍 404 - User Not Found
{
  "timeStamp": "2023-05-30T12:33:32IST",
  "status": 404,
  "error": "user not found",
  "message": "User does not exists: abc",
  "path": "/v1/users/abc/devices"
}
ℹ️ 404 - No Devices Associated
{
  "timeStamp": "2023-05-30T12:33:32IST",
  "status": 404,
  "error": "user not found",
  "message": "User does not exists: abc",
  "path": "/v1/users/abc/devices"
}
💥 500 - Internal Server Error
{
  "timeStamp": "2023-06-12T11:43:50IST",
  "status": 500,
  "error": "Internal Server Error",
  "message": "Unexpected error occurred while processing request",
  "path": "/v1/users/abc/devices"
}

📝 Notes

  • All timestamps are returned in epoch milliseconds.
  • status can be used to distinguish between active, blocked, or inactive devices.
  • The API returns an empty list if the user exists but no devices are associated.