To trigger an UbiFunction via Ubidots' Events Engine, follow these steps:
Next, configure the Event logic using Ubidots’ “ANDs” / “ORs” operators. For additional details on how to configure conditional and complex Event triggers, check out our Creating Conditional Events and Alerts user guide.
With the "If trigger" event logic configured, it is now time to create the action – in this case calling an UbiFunction:
- 1.Select the "UbiFunction" action
- 2.Select the method to trigger the UbiFunction: GET or POST. The UbiFunction must have the same method configuration. NOTE: when choosing GET, the default “Content-Type: application/json” will disappear.
- 3.Search for and select the UbiFunction in the dropdown menu.
- 4.Add the desired headers. POST requests will require the default “Content-Type: application/json” header.
- 5.Customize the “Active trigger” and the “Back to normal” messages. NOTE: These fields always expect a JSON object. When the HTTP method is GET, the JSON is automatically converted to query parameters and appended to the UbiFunction URL.
- 6.Name the Event, set the active days and hours, and save.
Your UbiFunction will now be triggered when your Event is triggered.