Operación Bulk: Actualizar todos los campos de Devices

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

📘

Actualizando un solo campo

Para actualizar sólo un campo de un Device, utiliza el método PATCH con los parámetros que necesiten modificarse.

Solicitud HTTP

Para actualizar todos los atributos de uno o más Device(s), haz una petición POST a la siguiente URL:

HTTP MethodURL
POSThttps://api.netux.com/api/v2.0/devices/_/bulk/update/

🚧

Es un POST

Ten en cuenta que es una petición POST y no una petición PUT.

Parámetros de consulta

ParameterTypeUseDescription
tokenStringAuthenticationAuthentication 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
labelStringYesThe 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

ParameterRequired?Description
X-Auth-TokenYesAuthentication Token of account
X-Bulk-OperationBooleanNeed to be set to True for the bulk operation to work
Content-TypeString (application/json)Content type of body
$ curl -X POST '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": "5fe3a56573efc32098765432",
    "label": "device0",
    "name": "Devive 0",
    "description": "My Device Zero",
    "organization": "~my_organization",
    "properties": {
        "_color": "#3BA9F5",
        "_config": {
            "number": {
                "text": "number1",
                "type": "text"
            }
        },
        "_device_type": "assign-group-0",
        "_icon": null,
        "me_prop": "",
        "number": "3891234567"
    },
    "tags": ["black"],
  },
...
  {
    "id": "5fe3a56573efc32abcd12345",
    "label": "device1",
    "name": "Devive 1",
    "description": "My Device One",
    "organization": "~my_organization",
    "properties": {
        "_color": "#3BA9F5",
        "_config": {
            "number": {
                "text": "number1",
                "type": "text"
            }
        },
        "_device_type": "assign-group-0",
        "_icon": null,
        "me_prop": "",
        "number": "3897654321"
    },
    "tags": ["white"],
  }
]'

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