Este endpoint devuelve todos las Variables.
Solicitud HTTP
Para obtener todas las Variables, haz una petición GET a la siguiente URL:
HTTP Method | URL |
---|---|
GET | https://api.netux.com/api/v2.0/variables/ |
Para obtener todas las Variables de un Device, haz una petición GET a la siguiente URL:
HTTP Method | URL |
---|---|
GET | https://api.netux.com/api/v2.0/devices/<device_key>/variables/ |
Parámetros de consulta
Parameter | Type | Use | Description |
---|---|---|---|
token | String | Authentication | Authentication Token can optionally be sent as a query parameter. |
page | Number | Pagination | Returns the corresponding page of the result |
page_size | Number | Pagination | Number of items per page, if not provided takes default values of 50 (for variables 200) |
created_at | String | Sort | Sort all Variables based on date created. Default descending. |
label | String | Sort | Sort by label |
name | String | Sort | Sort by name |
fields | Comma separated list | Dynamic Fields | Specify the fields that should be obtained in the response object. |
search | String | Search | Allows to search on the following fields with one request label , name , description , username , firstName , lastName |
id | String | Filter | Filter by id |
label | String | Filter | Filter by label |
name | String | Filter | Filter by name |
description | String | Filter | Filter by description |
tags | Array | Filter | Filter by tags |
createdAt | Date | Filter | Filter by date created |
properties | Json | Filter | Filter by properties |
unit | String | Filter | Filter by unit |
device | Related Device Filter | Related Filter | Filter by Related Device Filter (device__<device_attribute>__<filter> ) |
lastActivity | Integer | Filter | Filter by last activity |
lastActivity
solo para el endpoint Obtener todas las Variables de un DeviceTen en cuenta: El parámetro de consulta
lastActivity
solo está disponible para el endpoint:
https://api.netux.com/api/v2.0/devices/<device_key>/variables/
Cabecera
Parameter | Required? | Description |
---|---|---|
X-Auth-Token | Yes | Authentication Token of account |
$ curl -X GET 'https://api.netux.com/api/v2.0/variables/' \
-H 'X-Auth-Token: oaXBo6ODhIjPsusNRPUGIK4d72bc73' \
Respuesta
Devuelve un objeto con un array results
que contiene todas las Variables.
{
"count": 1,
"next": null,
"previous": null,
"results": [
{
"createdAt": "2019-12-18T14:38:38.354415Z",
"syntheticExpression": "",
"description": "",
"device": {
"id": "6e309da44fc8455a9cceb5aa",
"label": "first-device",
"name": "First Device",
"url": "http://api.netux.com/api/v2.0/devices/6e309da44fc8455a9cceb5aa"
},
"icon": "",
"id": "781b33e657aa5dfa39e69391",
"label": "first-variable",
"lastActivity": null,
"lastValue": {},
"name": "First Variable",
"properties": {
"any": "thing"
},
"tags": [],
"type": "raw",
"unit": null,
"url": "http://api.netux.com/api/v2.0/variables/781b33e657aa5dfa39e69391",
"valuesUrl": "http://api.netux.com/api/v2.0/variables/781b33e657aa5dfa39e69391/values"
}
]
}
{
"code": 400001,
"message": "Validation Error.",
"detail": {
....
}
}
{
"code": 401001,
"message": "Authentication credentials were not provided.",
"detail": "Authentication credentials were not provided."
}