A webhook is an HTTP request hook that triggers some specific event or action. Webhooks enable you to integrate two or more web apps or services that have no compatibility to begin with. The idea is to create this compatibility by using webhooks. Thanks to Prota's Webhook app you can create yourself the compatibilities you need between the devices and web services you use.
With webhooks, you can integrate:
- Physical devices: Microbot Push, Prota, Apple Watch, Flic...
- Internet services: PayPal, Twitter, Facebook, WhatsApp, Skype, Slack, Dropbox...
- Prota device (S or Pi) with Webhook app installed
- The device or web service you want to integrate must support webhooks. (If not, use IFTTT Maker channel)
In order to build the integration between the devices/web services, you will need to a create a story using Prota's Stories app. To be able to create the storyline corresponding to your project, you must identify whether the webhook you will use is, for Prota, an Incoming webhook or Outgoing webhook. This will enable you to determine the correct sensor and actor to build your integration successfully.
Example 1: Integrate MicroBot Push & Apple Watch
Control your MicroBot Push installed on your light switch using your Apple Watch.
When Prota receives an HTTP request (webhook) sent from your Apple Watch, your MicroBot Push will turn on/off the light => incoming webhook
To build the integration, follow these steps:
1. In Webhook app, create two incoming hooks: one to turn on the light and one to turn it off.
2. In Stories app, create a story composed of the following storylines:
- When ‘Turns on’ receive an incoming hook (sensor-story), MicroBot pushes (or pulls) the button (actor-story).
- When ‘Turns off’ receive an incoming hook (sensor-story), MicroBot pushes (or pulls) the button (actor-story).
3. In Apple Watch app, go to ‘Request List’ and create two new requests corresponding to each storyline detailed above: set a title for each, choose ‘POST’ as the method and paste the incoming hook’s URL you have created in Webhook app. And it’s done!
You will just need to tab ‘Request’ on your Apple Watch on the desired webhook to turn on or off your lights!
Example 2: Integrate Flic & Prota / MicroBot Push
Trigger your Flic button using Prota => outgoing webhook
1. In Stories app, create a new story with the sensor and event of your choice.
2. In the actor-story, select ‘Webhook’ as the actor and ‘post request’ as the action. In the action’s conditions, you will need to enter the information related to your flic button. Use Flic's Internet Request Function to get the information you need.
- Refer to a device or web service's API documentation to get your URL and all information you need to use webhooks.
- To see examples of integration with webhooks, please refer to our blog article 'Discover Webhook, the Prota OS app to make integrations'
If you have a question or need help, do not hesitate to contact our Support team.