...
Name | Mandatory | Type | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
servicePhoneNumber |
|
| whatsapp business number | ||||||||||
customerPhoneNumber |
|
| customer phone number | ||||||||||
templateName |
|
| template name | ||||||||||
language |
|
| template language | ||||||||||
header |
|
| template header (null if there is no header or no multimedia header). See table below for details. | ||||||||||
headerData |
|
| array of strings representing the header parameters. (pass empty array in case there are no parameters) | ||||||||||
headerText |
|
| header text (null if header type is not text) | ||||||||||
bodyData |
|
| array of strings representing the body parameters. (pass empty array in case there are no parameters) | ||||||||||
bodyText |
|
| body text | ||||||||||
footerText |
|
| footer text (null if there is no footer) | ||||||||||
url |
|
| url (null if there is no url) | ||||||||||
dynamic_url |
|
| array of string representing the url parameter. (pass empty array in case there is no url parameter) |
Header object:
Name | Mandatory | Type | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
type |
|
| header type. Can assume one of the following values:
| ||||||||||
data |
|
| base64 string | ||||||||||
documentType |
|
| document extension | ||||||||||
fileName |
|
| file name (extension included) |
Returns:
Type | Description |
---|---|
JS Promise | A Javascript Promise that return an object containing the following properties:
|
Example:
template only text:
Code Block | ||
---|---|---|
| ||
LIVECHAT.sendCTLiveSocialTemplateMessage("3902124122690", "393403602056", "hello_world", "en_US", null, [], "Hello World", [],
"Welcome and congratulations!! This message demonstrates your ability to send a WhatsApp message notification from the Cloud API, hosted by Meta. Thank you for taking the time to test with us.", "WhatsApp Business Platform sample message",
null, []
); |
template text with parameter:
Code Block | ||
---|---|---|
| ||
LIVECHAT.sendCTLiveSocialTemplateMessage("3902124122690", "393403602056", "sample_shipping_confirmation", "en_US", null, [], null, ["5"],
"Your package has been shipped. It will be delivered in {{1}} business days.", "This message is from an unverified business.",
null, []
);
|
multimedia template with image header:
Code Block | ||
---|---|---|
| ||
self.sendCTLiveSocialTemplateMessage("3902124122690", "393403602056", "sample_purchase_feedback", "en_US",
{
"type": "image",
"data": "iVBORw0KGgo…=",
"documentType": "png",
"fileName": "infobip-logo"
},
[], null,
["PlayStation 5"],
"Thank you for purchasing {{1}}! We value your feedback and would like to learn more about your experience.",
"This message is from an unverified business.",
null, []
); |