WhatsApp and other Message Types
This section assumes you have a good understanding of sending basic SMS messages.
The message type allows you to use the DIY Surveys unique routing capability to send messages over different channels. The default message type is SMS. The following platforms are supported:
SMS (Type = 0 [default])
WhatsApp (Type = 1, 3)
Facebook (Type = 2, not currently active).
For more information in constructing message payload see Messaging.
WhatsApp
WhatsApp messages come in two basic forms:
WhatsApp Invite
WhatsApp Message
WhatsApp Invite
An invite (message type = 3) must first be used to trigger a conversation with the recipient. If the recipient responds, then a WhatsApp Message can be sent. An invite has to be approved by the WhatsApp Business Team to use it. DIY Surveys supports this process for you through the main administration platform.
A WhatsApp Invite has to follow a specific format within the platform and to get a template to trigger with the correct content you need to format the API message correctly. For example, you might have a WhatsApp template set up that looks like this (with the name marketing_message_1 and the language en-GB):
Hello, I’m the virtual assistant of {User1}.
I have a brief survey to understand how was your experience in the Dealership.
To stop receiving these messages, press “Do not receive more”.
{button(Answer the survey)}
{button(Privacy Policy)}
{button(Do not receive more)}
This in this example there are several macro's used to pipe in data into the message. Examples of the data have been shared with WhatsApp and that is all they need to trigger the template. So instead of supplying the full message again you supply the data separated by pipes ('|'). For example, considering the above template, the following message would work:
marketing_template_1|en-GB|John
The first element is the name of the template, the second element is the language and the only Macro that requires data to be supplied is the {User1} (in this the data is 'John').
If a macro appears more than once in a template then you only need to specify it once. For example:
Hello, I’m the virtual assistant of {User1}.
I have a brief survey to understand how was your experience in the Dealership.
To stop receiving these messages, press “Do not receive more”.
Thankyou {User1}. We appreciate your time!
Kind Regardes {User2}
{button(Answer the survey)}
{button(Privacy Policy)}
{button(Do not receive more)}
The message would be as follows:
marketing_template_1|en-GB|John|DIY Surveys
Using Metadata in WhatsApp Messages
If you are using metadata then it is possible to pipe in the values into the message. For example:
marketing_template_1|en-GB|{name}
Where name is specified in the metadata and the full request may look like the following:
URL: base/Message/Send
Method: POST
{
"Source": "12345678901",
"Destination": "12345678901",
"Message": "marketing_template_1|en-GB|{name}",
"Reply": true,
"When": "2020-02-04T11:47:33.645773+00:00",
"Window": [{ "From": "09:00", "To": "16:00", "Days": "1,2,3,4,5"}],
"Callback": "https://yourco.com/api/messagetracker",
"Lookup": true,
"Test": false,
"Timeout": "4320",
”Type”: 3,
"MetaData":
[
{ "name": "John" },
{ "OrgID": 1010 },
{ "Instance": "ETRERT"},
{ "Campaign": 1242 },
{ "TimeStamp": "2020-02-04T11:47:33.645773+00:00" }
]
}
WhatsApp General Message
When a response to a WhatsApp Invite has been received from the recipient it is possible to send freely formed messages (message type = 1) to the recipient that could, for example, make up a 2-way survey.
Last updated
Was this helpful?