Para crear un nuevo Device Group, haz una petición POST a la siguiente URL:
HTTP Method | URL |
---|
POST | https://api.netux.com/api/v2.0/device_groups/ |
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 Group |
name | String | No | Same as label | Name of Device Group |
organization | <organization_key> | No | null | Key of Organization (Id or Label) |
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/events/' \
-H 'Content-Type: application/json' \
-H 'X-Auth-Token: oaXBo6ODhIjPsusNRPUGIK4d72bc73' \
-d '{
"url": "http://api.netux.com/api/v2.0/device_groups/5e1c9f7789f9bd33017e05ef",
"id": "5e1c9f7789f9bd33017e05ef",
"label": "ellabelytales",
"name": "elGrupoYTales",
"organization": null,
"devices": "http://api.netux.com/api/v2.0/device_groups/5e1c9f7789f9bd33017e05ef/devices",
}'
Devuelve un objeto Device Group con el Device Group creado.
{
"url": "https://api.netux.com/api/v2.0/device_groups/5e1c9f7789f9bd33017e05ef",
"id": "5e1c9f7789f9bd33017e05ef",
"label": "ellabelytales",
"name": "elGrupoYTales",
"organization": {
"url": "https://api.netux.com/api/v2.0/organizations/876543211d847278b1baf2af",
"_deprecated_id": 987,
"id": "8765432171d847278b1baf2af",
"label": "my_org",
"name": "My org"
},
"devices": "https://api.netux.com/api/v2.0/device_groups/5e1c9f7789f9bd33017e05ef/devices",
"deviceFilter": {},
"createdAt": "2020-01-13T16:48:55.972853Z"
}
{
"code": 400001,
"message": "Validation Error.",
"detail": {
....
}
}
{
"code": 401001,
"message": "Authentication credentials were not provided.",
"detail": "Authentication credentials were not provided."
}