Creating a webhook to MoEngage
To make the most of Talon.One and MoEngage, you can integrate them by creating a webhook to MoEngage in Talon.One.
In this tutorial, let's create a webhook to MoEngage and create a campaign to send coupon codes on Christmas Day.
Prerequisites
- You have a MoEngage account.
- You are an Admin user in Talon.One and MoEngage.
Setting up the integration
Create a webhook
Let's create a webhook to MoEngage:
-
In the Campaign Manager, click Account > Tools > Webhooks and click Create Webhook.
-
Enter a name and select the Applications in which the webhook should be available.
-
Add the parameters to include in the request. In this tutorial, we'll use the following parameters:
Param type Param name string
profileid
string
couponcode
-
In Request, set Verb to
POST
. -
In URL, enter
https://api-0X.moengage.com/v1/event/<WORKSPACE_ID>
, where0X
is the MoEngage data center number, andWORKSPACE_ID
is the MoEngage Workspace ID. -
In Headers, click Add and define the following HTTP headers:
Authorization: Basic <HEADER>
, where<HEADER>
is a Base64-encoded string containing the API username and password.Content-Type: application/json
-
In Payload, add the request payload. In this tutorial, we'll use the following payload:
{
"type": "event",
"customer_id": "${$profileid}",
"actions": [
{
"action": "Coupon code creation",
"attributes": {
"CouponCode": "${$couponcode}"
}
}
]
}tipTo learn more about accessing Talon.One attributes and including them in the webhook, see Using parameters in a webhook.
Create the rule
Let's create a standard campaign
with a single rule. Name the rule Create coupon on Xmas Day
and add one condition and two effects:
Condition
- Check attribute value:
Current time
is on exact day12/25/2022
.
Effects
- Create coupon code: In the current campaign, Recipient is Current Customer (Friend), and Redemption Limit is
100
. - Send MoEngage Email: profileId is
Integration ID(Customer Profile)
and couponCode isGenerated coupon in Session
.
Use the generated coupon code in MoEngage
You can now use the coupon code generated by Talon.One in your MoEngage campaign content.
To learn to create event-triggered campaign content, see Campaigns and channels.
To verify whether MoEngage received a request, on the MoEngage dashboard, click Test & Debug > Recent events.