Copy Device

This endpoint copies one Device (including all Variables and Values) to another existing Device.

Request

To copy one Device to another please make a POST request to the following URL:

HTTP MethodURL
POSThttps://industrial.api.ubidots.com/api/v2.0/devices/_/migrate_values/

Query Parameters

ParameterTypeUseDescription
tokenStringAuthenticationAuthentication Token can optionally be sent as a query parameter.

Body Parameters

ParameterTypeRequired?Default ValueDescription
from<device_key>YesN/A (required)The id or label of the Device to copy, label should use the prefix ~
to<device_key>YesN/A (required)The id or label of the Device to copy to, label should use the prefix ~

📘

Destination Device

Please note that both devices have to exist. The endpoint does not create a new device.

Header

ParameterTypeDescription
X-Auth-TokenStringAuthentication Token of account
Content-TypeString (application/json)Content type of body
curl -X POST 'https://industrial.api.ubidots.com/api/v2.0/devices/_/migrate_values/' \
 -H 'Content-Type: application/json' \
 -H 'X-Auth-Token: oaXBo6ODhIjPsusNRPUGIK4d72bc73' \
 -d '{
  "from": "a0a04255a62c15d499405eb8",
  "to": "7a4021daa0a04255a62c15d4"
}'
{
    "task": {
        "id": "5ebda96e73efc323d89a628c"
    }
}
{
    "code": 400001,
    "message": "Validation Error.",
    "detail": {
        ....
    }
}
{
    "code": 401001,
    "message": "Authentication credentials were not provided.",
    "detail": "Authentication credentials were not provided."
}

Response

Returns a Task Id of the asynchronous process.

🚧

Attention

Variables are copied to the new device until the user limit of variables is reached. Hence, it is possible that not all variables are copied to the new device. In case not all variables are copied due to a user limit, please consider upgrading your plan.