Crear Device Group

Este endpoint crea un nuevo Device Group.

Solicitud HTTP

Para crear un nuevo Device Group, haz una petición POST a la siguiente URL:

HTTP MethodURL
POSThttps://api.netux.com/api/v2.0/device_groups/

Parámetros de consulta

ParameterTypeUseDescription
tokenStringAuthenticationAuthentication Token can optionally be sent as a query parameter

Parámetros de cuerpo

ParameterTypeRequired?Default ValueDescription
labelStringYesN/A (required)API label of Device Group
nameStringNoSame as labelName of Device Group
organization<organization_key>NonullKey of Organization (Id or Label)

Cabecera

ParameterTypeDescription
X-Auth-TokenStringAuthentication Token of account
Content-TypeString (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",
}'

Respuesta

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."
}