Skip to main content

Triggers & Web Hooks

Onslip 360 can be configured to send notifications when certain events happen. To enable these notifications, add a Trigger with the desired condition and action.

Trigger conditions

The trigger conditions can be time-based and/or query based.

A query based trigger specifies a resource, a query and an optional list of operations. The value of the resource property is documented as Trigger Name in the Resources and Endpoints documentation below. Whenever an entity in the specified resource is modified (according to the operations list), it is evaluated against the query, and if matching, the trigger will fire.

If the query matches, an optional cron expression schedule, start date and end date can be checked as well.

Time-based triggers (of type cron) will be triggered based on the (in this case required) cron expression schedule, respecting the optional start date and end date. It's allowed to specify an empty schedule, in which case the trigger will never fire.

Cron expressions

Time schedules are used in various places in the system, such as triggers, but also to specify at what times orders for take-out are accepted. To define such schedules, we use standard cron expressions. These expressions are defined as five white-space separated fields: minute (0–59), hour (0–23), day of month (1–31), month (1–12), and finally day of week (0–6; 0 is Sunday and 1 is Monday). A number in one of these fields means that the field must match and a * means that any value is acceptable. Multiple acceptable values are can be specified by separating values with a , or with a - to define a range. Finally, an frequency may optionally be specified by appending a / followed by the frequency as an integer.

Cron ExpressionMeaning
15 9 * * *Quarter past 9 (a.m.) every day.
0 */4 * * 2On Tuesdays, every fourth hour (starting at midnight), on the hour.
15-30/5 18 * 1 318:15, 18:20, 18:25 and 18:30 every Wednesday in January.

Trigger actions

If a trigger condition applies, the trigger's action is executed. There are several kinds of trigger actions, but for 3rd party developers/integrators, only the webhook action is relevant. A web hook action POSTs the entity and some additional information—serialized as CSV, JSON or XML—to an HTTP or HTTPS endpoint. (In fact, the FTP and MAILTO protocols are also supported for web hooks.)

Trigger notifications

A trigger action may produce a response. If it does, and the trigger has been configured to send notifications, the result can be sent as email (mailto:) or uploaded to an FTP (ftp:) or WebDav server (http: or https:).

The notification mechanism is normally not used with web hook actions, but notifications is a generic feature, independent of the trigger action type.

Note that if a web hook does return a response body, it must set the Content-Length response header and the payload must not be larger than 8 KiB.