Update Device Type

This endpoints updates certain fields of the Device Type specified in the body.

Request

To update all attributes of a specific Device Type please make a PATCH request to the following URL:

HTTP Method

URL

PATCH

https://industrial.api.ubidots.com/api/v2.0/device_types/<device_type_key>/

Path Parameters

Parameter

Type

Description

device_type_key

String

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

Query Parameters

Parameter

Type

Use

Description

token

String

Authentication

Authentication Token can optionally be sent as a query parameter.

page

Number

Pagination

Returns the corresponding page of the result

page_size

Number

Pagination

Number of items per page, if not provided takes default values of 50 (for variables 200)

created_at

String

Sort

Sort all Variables based on date created. Default descending.

label

String

Sort

Sort by label

name

String

Sort

Sort by name

Body Parameters

Parameter

Type

Required?

Description

name

String

No

Name of Device Type

label

String

No

Label of Device Type

description

String

No

Description of Device Type

deviceColor

String

No

HTML Color of Device related to Device Type

deviceIcon

String

No

Icon of Device related to Device Type

variableColor

String

No

Color of Variable related to Device Type

syntheticVariableColor

String

No

Color of Synthetic Variable related to Device Type

variables

Object

No

Variables related to Device Type

properties

Object

No

Properties of Device Type

tasks

Object

No

Tasks of Device Type

Header

Parameter

Required?

Description

X-Auth-Header

Yes

Authentication Token of account

$ curl -X PATCH
'https://industrial.api.ubidots.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": []
}'
{
    "url": "https://industrial.api.ubidots.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."
}

Response

Returns a Device Type object with the updated Device Type.