Engati - User Guide
...
Building Your Bot
Configuring Integrations
WebEngage
7min
introduction there can be multiple use cases for integrating webengage to engati 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 connect api trigger url in webengage url to be set 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 https //api engati com/bot api/v2 0/customer/70698/bot/5c7d35037d244b0c/flow/f722eff2e80f4e3ba0fd8bc195a7b8db https //api engati com/bot api/v2 0/customer/70698/bot/5c7d35037d244b0c/flow/f722eff2e80f4e3ba0fd8bc195a7b8db this has to be set in the following place in webengage build the flow in the particular account, bot, and flow where the integration is needed 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 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” share the following event webhook url 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 ” and request for the same this auth key is needed to send the status packet back to webengage and complete the whatsapp flow