There are two ways to obtain information about the current state of a Skykit device.
Please Note: Skykit highly recommends avoiding frequent /device polling to monitor device health. Instead of frequent polling please subscribe to the event webhook to receive these events at the moment they are detected by Skykit.
Device Event Webhook
Supply a Url and Auth string to Skykit. This url will be used to post the full state object for the device when critical changes are detected in the device state. For example, when the device is detected as offline or if a device goes online Skykit will publish the event to the supplied url. Please see the webhook API page for more details.
Device Request API
Current or last known device information can be retrieved by issuing a /device request.
Supply a serial and an "optionalData" string with a value of playerConfig, playerState and/or installedApps as a comma delimited list. For example:
const res = await fetch(url,{method: 'POST',
headers:{ 'Authorization' : auth, 'Content-Type': 'application/json' },
body: JSON.stringify({serial : "34AGPCD56LP", optionalData: "playerConfig,playerState"})});
This request will always return :
- Control State data. This is health and status data regularly reported by the device.
- Control Config data. This is the current configuration assigned to this device such as volume, rotation, etc.
- Device Name.
- Device Location.
- Label Ids assigned to this device.
When playerConfig and/or playerState is supplied as optionalData the request will also return :
- Media Player state data. This is health and status data reported by the Beam digital signage media player client on the device (if installed).
- Media Player config data. This is the current configuration for the Beam digital signage media player client on the device (if installed).
When installedApps is supplied in the optionalData string the request will also return:
- A list of all non-system apps installed on the device with their versionCode and versionName. These are all apps installed on the device that are not part of the firmware.