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 Method | URL |
---|---|
POST | https://industrial.api.ubidots.com/api/v2.0/devices/_/migrate_values/ |
Query Parameters
Parameter | Type | Use | Description |
---|---|---|---|
token | String | Authentication | Authentication Token can optionally be sent as a query parameter. |
Body Parameters
Parameter | Type | Required? | Default Value | Description |
---|---|---|---|---|
from | <device_key> | Yes | N/A (required) | The id or label of the Device to copy, label should use the prefix ~ |
to | <device_key> | Yes | N/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
Parameter | Type | Description |
---|---|---|
X-Auth-Token | String | Authentication Token of account |
Content-Type | String (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.