Actualizar todos los campos de un Device Type

Este endpoint actualiza todos los campos del Device Type especificado en el cuerpo.

Solicitud HTTP

Para actualizar todos los atributos de un Device Type específico, haz una petición PUT a la siguiente URL:

HTTP MethodURL
PUThttps://api.netux.com/api/v2.0/device_types/<device_type_key>/

Parámetros de ruta

ParameterTypeDescription
device_type_keyStringThe id or label of the Device Type, label should use the prefix ~

Parámetros de consulta

ParameterTypeUseDescription
tokenStringAuthenticationAuthentication Token can optionally be sent as a query parameter.
pageNumberPaginationReturns the corresponding page of the result
page_sizeNumberPaginationNumber of items per page, if not provided takes default values of 50 (for variables 200)
created_atStringSortSort all Variables based on date created. Default descending.
labelStringSortSort by label
nameStringSortSort by name

Parámetros de cuerpo

ParameterTypeRequired?Default ValueDescription
nameStringNoN/A (required)Name of Device Type
labelStringNoslug(label)Label of Device Type
descriptionStringNo""Description of Device Type
deviceColorStringNo""HTML Color of Device related to Device Type
deviceIconStringNo""Icon of Device related to Device Type
variableColorStringNo""Color of Variable related to Device Type
syntheticVariableColorStringNo""Color of Synthetic Variable related to Device Type
variablesObjectNo[]Variables related to Device Type
propertiesObjectNo[]Properties of Device Type
tasksObjectNo[]Tasks of Device Type

Cabecera

ParameterRequired?Description
X-Auth-TokenYesAuthentication Token of account
$ curl -X PUT 'https://api.netux.com/api/v2.0/device_types/<device_type_key>/' \
 -H 'Content-Type: application/json' \
 -H 'X-Auth-Token: oaXBo6ODhIjPsusNRPUGIK4d72bc73'
 -d ' {
    "name": "el type aquel",
    "label": "el-type-quel",
    "description": "La description aquella",
    "deviceColor": "#3BA9F5",
    "deviceIcon": "pencil",
    "variableColor": "#FFAE58",
    "syntheticVariableColor": "#",
    "variables": [],
    "properties": [],
    "tasks": []
}'

Respuesta

Devuelve un objeto Device Type con el Device Type actualizado.

{
    "url": "https://api.netux.com/api/v2.0/device_types/5e1f7e5789f9bd7c4e7f1e2c",
    "id": "5e1f7e5789f9bd7c4e7f1e2c",
    "name": "el type aquel",
    "label": "el-type-quel",
    "description": "La description aquella",
    "deviceColor": "#3BA9F5",
    "deviceIcon": "pencil",
    "variableColor": "#FFAE58",
    "syntheticVariableColor": "#",
    "variables": [],
    "properties": [],
    "tasks": [],
    "createdAt": "2020-01-15T21:04:23.602975Z"
}
{
    "code": 400001,
    "message": "Validation Error.",
    "detail": {
        ....
    }
}
{
    "code": 401001,
    "message": "Authentication credentials were not provided.",
    "detail": "Authentication credentials were not provided."
}