Update Entire Device Group

This endpoint updates all fields of the Device Group specified in the body.

📘

Updating a Single Field

To update only a single field of a Device Group, please use the PATCH method with the parameters that need to be changed.

Request

To update all attributes of a Device Group please make a PUT request to the following URL:

HTTP MethodURL
PUThttps://industrial.api.ubidots.com/api/v2.0/device_groups/<device_group_key>/

Path Parameters

ParameterTypeDescription
<device_group_key>StringThe id or label of the Device Group, label should use the prefix ~

Query Parameters

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

Body Parameters

ParameterTypeRequired?Default ValueDescription
labelStringNoN/A (required)The API label of Device Group
nameStringNoSame as labelName of the Device Group
organizationObjectNonullOrganization of Device Group

Header

ParameterRequired?Description
X-Auth-TokenYesAuthentication Token of account
$ curl -X PUT 'https://industrial.api.ubidots.com/api/v2.0/device_groups/<device_group_key>' \
 -H 'Content-Type: application/json' \
 -H 'X-Auth-Token: oaXBo6ODhIjPsusNRPUGIK4d72bc73' \
 -d '{
    "url": "https://industrial.api.ubidots.com/api/v2.0/device_groups/5e1dd45a89f9bd7c4e7f1dff",
    "id": "5e1dd45a89f9bd7c4e7f1dff",
    "label": "elnuevogrupolabelytales",
    "name": "elnuevoGrupoYTales",
    "organization": {
        "url": "https://industrial.api.ubidots.com/api/v2.0/organizations/5e1dc90489f9bd7c4e7f1de0",
        "_deprecated_id": 6,
        "id": "5e1dc90489f9bd7c4e7f1de0",
        "label": "my-first-customer",
        "name": "My First Customer"
    },
    "devices": "https://industrial.api.ubidots.com/api/v2.0/device_groups/5e1dd45a89f9bd7c4e7f1dff/devices",
    "devicesNumber": 1,
}'
{
    "url": "https://industrial.api.ubidots.com/api/v2.0/device_groups/5e1dd45a89f9bd7c4e7f1dff",
    "id": "5e1dd45a89f9bd7c4e7f1dff",
    "label": "elnuevogrupolabelytales",
    "name": "elnuevoGrupoYTales",
    "organization": {
        "url": "https://industrial.api.ubidots.com/api/v2.0/organizations/5e1dc90489f9bd7c4e7f1de0",
        "_deprecated_id": 6,
        "id": "5e1dc90489f9bd7c4e7f1de0",
        "label": "my-first-customer",
        "name": "My First Customer"
    },
    "devices": "https://industrial.api.ubidots.com/api/v2.0/device_groups/5e1dd45a89f9bd7c4e7f1dff/devices",
    "devicesNumber": 1,
    "createdAt": "2020-01-14T14:46:50.708394Z"
}
{
    "code": 400001,
    "message": "Validation Error.",
    "detail": {
        ....
    }
}
{
    "code": 401001,
    "message": "Authentication credentials were not provided.",
    "detail": "Authentication credentials were not provided."
}

Response

Returns a Device Group object of the updated Device Group.