Operación Bulk: Actualizar campos de Devices

Este endpoint actualiza múltiples campos para múltiples Devices.

Solicitud HTTP

Para actualizar uno o más atributos específicos de uno o más Device(s), haz una petición PATCH a la siguiente URL:

HTTP Method

URL

PATCH

https://api.netux.com/api/v2.0/devices/_/bulk/update/

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

El cuerpo es un array que contiene objetos JSON Device. Cada objeto Device puede contener los siguientes parámetros de cuerpo:

ParameterTypeRequired?Description
idStringYesThe Device ID
labelStringNoThe API label of Device
nameStringNoName of the Device
descriptionStringNoDescription of Device
tagsString ArrayNoDevice tags
propertiesObjectNoDevice properties
organization<organization_key>NoKey of Organization (id or label)

Cabecera

Parameter

Required?

Description

X-Auth-Token

Yes

Authentication Token of account

X-Bulk-Operation

Boolean

Need to be set to True for the bulk operation to work

Content-Type

String (application/json)

Content type of body

$ curl -X PATCH 'https://api.netux.com/api/v2.0/devices/_/bulk/update/' \
 -H 'Content-Type: application/json' \
 -H 'X-Auth-Token: oaXBo6ODhIjPsusNRPUGIK4d72bc73' \
 -H 'X-Bulk-Operation: True' \
 -d '[
  {
    "id": "5df7b9c01a9ca5714e7a1305",
    "name": "device 1"
  },
...
  {
    "id": "rgnbj7809ca5pIhpjgc345fc",
    "name": "device 4"
  }
]'

Respuesta

Devuelve un Task Id del proceso asíncrono.

{
  "task": {
    "id": "tyg54645501a9ca5714e7b098721"
  }
}
{
    "code": 400001,
    "message": "Validation Error.",
    "detail": {
        ....
    }
}
{
    "code": 401001,
    "message": "Authentication credentials were not provided.",
    "detail": "Authentication credentials were not provided."
}
{
    "detail": "Header `X-BULK-OPERATION` should be provided for bulk operation."
}