Rule HTTP Action

We’re excited to announce HTTP Actions for Rule Engine which enable you to communicate with third party applications/services like IFTTT, WebCoRE, Voice Monkey, Zapier (and more!). This further expands your smart home automation with nearly unlimited integration possibilities.

:crown: HTTP Action is a Premium feature.
If you are using the free tier, please let us know if you’d like us to reset your trial.

:white_check_mark: This feature will close the following trending feature request: Rule Engine: HTTP Request

HTTP Action

You can now make HTTP Requests using the new HTTP Action in the Rule Engine. This can be used to trigger IFTTT Applets, webCoRE pistons, Voice Monkey announcements, or any other REST API for virtually limitless integration opportunities.

Configure HTTP Action

  • Method: GET, POST, PUT, and DELETE methods are supported. Make sure you check the target API endpoint’s method requirement and select accordingly

  • URL: the URL of your target must be internet accessible since the request is initiated from the SharpTools cloud. You may also attach Query Parameters in the URL to pass static content or Variables for dynamic content.

    Making LAN HTTP Requests

    If you need to send an HTTP request to an endpoint hosted on your private network, you may need a tunneling service such as ngrok or would need to securely configure your router/gateway to allow public traffic.

  • Headers: depending on the requirements of your API endpoint, you may need to add specific headers in the request, such as an authentication token.

    Note: When the POST or PUT method is selected, the JSON content type is selected by default. You can select the FORM content type or manually input a specific content-type by adding it as a header.

  • Payload:
    When using POST or PUT, you can add data to the request in the Payload field. Make sure to format the content of the payload based on the selected content type (see immediately above) and feel free to use Variables in the payload by tapping the + Variable link.

    JSON:
    Make sure to include double quotes " for data keys and string properties.

    FORM:
    Make sure the content is URL encoded.

HTTP Response

The response data, status code, and error message (if applicable) from the web request can be accessed using Context Variables and used in IF Conditions, device command arguments, notification content, and for setting other variables.

You can access the HTTP Response values noted above under:

   Context Variables → Response → HTTP

:information_source: For response data, you can use object.property notation to access a specific property from the response that you want to use.

2021-06-09_13-19-23

:arrow_left: Using the rule HTTP Trigger feature, you can send a web request from a third party application/service to trigger a SharpTools rule.

:arrow_right: And now using HTTP Actions, you can send a web request from a SharpTools rule to trigger actions in a third party application/service.

4 Likes

Examples

webCoRE

Trigger a webCoRE piston by sending a GET request

IFTTT

Trigger an IFTTT applet by sending a GET/POST request

Hubitat Maker API

Calling Hubitat Maker API via Hubitat cloud

:information_source: You can also trigger Rule Machine rules by adding the Trigger → Cloud End Point to your RM rule and then calling that from a SharpTools HTTP Action.

  • Method: GET/POST
  • URL: get the specific maker api URL from the Maker API page in Hubitat. Make sure you use the cloud URLs, instead of the local ones, and replace the device ID, command, and etc accordingly from the example URLs.

Alexa - Voice Monkey

Call the Voice Monkey API to trigger an Alexa routine, or Text-to-Speech/Anouncements.

Zapier

Call the Zapier webhook trigger API to trigger a zap automation.

  • Method: GET
  • URL: select “Webhook by Zapier” as the zap trigger, and select “catch Hook” as the Trigger Event. Click “Continue” and the Custom Webhook URL to trigger this zap should be displayed in the next step.
3 Likes