---
title: WebEngage
slug: webengage
createdAt: 2025-07-28T04:14:57.300Z
---

##

There can be multiple use-cases for integrating WebEngage to AlertsPanel. The ones where event-based integrations are needed for instance sending a template when a booking event is done, then we can follow the below instructions.

1. Connect API Trigger URL in WebEngage

URL to be set -

:::BlockQuote
[https://\<API-DOMAIN>/bot-api/v2.0/customer/\<CUSTOMER-ID>/bot/\<BOT-KEY>/flow/\<FLOW-KEY>](https://\<API-DOMAIN>/bot-api/v2.0/customer/\<CUSTOMER-ID>/bot/\<BOT-KEY>/flow/\<FLOW-KEY>)
:::

Sample -

:::BlockQuote
[https://api.alertspanel.com/bot-api/v2.0/customer/70698/bot/5c7d35037d244b0c/flow/F722EFF2E80F4E3BA0FD8BC195A7B8DB](https://api.alertspanel.com/bot-api/v2.0/customer/70698/bot/5c7d35037d244b0c/flow/F722EFF2E80F4E3BA0FD8BC195A7B8DB)
:::

This has to be set in the following place in WebEngage -

![](https://images.archbee.com/bPTlyA8bC5cIeQYhtj9pB-8jtFUpQAPpl3MjsisnbUi-20240830-092954.png?format=webp)

![](https://images.archbee.com/bPTlyA8bC5cIeQYhtj9pB-2DHuVo4DyrLPdGJXR6Pcy-20240830-093020.png?format=webp)

![](https://images.archbee.com/bPTlyA8bC5cIeQYhtj9pB-6wjowTXdbLd51UA7H1Uji-20240830-093043.png?format=webp)

- Build the flow in the particular account, bot, and flow where the integration is needed.

::Image[]{src="https://api.archbee.com/api/optimize/NYKuwLQdfaPcYyZ5qQrtl-ipnzs7fIY9mwsbDAlPfoH-20250527-125041.png" darkSrc="https://archbee-image-uploads.s3.amazonaws.com/NYKuwLQdfaPcYyZ5qQrtl-ipnzs7fIY9mwsbDAlPfoH-20250527-125041.png" size="50" width="825" height="762" darkWidth="825" darkHeight="762" position="center" showCaption="false"}

```javascript
var whatsAppData = {{whatsAppData}};
var templateData = whatsAppData.templateData;
var templateName = templateData?.templateName;
var namespace = '980c3243_2d2a_4d2d_a572_b2a50552cb04';
var headerType = templateData?.type;
var language = templateData?.language;
var mediaUrl = templateData?.mediaUrl;
var buttonUrlParam = templateData?.buttonUrlParam;
var templateVariables = templateData?.templateVariables;
var toNumber = whatsAppData?.toNumber;

var bodyParams = [];
var headerParams = [];
var buttonParams = [];

var headerComponents = {};
var bodyComponents = {};
var buttonComponents = {};

var components = [];

// Handle header
if (['IMAGE', 'VIDEO', 'DOCUMENT'].includes(headerType)) {
  headerType = headerType.toLowerCase();
  headerParams.push({
    type: headerType,
    [headerType]: { link: mediaUrl }
  });
  headerComponents['type'] = 'header';
  headerComponents['parameters'] = headerParams;
  components.push(headerComponents);
}

// Handle body
if (templateVariables && templateVariables.length > 0) {
  templateVariables.forEach((val) => {
    bodyParams.push({ type: 'text', text: val });
  });
  bodyComponents['type'] = 'body';
  bodyComponents['parameters'] = bodyParams;
  components.push(bodyComponents);
}

// Handle button
if (buttonUrlParam) {
  buttonParams.push({ type: 'text', text: buttonUrlParam });
  buttonComponents['type'] = 'button';
  buttonComponents['sub_type'] = 'url';
  buttonComponents['index'] = 0;
  buttonComponents['parameters'] = buttonParams;
  components.push(buttonComponents);
}

// Build final template
var template = {
  namespace: namespace,
  name: templateName,
  language: {
    code: language,
    policy: 'deterministic'
  },
  components: components
};

// Format phone number if needed
if (toNumber[0] === '+') {
  toNumber = toNumber.substring(1);
}

// Final process call
process({
  data: {
    type: "template",
    payload: template,
    targetWhatsAppNumber: toNumber
  }
});
```

- Test out the end to end flow from WebEngage

![](https://images.archbee.com/FEqjvWZnyymr_PEhXLLlG/UJaFI-8QXm5U0pu7W64QB_screenshot-2024-01-17-at-45932-pm.png?format=webp)

![](https://images.archbee.com/bPTlyA8bC5cIeQYhtj9pB-ufRA-xwNRj0e-mLRlh2Wf-20240830-093154.png?format=webp)

![](https://images.archbee.com/bPTlyA8bC5cIeQYhtj9pB-MFlcEJKsxh4Cp2OUZLH1M-20240830-093214.png?format=webp)



- Once the above setup is done, We would need a webhook URL for the event, we can find it from 

Data platform -> Integrations -> Channel Integration Setup -> WA Setup  -> Configure -> Click on “View Webhook URL”

![](https://api.archbee.com/api/optimize/bPTlyA8bC5cIeQYhtj9pB-8-2yz1EwtLjTfxubptDfu-20240830-093245.png)

Share the following Event Webhook URL

![](https://api.archbee.com/api/optimize/bPTlyA8bC5cIeQYhtj9pB-n967qXtNvXq4T61T-xLGp-20240830-093342.png)

Also, along with URL we will also need AUTH\_KEY\_PROVIDED\_BY\_WEBENGAGE. If we don’t have it then send a mail to “[support@webengage.com](mailto\:support@webengage.com)

![](https://images.archbee.com/bPTlyA8bC5cIeQYhtj9pB-TV2wLm8HWyzfx3qiVVBKO-20240830-093417.jpg?format=webp)

