This endpoints removes one or more devices from a specific Device Group.
Request
To remove one or more Devices from a 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/<device_group_key>/_/remove_devices/ |
Path Parameters
Parameter | Type | Description |
---|---|---|
<device_group_key> | String | The id or label of the Device Group, label should use the prefix ~ |
Query Parameters
Parameter | Type | Use | Description |
---|---|---|---|
token | String | Authentication | Authentication Token can optionally be sent as a query parameter. |
Header
Parameter | Required? | Description |
---|---|---|
X-Auth-Header | Yes | Authentication Token of account |
Remove all Devices at once
In order to remove all Devices from the Device Group in a single call, it is also possible to use the Assign Device to Device Group endpoint with an empty array
[]
in the body andclear=true
as a query parameter.
$ curl -X POST 'https://industrial.api.ubidots.com/api/v2.0/device_groups/<device_group_key>/_/remove_devices/' \
-H 'Content-Type: application/json' \
-H 'X-Auth-Token: oaXBo6ODhIjPsusNRPUGIK4d72bc73' \
-d '[
"5e1cc1e789f9bd33017e05f4",
"~test-device",
{"id": "5e1cc1e789f9bd335550d4c2b492"}
]'
{
"count": 0,
"next": null,
"previous": null,
"results": []
}
{
"code": 400001,
"message": "Validation Error.",
"detail": {
....
}
}
{
"code": 401001,
"message": "Authentication credentials were not provided.",
"detail": "Authentication credentials were not provided."
}
Response
Returns an Object with an empty results
array.