Set Device Configuration

Set and modify the Control configuration for a device with the updateDeviceConfigs request.

Select a single device or a bulk group of devices to modify by including a deviceQuery object in the request.

A deviceQuery may contain a list of :

  • serials
  • deviceIds
  • labelIds

To specify the values to change supply a data object. For information on each available data object item see the API documentation for updateDeviceConfigs under DATA_OBJECT.

For example:

    const changeData = {volume : 23,  rotation : 90};
    const reqData = {deviceQuery: {
        deviceIds: [],
        serials: ["2VY78AJQ1D", "77AD344RDL"],
        labelIds: []
      }, data: changeData};
    await fetch(url,{method: 'POST',
      headers:{ 'Authorization' : auth, 'Content-Type': 'application/json' },
      body: JSON.stringify(reqData)});

When the request is issued a jobTraceId will immediately be returned. All Skykit API requests that take a deviceQuery will return a jobTraceId. This ID can then be used to query the status of the job as it runs and to determine the final results for each device defined within the deviceQuery.

The above example will return a jobTraceId :

> {  
>   "jobTraceId": "-O8wj-dql3qWIWSABB6"  
> }

Use the jobTraceId to issue a jobTraceStatus

    const reqData = { jobTraceId: "-O8wj-dql3qWIWSABB6" };
    const res = await fetch(url,{method: 'POST',
      headers:{ 'Authorization' : auth, 'Content-Type': 'application/json' },
      body: JSON.stringify(reqData)});
    const resp = await res.json();
    console.log(`${JSON.stringify(resp, null, 2)}`);

Response:

> {  
>   "jobName": "update-device-configs",  
>   "created": "2024-10-11T17:59:11.216Z",  
>   "status": "complete",  
>   "errors": {  
>     "tsmd-77AD344RDL": {  
>       "message": "device not supported"  
>     }  
>   }  
> }

In this example device 77AD344RDL was not found. All other devices without errors are assumed successfully updated.

Possible job status values are:

  • incomplete
  • complete


📘

Note that the device name and device location are special properties and changing them must be done via the updateDeviceProperty request.