Creating a webhook
In this tutorial, let's create a webhook in the Campaign
Manager to send some data from Talon.One.
We want to send 2 attributes, the customer's email and name, and one webhook-defined
property, some body text. The recipient of this webhook is
RequestBin. RequestBin allows us to inspect the content of our
For general information about Webhooks, see Webhooks.
Creating the webhook
Let's create our webhook:
- Open RequestBin and click Create a RequestBin and
keep the page open. We'll need the Bin URL later.
- In Talon.One, click Account > Dev Tools > Webhooks > Create webhook.
- Enter the title of the webhook, for example
My webhook test and
the application which will use it.
- Tick Display in Rule Builder.
- Add a
string parameter name
bodyText to the request.
- Fill in the request verb and URL as follows and click Add:
- URL: your Bin URL
Add the following header:
Add the following payload:
email properties hold predefined attribute values.
body property represents the
bodyText property defined in the webhook.
The webhook is created, let's use it in a rule to use it.
Creating the rule that uses the webhook
- Open the Rule Editor and create a new rule.
- Choose a condition that you can easily trigger. In our case,
Session total > 500.
- Click Add effect and select Webhook: My webhook test. Our
webhook has a required
bodyText parameter. Enter a value, for example
Thank you for shopping with us!
- Save the rule and activate the campaign.
Now, every time a customer has a session total of more than $500, our
RequestBin receives a request containing the following body:
"name": "<name of the customer>",
"email": "<email address of the customer>",
"body": "Thank you for shopping with us!"
Note: Refresh the RequestBin page to see the requests.