The webhook trigger node listens for information in real-time from an external application to trigger a Pendula flow.
Quick links
Add a custom reference to a payload for incoming webhooks
Sample payload for incoming webhooks
What is a Webhook?
A webhook is a way for an app to automatically provide other applications with real-time data.
Create a Webhook trigger
- In a new flow, drag and drop the webhook trigger node onto the canvas to open up the settings panel.
- Follow the prompts to set up your API token if you have forgotten it or it hasn't been generated before.
- Copy the “POST URL” found under Configure Webhook trigger URL. This URL identifies this specific Pendula flow.
- Paste link as the ‘POST URL’ in the Webhook configuration settings of the third party application. Learn more about which configuration method should be used.
Add a custom reference to a payload for incoming webhooks
You may wish to tag a request from an incoming webhook to reference where this request is coming from or what it's for. This is possible by adding 'Custom context' in the header as a value with the key X-PENDULA-CUSTOM-CONTEXT
.
Here's an example of how to a custom context injected in the header:
-H "X-PENDULA-CUSTOM-CONTEXT: this-is-a-custom-context-value" \
Notes to consider
- Request should be in JSON format
- The minimum recommended payload inclusions are:
- First name
- Last name
- Mobile number
Sample payload for incoming webhooks
Here's an example of how to format your payload:
curl -X POST --location "http://localhost:9081/inbound/helloasmr" \ -H "Authorization: Bearer {insert token}" \ -H "Content-Type: application/json" \ -H "X-PENDULA-CUSTOM-CONTEXT: this-is-a-custom-context-value" \ -d "{ \"userid\": \"harrison-example\"
\"firstname\": \"harrison\"
\"lastname\": \"koenig\"
\"mobile\": \"+61400000000\" }"