Triggering Content Externally

This functionality is only available in Pro subscriptions.

Apart from triggering content to start at a specific time, you can also configure playlists in a channel to start playing when an HTTP request is received from another system. This opens up all kinds of new and creative ways to dynamically adapt the shown content to current actions and/or circumstances. For instance, you can have a physical device, like a button or motion sensor, set off the playback of specific content. Or you can hook up a service like IFTTT to take input from a plethora of sensors or triggers from external systems and use that to trigger start playing a specific playlist.

Events

It all starts by creating one or more events in your Online MonitorsAnyWhere settings with a descriptive name and a unique key. It's these events that you can trigger with an HTTP POST request, using that unique key, like so:

https://online.monitorsanywhere.com/trigger/my-event-key

Of course we don't want just anybody to be able to trigger this event, so you need to supply your unique API key as an authorization header. You'll find your API key on your Events overview page.

Authorization: Bearer <YOUR API KEY>

Lastly, since you can have multiple screens playing the same content, you need to specify for what screen specifically you like to trigger the event. You do this by supplying the Code of the relevant playback device in the body of the HTTP request as a JSON structure, like this:

{ "playback_device": "<THE CODE OF THE TRIGGERING PLAYBACK DEVICE>" }

Those double quotes are important, but the < and > characters should be left out!

This implies that trigger content through events on registered playback devices. So be sure to register your playback devices when first setting them up, instead of having them play from a specific channel playback address.

The code of the playback device can be found by going to the list of playback devices and clicking on the name of the playback device to see the details.

Linking playlists to events

The last step is to indicate what content needs to be played when a specific event is triggered. This is done in a channel. Instead of scheduling a playlist in a channel to play continuously or incidentally, you set it to play upon event and then select the relevant event.

Once this is set, as soon as the event is triggered for playback device X, and playback device X is playing this channel, then regular playback is interrupted virtually immediately and the playlist associated with the event will start to play. The playlist will play once and then normal playback will be resumed.

Testing and troubleshooting

Here are some tips for when you want to test and/or troubleshoot this:

  • You can easily test an HTTP request with a tool like Postman.
  • When you get a 404 response to your HTTP request, either the trigger name is incorrect or the playback device code is incorrect.
  • When you get a 417 response to your HTTP request, no currently valid playlist can be found that is linked to the triggered event. Be sure to double check the valid from/to date/times on the event-triggered playlist as well as the time zone of your playback device (which can be set by explicitly setting the device's location).