We’re excited to announce Rule HTTP Triggers which enable third party applications and services like IFTTT, WebCoRE, Zapier, Tasker (and more!) to trigger SharpTools rules. This opens up a variety of exciting integration possibilities!
HTTP Trigger is a Premium feature.
If you are using the free tier, please let us know if you’d like us to reset your trial.
Overview
Rule HTTP Trigger allows a rule to be triggered from a standard HTTP request from a third party application or service, such as IFTTT, Zapier, Microsoft Power Automate (Flow), and Tasker, or any other applications/services that can send an HTTP request. This was also one of the most popular features requested in the community.
How to use HTTP Trigger
Add HTTP Trigger to your rule(s)
HTTP Trigger can be added by tapping the “+” button in the Trigger(s) section, select Event Trigger
and HTTP
in the rule editor. Once added, you can tap the copy
button to copy the request URL and use it in the other services/applications. (URL will not be functional until the rule is saved.)
Keep the HTTP Trigger URL private! Do not post the rule’s HTTP trigger URL publicly or share with anyone you don’t trust as the trigger URL contains a special key that is authorized to execute the associated rule.
How to trigger the rule with the HTTP request
HTTP Trigger accepts both GET
and POST
methods so you can use either one in a third party service/application to initiate the HTTP request to the URL copied from the previous step. See below for a Webhook (request) example in IFTTT.
How to pass data to a rule? (Request Parameters)
Data can be included in the HTTP request as query parameters or as a JSON payload to be passed to the SharpTools rule. These parameters can be used in IF conditions, device command parameters, notifications and more.
The predefined parameters in the HTTP Trigger block can be selected directly in the Context Variable list.
As an alternative approach to defining expected parameters in the HTTP Trigger, you can also select the Custom Parameter option from the Select Variable Prompt, Note that this approach also provides access to nested properties of objects using standard .
syntax. (eg: switch.value
)
More detailed parameter examples can be found in the Help Article - How to Us Rule HTTP Trigger.
The sky’s the limit
There are tons of integration possibilities that HTTP Trigger allows, and we are excited to see what the community comes up with.
Other Enhancements
We’ve also updated the $.runRule()
hyperlink syntax to support parameters. This can be used in any tile which supports the Hyperlink Action.
For example, use the same rule but provide a parameter indicating which button
number you want to simulate pressing:
$.runRule("RULEID", {"button": 1})
Or customize the message
that you plan on including as part of a notification:
$.runRule("RULEID", {"message": "Hello World"});
These parameters can be accessed in the rule flow using the Custom Parameters option from the Context Variable → Event → HTTP Event section noted in the ‘How to pass parameters’ section above.