To assign a specific Device Type to one or more devices, 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 accountContent-Type String (application/json) Yes Content type of the request body
cURL (Request)
$ 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
}'
200 OK 400 Bad Request 401 Unauthorized
{"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."
}