To trigger an UbiFunction via Ubidots' Events Engine, follow these steps:
1. Create a new Event
To begin, create a new event from the "Events" section in the "Data" tab in your Ubidots Navbar.
2. Configure the Event "If Trigger"
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.
3. Configure the UbiFunction Action
With the "If trigger" event logic configured, it is now time to create the action – in this case calling an UbiFunction:
Select the "UbiFunction" action
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.
Search for and select the UbiFunction in the dropdown menu.
Add the desired headers. POST requests will require the default “Content-Type: application/json” header.
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.
Name the Event, set the active days and hours, and save.
Your UbiFunction will now be triggered when your Event is triggered.