Docs
Webhook
The Webhook widget calls a URL when a pin changes. The server makes the request, not your board.
Use it for: posting to a chat channel, triggering an automation service, writing to your own API, ringing something that speaks HTTP.
| Setting | What it does |
|---|---|
| Pin | the pin that triggers the request |
| URL | the address to call |
| Method | GET or POST |
| Headers | extra headers, such as an API key |
| Body | what to send with a POST |
Open these from the canvas: tap Edit, then long press the widget and choose Configure.
Sending the value
Use /pin/ inside the URL or the body and the server replaces it with the
value that triggered the call.
https://example.com/api/temp?value=/pin/ becomes
https://example.com/api/temp?value=23.5.
Why the server calls it
The request leaves the server, so it works while your board sleeps and while your phone is closed. Your sketch keeps writing to a pin and knows nothing about HTTP.
A board calling an API directly needs TLS, certificates and memory. A webhook needs one line of settings.
Keep it slow
Every value written to that pin fires a request. A sensor sending once a second makes 86400 calls a day, and most services will start refusing them.
Trigger a webhook from a pin that changes on events, not from a stream of readings.
Troubleshooting
| Problem | Check |
|---|---|
| Nothing arrives at the far end | the URL needs to be reachable from the internet, not your LAN |
| Value missing in the request | the /pin/ placeholder is spelled exactly like that |
| Service rejects the calls | too many requests; trigger on events instead of readings |
| Works in a browser, not here | the service needs a header, such as an API key |