Para crear un nuevo Device Type, haz una petición POST a la siguiente URL:
HTTP Method | URL |
---|
POST | https://api.netux.com/api/v2.0/device_types/ |
Parameter | Type | Use | Description |
---|
token | String | Authentication | Authentication Token can optionally be sent as a query parameter |
Parameter | Type | Required? | Default Value | Description |
---|
label | String | Yes | N/A (required) | API label of Device Type |
name | String | No | slug(label ) | Name of Device Group |
description | String | No | "" | Description of Device Group |
deviceColor | String | No | "" | Color of Device Type |
deviceIcon | String | No | "" | Color of Device Type |
variableColor | String | No | "" | Color of Variables related to Device Type |
syntheticVariableColor | String | No | "" | Color of Synthetic Variables related to Device Type |
variables | Object Array | No | [] | Variables related to Device Type |
properties | Object Array | No | [] | Properties of Device Type |
tasks | Object Array | No | [] | Tasks of Device Type |
Parameter | Type | Description |
---|
X-Auth-Token | String | Authentication Token of account |
Content-Type | String (application/json) | Content type of body |
curl -X POST 'https://api.netux.com/api/v2.0/device_types/' \
-H 'Content-Type: application/json' \
-H 'X-Auth-Token: oaXBo6ODhIjPsusNRPUGIK4d72bc73' \
-d '{
"name": "el type aquel",
"label": "el-type-quel",
"description": "La description aquella",
"deviceColor": "#3BA9F5",
"deviceIcon": "pencil",
"variableColor": "#FFAE58",
"syntheticVariableColor": "#",
"variables": [
{
"properties": {
"isLocationVariable": false,
"hidden": false,
"_color": "#FFAE58",
"_icon": "cloud-upload"
},
"label": "var0",
"name": "var0",
"description": "",
"tags": null,
"type": 0,
"unit": ""
}
],
"properties": [],
"tasks": [
{
"id": "acbdee1d8472323763ff1b",
"type": "dashboard",
"name": "{{device.name}} Dashboard"
}
]
}'
Devuelve un objeto Device Type con el Device Type creado.
{
"url": "https://api.netux.com/api/v2.0/device_types/5e1f7e5789f9bd7c4e7f1e2c",
"id": "5e1f7e5789f9bd7c4e7f1e2c",
"name": "el type aquel",
"label": "el-type-quel",
"description": "La description aquella",
"deviceColor": "#3BA9F5",
"deviceIcon": "pencil",
"variableColor": "#FFAE58",
"syntheticVariableColor": "#",
"variables": [
{
"properties": {
"isLocationVariable": false,
"hidden": false,
"_color": "#FFAE58",
"_icon": "cloud-upload"
},
"label": "var0",
"name": "var0",
"description": "",
"tags": null,
"type": 0,
"unit": ""
}
],
"properties": [],
"tasks": [
{
"id": "acbdee1d8472323763ff1b",
"type": "dashboard",
"name": "{{device.name}} Dashboard"
}
],
"createdAt": "2020-01-15T21:04:23.602975Z"
}
{
"code": 400001,
"message": "Validation Error.",
"detail": {
....
}
}
{
"code": 401001,
"message": "Authentication credentials were not provided.",
"detail": "Authentication credentials were not provided."
}