Send and receive Applet commands between devices and server

Have more questions? Submit a request

Use cases for using Applet Commands API:

  1. Log and report any information from devices you want to log any number/volume of events from devices and be able to retrieve them later on

  2. Send real-time messages from your server to devices

  3. Define alerts based on custom logs (in development)

1. Log and report any information from devices

If you want to log any number/volume of events from devices and be able to retrieve them later on through REST API.

Send your log/message from the device

You can call this JS SDK from the device: here

await sos.command.dispatch({
  type: 'Content.update', // mandatory *type* with custom value
  content: JSON.stringify(myCMSJSON) // custom parameter and value });
});
  • type is mandatory, can have any value
  • content is an optional parameter, you can pass any sort of data or not add them at all. You can also name them differently.

Typical use cases: You can pass counts of played media, user events, playback crashes, content update confirmations, sensors status,...

Retrieve your logs/messages via REST API

Any command dispatched from the device is stored by signageOS and available through REST API: here

/v1/device/{{deviceUid}}/applet/{{appletUid}}/command

2. Send real-time messages from the server to devices

If you want to trigger some sort of special content, disable/enable any functionality or just send real-time data that should be displayed, use the following Applet Command REST API: here

/v1/device/{{deviceUid}}/applet/{{appletUid}}/command

Once you send your data through this REST API endpoint, they are immediately delivered to a specified device, where you can get them and run your custom logic: here

sos.command.onCommand((command) => { // ... logic });
});

Here is an example of how to react to that on the device: here

Usage in SMIL Player: You can use this JS SDK within the HTML5 widgets in SMIL.

3. Define alerts based on custom logs (in development)

We are working on a UI that will allow you to monitor incoming commands from devices (or lack of such commands) and alert/do automated actions upon that.

You can test Applet Commands with any Device Plan. If you reach a demo limit, additional commands are charged. Reach out to our support for more details and pricing. 

Was this article helpful?
0 out of 0 found this helpful
Share