Obtener Variable

Este endpoint devuelve una Variable específica.

Solicitud HTTP

Para obtener una sola Variable, haz una petición GET a la siguiente URL:

HTTP MethodURL
GEThttps://api.netux.com/api/v2.0/variables/<variable_id>/

Para obtener una sola Variable de un Device, haz una petición GET a la siguiente URL:

HTTP MethodURL
GEThttps://api.netux.com/api/v2.0/devices/<device_key>/variables/<variable_key>/

Parámetros de ruta

ParameterTypeDescription
variable_idStringThe id of the Variable

Parámetros de consulta

ParameterTypeUseDescription
tokenStringAuthenticationAuthentication Token can optionally be sent as a query parameter
fieldsComma separated listDynamic FieldsSpecify the fields that should be obtained in the response object

Cabecera

ParameterRequired?Description
X-Auth-TokenYesAuthentication Token of account
$ curl -X GET 'https://api.netux.com/api/v2.0/variables/<variable_id>' \
 -H 'X-Auth-Token: oaXBo6ODhIjPsusNRPUGIK4d72bc73'

Respuesta

Devuelve un objeto Variable con la Variable solicitada.

{
    "createdAt": "2019-12-18T14:38:38.354415Z",
    "syntheticExpression": "",
    "description": "my second variable",
    "device": {
        "id": "6e309da44fc8455a9cceb5aa",
        "label": "first-device",
        "name": "First Device",
"url":"https://api.netux.com/api/v2.0/devices/6e309da44fc8455a9cceb5aa"
    },
    "icon": "pencil",
    "id": "5dfa39ee1a9ca53020c69391",
    "label": "var0",
    "lastActivity": null,
    "lastValue": {},
    "name": "var0",
    "properties": {
            "any":"thing"
    },
    "tags": ["blue", "yellow"],
    "type": "raw",
    "unit": "meters",
    "url": "https://api.netux.com/api/v2.0/variables/5dfa39ee1a9ca53020c69391",
    "valuesUrl": "https://api.netux.com/api/v1.6/variables/5dfa39ee1a9ca53020c69391/values"
}
{
    "code": 400001,
    "message": "Validation Error.",
    "detail": {
        ....
    }
}
{
    "code": 401001,
    "message": "Authentication credentials were not provided.",
    "detail": "Authentication credentials were not provided."
}