In this article
Get User Devices
To find devices linked to a specific user.
URL
https://{{HOST}}/security/user/devices?v={version}&userId={userId}
Method
GET
Required IMS Scopes
- securityapi_all
Versions Supported
- 2.0 (Default)
URL Query Parameters
| Name | Description | Example | Type |
|---|---|---|---|
| v optional |
Version of the api to use | /user?v=2.0 | number |
| userId required |
The ID of the user. | /user?userId=testUser | string |
Request Header Parameters
| Type | Value | Description |
|---|---|---|
| Authorization required |
Bearer {access_token} | IMS access token |
Example
Request
curl -X GET
'https://{{HOST}}/securityapi/user/devices?v=2.0userId=testUser'
-H 'Authorization: Bearer {access_token}'
Response
[
{
"properties": {
"DeviceID": "testdevice-1f27d1d438",
"HubEnabledState": null,
"CreatedTime": "2017-01-05T23:10:14.0433755Z",
"DeviceState": "normal",
"UpdatedTime": null
},
"commands": [],
"telemetries": null,
"shadow": {
"revision": 0,
"schemaVersion": 1,
"deviceType": 0
},
"id": "testdevice-1f27d1d438",
"subject": null
}
]
Errors
| Error | Description |
|---|---|
| Error Name | Description of Error |
Response Body Parameters
| Name | Description | Schema |
|---|---|---|
| Object Name | Description | object definition |
| properties | Description | object definition |
| commands | Description | object definition |
| telemetries | Description | object definition |
| shadow | Description | object definition |
| id | Description | object definition |
| subject | Description | object definition |