In this article
Link Device to User
Links a device to a user.
To link a device to a user, you must be a Device Owner linked to a device.
Only an Admin can link any device to any user.
URL
https://{{HOST}}/security/user/device?v={version}&userId={userId}&deviceId={deviceId}
Method
POST
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/device?v=2.0 | number |
| userId required |
The ID of the user. | /user/device?userId=testUser | string |
| deviceId required |
The ID of the device. | /user/device?deviceId=testDevice | string |
Request Header Parameters
| Type | Value | Description |
|---|---|---|
| Authorization required |
Bearer {access_token} | IMS access token |
| Content-Type required |
application/json | Content Type |
Example
Request
curl -X POST
'https://{{HOST}}securityapi/user/device?v=2.0&userId=testUser&deviceId=testDevice'
-H 'Authorization: Bearer {access_token}'
-H 'Content-Type: application/json'
Response
{
"success": true
}
Errors
| Error | Description |
|---|---|
| Error Name | Description of Error |
Response Body Parameters
| Name | Description | Schema |
|---|---|---|
| Object Name | Description | object definition |
| success | Description | object definition |