Creating a webhook to CleverTap
You can integrate Talon.One with CleverTap using a webhook.
With this integration, you can configure both platforms in such a way that coupon codes generated in Talon.One are sent to specific customer segments in CleverTap.
In this tutorial, let's set up our Talon.One campaign in such a way that it generates a coupon code on New Year's Day (1 January) and our CleverTap campaign sends it to a target segment in an email message.
CleverTap integration method
To integrate with CleverTap, let's do the following:
- In Talon.One, create a campaign to generate a coupon code and send it to CleverTap.
- In CleverTap, embed the received coupon code in an email message and send it to a target segment.
To send the generated coupon code from Talon.One, we send a request to the Upload Events API endpoint, with the generated coupon code in the request payload. To make this request, we configure a webhook to CleverTap.
To track this coupon code transmission in CleverTap, we use a custom event with an event property.
- You have a CleverTap account.
- You are an Admin user in Talon.One and CleverTap.
- You configured an email provider in CleverTap and tested it.
- You created a custom event
with an event property
in CleverTap to track the Talon.One coupon code.
In this tutorial, we assume this custom event is called
Coupon Generatedand the event property is called
Creating a webhook
In Talon.One, let's create a webhook to CleverTap
and name it
Send CleverTap Email.
Add parameters for any webhook-specific data to pass to CleverTap. In our case, we want to pass the profile ID of the user and the generated coupon code, so we create the following parameters:
|Param type||Param name|
Use a universal ID as
ProfileID to identify the user in Talon.One and CleverTap.
Creating the request
CleverTap provides a list of the required HTTP headers for the Upload Events API endpoint. Using the list as a point of reference, we create the following request:
- Set Request Verb to
- Target the relevant URL based on the Region of your CleverTap account:
https://<CleverTap API endpoint>/1/upload
- Define the HTTP headers based on the CleverTap Upload Events API requirements:
X-CleverTap-Account-Id: <CleverTap Project ID>
X-CleverTap-Passcode: <CleverTap Project passcode>
Content-Type: application/json; charset=utf-8
To view the details of your CleverTap project, in CleverTap, click Settings > Project.
Creating the payload
CleverTap provides an example
of the request payload for the Upload Events API endpoint.
The values of the parameters
CouponCode are dynamically replaced
by the values from our Talon.One campaign. Here, the
evtData (event data) parameter
represents the event property we created as a prerequisite in CleverTap.
"evtName": "Coupon Generated",
Your payload definition may vary depending on the event data that you dynamically populate in your CleverTap campaign content, but the same principles apply.
To learn more about accessing Talon.One attributes and including them in the webhook, see Using parameters in a webhook.
Creating a campaign in Talon.One
Let's create a campaign with a single rule.
Name the rule
Create coupon on 1 January and add one condition and two effects:
- Validate attribute value:
Current timeis on exact day
- Create coupon code: In the current campaign, Recipient is Current Customer (Friend), and Redemption Limit is
- Send CleverTap Email: ProfileID is
Integration ID(Customer Profile)and CouponCode is
Generated coupon in Session.
Creating a campaign in CleverTap
CleverTap allows you to send a message using channels such as email, SMS, and push notification. In this example, we use email.
In this tutorial, we ignore the optional settings offered by CleverTap. To learn about creating campaigns using the email channel, in the CleverTap documentation, under Email, see Create message.
To create a campaign in CleverTap:
- On the sidebar, click Messages > Campaigns and + Campaign > Email.
- In Name, type a name for your campaign.
- In Start here > Qualification criteria, select Live behavior and click Done.
- In Email Service Provider, select the email provider you configured as a prerequisite and click Done.
- In Who > Target Segment > Find user from segment, select Single action: New segment.
- In As soon as the user does, select the name of the event you created (Coupon Generated, in our case) and click Done.
- In What, select Single Message and click Go To Editor.
- Select a template and personalize your message in the message editor.
- To embed the Talon.One-generated coupon code, in the email body, type @ and select the event property you created (@Coupon Generated - CouponCode, in our case).
- To show a default value if the coupon code is not available, in default:, type a value and click Done.
- In Sender details, enter the details of the sender information you want to show and click Done.
- In When > Date and time, select Now and click Done.
- To publish the campaign, click Publish Campaign.On 1 January, the customer segments defined in CleverTap receive an email with the coupon code generated by Talon.One.