WhatsApp campaigns allow you to send messages to your contacts using templates previously approved by WhatsApp. This article explains how to synchronize your templates, customize their content, and trigger a campaign using Dialog Insight Web Services.
Limitations
- Relational table fields cannot be used to customize variables.
- Marketing-type WhatsApp templates are not supported. Only Utility and Authentication templates are accepted.
- WhatsApp campaigns can only be triggered through Web Services.
- Template content cannot be modified in Dialog Insight.
Requirements
- Configure the WhatsApp channel.
- Create a communication type for the WhatsApp channel.
- Have a contact list containing contacts with a valid mobile phone number who have consented to receive communications associated with the communication type.
- Create a template in WhatsApp and have it approved.
- Create a Web Services key
Step 1 : Synchronize WhatsApp Templates
1.1 Make sure your WhatsApp template contains the desired text and the variables required to customize the message. The values of these variables will be defined in the next step.
1.2 In Dialog Insight, go to Communications → WhatsApp Templates and click Refresh to synchronize the templates with your WhatsApp account. Only Utility and Authentication template types are accepted.
1.3 Check the status of the template you intend to use for your campaign.
Step 2 : Customize the Message
Option 1 : Dialog Insight interface
2.1 In Dialog Insight, open the template you intend to use for your campaign.
2.2 Enter the values for the template variables :
In this example, a variable is used for the contact's name. Its value is dynamically assigned based on the First Name profile field. You can also assign a fixed value, which will be the same for all contacts.
Option 2 : Web Services
You can set the template variable values without configuring them in the Dialog Insight interface. To do so, specify the values directly in the Web Services call, in the Parameters property.
//Example of adding variable values
"Parameters": { "Name": "Marie", "City": "Paris" }
You will find a complete request example in the next step.
Step 3 : Trigger the Campaign
To trigger a WhatsApp campaign, you must make a call to Web Services. Here are two request examples, depending on the method used to customize your template variables.
//Example if you used the Dialog Insight interface for templates
{ //Web Services key "AuthKey": { "idKey": 1234, "Key": "your-api-key" }, //Find my project ID
"idProject": 1059, //Template ID in the template list in Dialog Insight "idWhatsappTemplate": 12, //Recipient's mobile phone number
"SMSNumber": "+15141234567" }
//Example if you did not use the Dialog Insight interface for templates
{ //Web Services key
"AuthKey": { "idKey": 1234, "Key": "your-api-key" }, "idProject": 1059, "TemplateName": "welcome_client", "Language": "fr", //Communication type associated with the message
"idMessageCategory": 1, //Sender's phone number
"PhoneNumberId": "1299999999999999", //Recipient's mobile phone number "SMSNumber": "+15141234567", "Parameters": { "1": "Marie", "2": "Toronto" }, "HeaderMediaType": "image", "HeaderMediaLink": "https://www.example.com/images/welcome.jpg", "ButtonParameters": { "0": "ABC123" }, "Tag": "bienvenue", "AccessToken" : "EZtvAASIO299jSD0923jASdas23djsd" }