Skip to main content

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

1

Create a webhook

Let's create a webhook to MoEngage:

  1. In the Campaign Manager, click Account > Tools > Webhooks and click Create Webhook.

  2. Enter a name and select the Applications in which the webhook should be available.

  3. Add the parameters to include in the request. In this tutorial, we'll use the following parameters:

    Param typeParam name
    stringprofileid
    stringcouponcode
  4. In Request, set Verb to POST.

  5. In URL, enter https://api-0X.moengage.com/v1/event/<WORKSPACE_ID>, where 0X is the MoEngage data center number, and WORKSPACE_ID is the MoEngage Workspace ID.

  6. 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
  7. 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}"
    }
    }
    ]
    }
    tip

    To learn more about accessing Talon.One attributes and including them in the webhook, see Using parameters in a webhook.

2

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 day 12/25/2022.

Effects

  1. Create coupon code: In the current campaign, Recipient is Current Customer (Friend), and Redemption Limit is 100.
  2. Send MoEngage Email: profileId is Integration ID(Customer Profile) and couponCode is Generated coupon in Session.
3

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.

tip

To verify whether MoEngage received a request, on the MoEngage dashboard, click Test & Debug > Recent events.