▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
IFTTT offers free-no-strings-attached webhooks for use in personal projects. I’ve been experimenting with these on my latest Raspberry Pi project to send notifications to my phone. The project is an always-active webcam pointed at a scenic vista that posts to Instagram and streams to Youtube. When a job finishes, or error occurs I get immediately notified - pretty cool!
Signup on the website https://ifttt.com and download the app for
iOS
or Android.
Under “My Applets” select “New Applet”. Setup the applet so
IF
webhook is triggered THEN
notification is
sent. When creating the applet choose a unique {event}
name, you will need that later.
You can choose between regular notification or rich
notification. A regular notification sends text only. A
rich notification can send text with links and photos. Create a
simple message that includesingredients from the dropdown menu.
value1
value2
value3
are optional
fields sent in the body of webhook request. These can be used to
customize the notification message.
Next go to https://ifttt.com/services/maker_webhooks/settings
and write down your webhook {key}
- anyone with this key
can trigger this webhook.
…That’s it! Here are some examples to help you get started.
To trigger the webhook - you just need to send an http request. I’ve
included examples for curl
and python
but http requests
can be sent by many languages.
The quickest way to trigger your webhook is an http GET
request. Seriously, navigate to
https://maker.ifttt.com/trigger/{event}/with/key/{key}
in a
web-browser. You will recieved a plain html page with the text
Congratulations! You've fired the {event} event
and a
mobile notification.
://maker.ifttt.com/trigger/{event}/with/key/{key} curl https
import requests
//maker.ifttt.com/trigger/{event}/with/key/{key}) requests.get(https:
To give your notifications panache - use an http POST
request. You can include data in the request body as JSON with keys
value1
value2
value3
that map to
message ingredients. For example {"value1":"success}
would
subsitute value1
with “success” in the message
template.
"Content-Type: application/json" \
curl -X POST -H {data}' \
-d '://maker.ifttt.com/trigger/{event}/with/key/{key} https
"Content-Type: application/json" \
curl -X POST -H {"value1":"Artwork by Picasso", "value2":"https://bit.ly/1KMoKoN"}' \
-d '://maker.ifttt.com/trigger/{event}/with/key/{key} https
import requests
= 'https://maker.ifttt.com/trigger/{event}/with/key/{key}'
address = {data}) requests.post(address, data
import requests
= 'https://maker.ifttt.com/trigger/{event}/with/key/{key}'
address = {"value1":"Artwork by Picasso", "value2":"https://bit.ly/1KMoKoN"}) requests.post(address, data