Fetch User Devices
📱 Fetch User Devices API
This API returns a list of all devices associated with a given Ditto 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
| Parameter | Location | Type | Required | Description |
|---|---|---|---|---|
userId | Path | String | ✅ Yes | Ditto ID user ID for whom the associated devices should be fetched. |
❌ Request Body
- None (leave body blank)
✅ Success Response
| HTTP Code | Response Type | Description |
|---|---|---|
200 OK | Array of JSON Objects | List 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
| Field | Type | Description |
|---|---|---|
deviceName | String | Name of the device assigned by the platform or user. |
deviceUUID | String | Unique identifier for the device. |
platform | String | Operating system of the device (e.g., Android, iOS, Windows). |
status | String | Device status (e.g., ACTIVE, BLOCKED). |
createdTs | Long (ms) | Epoch time when the device was registered with Ditto ID. |
lastAccessedTs | Long (ms) | Epoch time of the last interaction with Ditto ID services. |
verificationKey | String | Key shown during activation; used for visual confirmation. |
deviceToken | String | Token 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.
statuscan 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.
Updated 8 months ago
Did this page help you?
