Este endpoint actualiza todos los campos del Device Group especificado en el cuerpo.
Actualizando un solo campo
Para actualizar sólo un campo de un Device Group, utiliza el método PATCH con los parámetros que deben cambiarse.
Solicitud HTTP
Para actualizar todos los atributos de un Device Group, haz una petición PUT a la siguiente URL:
HTTP Method | URL |
---|---|
PUT | https://api.netux.com/api/v2.0/device_groups/<device_group_key>/ |
Parámetros de ruta
Parameter | Type | Description |
---|---|---|
device_group_key | String | The id or label of the Device Group, label should use the prefix ~ |
Parámetros de consulta
Parameter | Type | Use | Description |
---|---|---|---|
token | String | Authentication | Authentication Token can optionally be sent as a query parameter. |
Parámetros de cuerpo
Parameter | Type | Required? | Default Value | Description |
---|---|---|---|---|
label | String | No | N/A (required) | The API label of Device Group |
name | String | No | Same as label | Name of the Device Group |
organization | Object | No | null | Organization of Device Group |
Cabecera
Parameter | Required? | Description |
---|---|---|
X-Auth-Token | Yes | Authentication Token of account |
$ curl -X PUT 'https://api.netux.com/api/v2.0/device_groups/<device_group_key>' \
-H 'Content-Type: application/json' \
-H 'X-Auth-Token: oaXBo6ODhIjPsusNRPUGIK4d72bc73' \
-d '{
"url": "https://api.netux.com/api/v2.0/device_groups/5e1dd45a89f9bd7c4e7f1dff",
"id": "5e1dd45a89f9bd7c4e7f1dff",
"label": "elnuevogrupolabelytales",
"name": "elnuevoGrupoYTales",
"organization": {
"url": "https://api.netux.com/api/v2.0/organizations/5e1dc90489f9bd7c4e7f1de0",
"_deprecated_id": 6,
"id": "5e1dc90489f9bd7c4e7f1de0",
"label": "my-first-customer",
"name": "My First Customer"
},
"devices": "https://api.netux.com/api/v2.0/device_groups/5e1dd45a89f9bd7c4e7f1dff/devices",
"devicesNumber": 1,
}'
Respuesta
Devuelve un objeto Device Group con el Device Group actualizado.
{
"url": "https://api.netux.com/api/v2.0/device_groups/5e1dd45a89f9bd7c4e7f1dff",
"id": "5e1dd45a89f9bd7c4e7f1dff",
"label": "elnuevogrupolabelytales",
"name": "elnuevoGrupoYTales",
"organization": {
"url": "https://api.netux.com/api/v2.0/organizations/5e1dc90489f9bd7c4e7f1de0",
"_deprecated_id": 6,
"id": "5e1dc90489f9bd7c4e7f1de0",
"label": "my-first-customer",
"name": "My First Customer"
},
"devices": "https://api.netux.com/api/v2.0/device_groups/5e1dd45a89f9bd7c4e7f1dff/devices",
"devicesNumber": 1,
"createdAt": "2020-01-14T14:46:50.708394Z"
}
{
"code": 400001,
"message": "Validation Error.",
"detail": {
....
}
}
{
"code": 401001,
"message": "Authentication credentials were not provided.",
"detail": "Authentication credentials were not provided."
}