Getting started

Fetch Triggers Polling

The following section describes how to fetch the device's triggers via the polling strategy.
Specifically, to poll new triggers you continuously call the REST API to fetch the device's trigger count and check if a new trigger has been processed.

General Approach

The REST API /mt1/api/devices/{id}/channel/{channelId}/trigger/count allows to determine the total amount of triggers the device (for a specific channel) has produced.
You can check this number periodically until it increases. If it has increased you can fetch the new trigger via the REST API /mt1/api/devices/{id}/channel/{channelId}/trigger.


Imagine you would like to react to a new trigger of the device 190801013 on the channel 0. You would need to call the following API: The result could look like this: The result means that the device has produced a total amount of 102 triggers on channel 0.
If this number changes to a number greater than 102 you will know that the device has produced a new trigger.
In order to fetch the new triggers of the device you would need to call the following API: Note the HTTP get parameter limit=1 which means that the result will contain the most recent trigger. You also could provide the parameter limit=2 if you are interested in the most two recent triggers and so on.
The result with limit=1 will look like this: The result provides the details of the produced trigger. Most likely you would need the following trigger's properties: