Create Device Type

This endpoint creates a new Device Type.

Request

To create a new Device Type please make a POST request to the following URL:

HTTP MethodURL
POSThttps://industrial.api.ubidots.com/api/v2.0/device_types/

Query Parameters

ParameterTypeUseDescription
tokenStringAuthenticationAuthentication Token can optionally be sent as a query parameter.

Body Parameters

ParameterTypeRequired?Default ValueDescription
labelStringYesN/A (required)API label of Device Type
nameStringNoslug(label)Name of Device Group
descriptionStringNo""Description of Device Group
deviceColorStringNo""Color of Device Type
deviceIconStringNo""Color of Device Type
variableColorStringNo""Color of Variables related to Device Type
syntheticVariableColorStringNo""Color of Synthetic Variables related to Device Type
variablesObject ArrayNo[]Variables related to Device Type
propertiesObject ArrayNo[]Properties of Device Type
tasksObject ArrayNo[]Tasks of Device Type

Header

ParameterTypeDescription
X-Auth-TokenStringAuthentication Token of account
Content-TypeString (application/json)Content type of body
curl -X POST 'https://industrial.api.ubidots.com/api/v2.0/device_types/' \
 -H 'Content-Type: application/json' \
 -H 'X-Auth-Token: oaXBo6ODhIjPsusNRPUGIK4d72bc73' \
 -d '{
    "name": "device-name",
    "label": "device-label",
    "description": "Brief description for the device",
    "deviceColor": "#3BA9F5",
    "deviceIcon": "pencil",
    "variableColor": "#FFAE58",
    "syntheticVariableColor": "#",
    "variables": [
                {
                    "properties": {
                        "isLocationVariable": false,
                        "hidden": false,
                        "_color": "#FFAE58",
                        "_icon": "cloud-upload"
                    },
                    "label": "var0",
                    "name": "var0",
                    "description": "",
                    "tags": null,
                    "type": 0,
                    "unit": ""
                }
            ],
    "properties": [],
    "tasks": [
                {
                    "id": "acbdee1d8472323763ff1b",
                    "type": "dashboard",
                    "name": "{{device.name}} Dashboard"
                }
            ]
}'
{
    "url": "https://industrial.api.ubidots.com/api/v2.0/device_types/5e1f7e5789f9bd7c4e7f1e2c",
    "id": "5e1f7e5789f9bd7c4e7f1e2c",
    "name": "device-name",
    "label": "device-label",
    "description": "Brief description for the device",
    "deviceColor": "#3BA9F5",
    "deviceIcon": "pencil",
    "variableColor": "#FFAE58",
    "syntheticVariableColor": "#",
    "variables": [
                {
                    "properties": {
                        "isLocationVariable": false,
                        "hidden": false,
                        "_color": "#FFAE58",
                        "_icon": "cloud-upload"
                    },
                    "label": "var0",
                    "name": "var0",
                    "description": "",
                    "tags": null,
                    "type": 0,
                    "unit": ""
                }
            ],
    "properties": [],
    "tasks": [
                {
                    "id": "acbdee1d8472323763ff1b",
                    "type": "dashboard",
                    "name": "{{device.name}} Dashboard"
                }
            ],
    "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 an Device Type object of the Device Type created.