Create Device Group

This endpoint creates a new Device Group

Request

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

HTTP Method

URL

POST

https://industrial.api.ubidots.com/api/v2.0/device_groups/

Query Parameters

Parameter

Type

Use

Description

token

String

Authentication

Authentication Token can optionally be sent as a query parameter.

Body Parameters

Parameter

Type

Required?

Default Value

Description

label

String

Yes

N/A (required)

API label of Device Group

name

String

No

Same as label

Name of Device Group

organization

<organization_key>

No

null

Key of Organization (Id or Label)

Header

Parameter

Type

Description

X-Auth-Token

String

Authentication Token of account

Content-Type

String (application/json)

Content type of body

curl -X POST 'https://industrial.api.ubidots.com/api/v2.0/events/' \
 -H 'Content-Type: application/json' \
 -H 'X-Auth-Token: oaXBo6ODhIjPsusNRPUGIK4d72bc73' \
 -d '{
    "url": "http://localhost:8087/api/v2.0/device_groups/5e1c9f7789f9bd33017e05ef",
    "id": "5e1c9f7789f9bd33017e05ef",
    "label": "ellabelytales",
    "name": "elGrupoYTales",
    "organization": null,
    "devices": "http://localhost:8087/api/v2.0/device_groups/5e1c9f7789f9bd33017e05ef/devices",
}'
{
    "url": "https://industrial.api.ubidots.com/api/v2.0/device_groups/5e1c9f7789f9bd33017e05ef",
    "id": "5e1c9f7789f9bd33017e05ef",
    "label": "ellabelytales",
    "name": "elGrupoYTales",
    "organization": {
        "url": "https://industrial.api.ubidots.com/api/v2.0/organizations/876543211d847278b1baf2af",
        "_deprecated_id": 987,
        "id": "8765432171d847278b1baf2af",
        "label": "my_org",
        "name": "My org"
    },
    "devices": "https://industrial.api.ubidots.com/api/v2.0/device_groups/5e1c9f7789f9bd33017e05ef/devices",
    "deviceFilter": {},
    "createdAt": "2020-01-13T16:48:55.972853Z"
}
{
    "code": 400001,
    "message": "Validation Error.",
    "detail": {
        ....
    }
}
{
    "code": 401001,
    "message": "Authentication credentials were not provided.",
    "detail": "Authentication credentials were not provided."
}

Response

Returns an Device Group object of the Device Group created.