Copiar Values de una Variable

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 MethodURL
POSThttps://api.netux.com/api/v2.0/variables/_/migrate_values/

Parámetros de consulta

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

Parámetros de cuerpo

ParameterTypeRequired?Default ValueDescription
variablesArrayYesN/A (required)Array of Objects containing to and from Arrays, please see example below
startDateNumberNoStart date from which Values are copied, if not provided Values are copied from the very first Value
endDateNumberNoEnd 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 Cuerpo

Mira un ejemplo válido del array variables en el cuerpo a la derecha:

Cabecera

ParameterRequired?Description
X-Auth-TokenYesAuthentication Token of account
Content-TypeString (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."
}