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 MethodURL
POSThttps://industrial.api.ubidots.com/api/v2.0/device_groups/

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 Group
nameStringNoSame as labelName of Device Group
organization<organization_key>NonullKey of Organization (Id or Label)

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/events/' \
 -H 'Content-Type: application/json' \
 -H 'X-Auth-Token: oaXBo6ODhIjPsusNRPUGIK4d72bc73' \
 -d '{
    "url": "http://industrial.api.ubidots.com/api/v2.0/device_groups/5e1c9f7789f9bd33017e05ef",
    "id": "5e1c9f7789f9bd33017e05ef",
    "label": "ellabelytales",
    "name": "elGrupoYTales",
    "organization": null,
    "devices": "http://industrial.api.ubidots.com/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.