To assign a specific Device Type to one or more devices please make a POST request to the following URL:
HTTP Method | URL |
---|
POST | https://industrial.ubidots.com/api/v2.0/device_types/<device_types_key>/_/devices/apply/ |
Parameter | Type | Description |
---|
<device_types_key> | String | The id or label of the Device Type, label should use the prefix ~ |
Parameter | Type | Required? | Description |
---|
X-Auth-Header | String | Yes | Authentication Token of account |
Content-Type | String (application/json) | Yes | Content type of body |
$ curl -X POST 'https://industrial.ubidots.com/api/v2.0/device_types/<device_types_key>/_/devices/apply/' \
-H 'Content-Type: application/json' \
-H 'X-Auth-Token: oaXBo6ODhIjPsusNRPUGIK4d72bc73' \
-d '{
"devices": ["abcde12345abcde12345", "54321bcda54321bcda", "~hd34233" ],
"applyTasks": false # default value is false
}'
{"succeed_count": 3, "failed_count": 0}
{
"code": 400001,
"message": "Validation Error.",
"detail": {
....
}
}
{
"code": 401001,
"message": "Authentication credentials were not provided.",
"detail": "Authentication credentials were not provided."
}