Skip to main content

Device Controls

Background

The Device Controls API is useful for performing actions and operations on a device.

Some examples include device, rebootDevice, factoryReset, and deleteDevices.

Since this API grouping is built around taking actions on devices, you'll notice there are more mutations than queries when you reference the Use Cases & Supported APIs section.

We'll start by running a mutation to reboot a device.

Mutation Using rebootDevice

Test this query in the GraphQL Playground

mutation reboot($deviceId: String!) {
rebootDevice(deviceId: $deviceId) {
error
success
}
}

Variables

{
"deviceId": "00e0fr775sd0"
}

Response

{
"data": {
"rebootDevice": {
"error": null,
"success": true
}
}
}

It's important to note that the includeLinkedDevices argument doesn't currently reboot Poly TC8s linked to Poly OS devices. Work is being done to fix this in a future Poly OS release.

Mutation Using rebootBySite

If you need to reboot multiple devices, you can use the rebootBySite mutation to target all applicable devices within that site.

Test this query in the GraphQL Playground

mutation rebootBySite($siteId: String!) {
rebootDevicesBySiteId(siteId: $siteId) {
error
success
}
}

Variables

{
"siteId": "b25a9126-45f4-4fl0-451a-56c06po1w74g"
}

Response

{
"data": {
"rebootDevicesBySiteId": {
"error": null,
"success": true
}
}
}

Mutation Using updateDevice

If you need to update a device's name, site, or room information, you can use the updateDevice mutation to change those fields.

Test this query in the GraphQL Playground

mutation updateDeviceName($fields: UpdateDeviceRequest!, $updateDeviceId: String!) {
updateDevice(fields: $fields, id: $updateDeviceId) {
name
}
}

Variables

{
"fields": {
"name": "DR Dev Lab Studio X70"
},
"updateDeviceId": "00e0fr775sd0"
}

Response

{
"data": {
"updateDevice": {
"name": "DR Dev Lab Studio X70"
}
}
}

The mutations above are a small subset of the Device Controls API's capabilities. Please reach out if you have specific content requests or questions.