Este endpoint copia uno o más Values de una Variable a otra Variable especificada y existente.
Solicitud HTTP
Para copiar uno o más Values de una Variable, haz una petición POST a la siguiente URL:
HTTP Method | URL |
---|---|
POST | https://api.netux.com/api/v2.0/variables/_/migrate_values/ |
Parámetros de consulta
Parameter | Type | Use | Description |
---|---|---|---|
token | String | Authentication | Authentication Token can optionally be sent as a query parameter. |
Parámetros de cuerpo
Parameter | Type | Required? | Default Value | Description |
---|---|---|---|---|
variables | Array | Yes | N/A (required) | Array of Objects containing to and from Arrays, please see example below |
startDate | Number | No | Start date from which Values are copied, if not provided Values are copied from the very first Value | |
endDate | Number | No | End date to which Values are copied, if not provided Values are copied until last Value |
Atención
Ten en cuenta que ambas Variables tienen que existir y que el token de autentificación tiene que tener permisos para ver y editar las Variables.
variables
Array en el CuerpoMira un ejemplo válido del array
variables
en el cuerpo a la derecha:
Cabecera
Parameter | Required? | Description |
---|---|---|
X-Auth-Token | Yes | Authentication Token of account |
Content-Type | String (application/json) | Content type of body |
//variables body attribute
//Please note that "device" key is optional if Variable is an Id, otherwise it's required
"variables": [
{
"from": { "variable": originVariable1ID },
"to": { "device": "~targetDevice1", "variable": "~targetVariable1" }
},
{
"from": { "variable": originVariable2ID },
"to": { "device": "~targetDevice2", "variable": "~targetVariable2" }
},
{
"from": { "variable": originVariableNID },
"to": { "device": "~targetDeviceN", "variable": "~targetVariableN" }
}
]
curl -X POST 'https://api.netux.com/api/v2.0/variables/_/migrate_values/' \
-H 'Content-Type: application/json' \
-H 'X-Auth-Token: oaXBo6ODhIjPsusNRPUGIK4d72bc73' \
-d '{
"variables": [
{
"from": { "variable": "5f073bfb4763e7780a77bba2" },
"to": { "device": "~device1", "variable": "~variable1" }
}
],
"startDate": None,
"endDate": None
}}'
Respuesta
Devuelve un Task Id del proceso asíncrono.
{
"task": {
"id": "5ebda96e73efc323d89a628c"
}
}
{
"code": 400001,
"message": "Validation Error.",
"detail": {
....
}
}
{
"code": 401001,
"message": "Authentication credentials were not provided.",
"detail": "Authentication credentials were not provided."
}