Assign Device Type to Devices

This endpoints assigns one or more devices to a specific Device Type.

Request

To assign a specific Device Type to one or more devices please make a POST request to the following URL:

HTTP MethodURL
POSThttps://industrial.ubidots.com/api/v2.0/device_types/<device_types_key>/_/devices/apply/

Path Parameters

ParameterTypeDescription
<device_types_key>StringThe id or label of the Device Type, label should use the prefix ~

Header

ParameterTypeRequired?Description
X-Auth-HeaderStringYesAuthentication Token of account
Content-TypeString (application/json)YesContent 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
}'

Response

{"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."
}