Path variable for the message template API request. contactcId is the phone number of the recipient. The sample value for different WhatsApp Partner is listed in the table below.
WhatsApp Partner
Description
Sample Value
360 Dialog
without +
60123456789
Vonage
without +
60123456789
MessageBird
without +
60123456789
Twilio
whatsapp:<number with plus>
whatsapp:+60123456789
β
Before sending a Template Message to a contact at respond.io platform using Message Template API, please ensure you did the following:
Have an approved message template
Synced the message templates to respond.io platform
Use the exact template content as configured on WhatsApp Business Manager in the request body to prevent any mismatch between message sent to the contact and message appear in the messages module
Sending WhatsApp Template with Body Text only
This request sends a message template with body text only directly to the Contact as per defined in the Endpoint.
"text": "Hi {{1}}, your account has reached {{2}} of your contact limit.\nTo prevent losing conversations, increase your contact limit {{3}}. Feel free to reach out with any questions.",
16
"parameters": [
17
{
18
"type": "text",
19
"text": "Parameter 1"
20
},
21
{
22
"type": "text",
23
"text": "Parameter 2"
24
},
25
{
26
"type": "text",
27
"text": "Parameter 3"
28
}
29
]
30
}
31
]
32
}
33
}
34
]
35
}'
Copied!
Component Format
Fields
Type
Mandatory
Example Value
type
String
Yes
body
text
String
Yes
This is a message template
parameters
Array
Yes
Refer to the Parameters Array table below for details
Parameters Array
Fields
Type
Mandatory
Example Value
type
String
Yes
text
text
String
Yes
Supports any plain text values, standard fields, custom fields as well as formatting
Response - Success(HTTP status β 201)
1
{
2
"status": "success",
3
"message": "Message Sent",
4
"data": {
5
"id": {{id}}
6
},
7
"trace": []
8
}
Copied!
Sending WhatsApp template with header
This request sends a message template with header directly to the Contact as per defined in the Endpoint.
Please note that this API request is only available for 360 Dialog and Vonage.
Refer to text OR Image / Document / Video Format table
Text Format
Fields
Type
Mandatory
Example Value
text
String
Yes
This is a header text
parameters
Array
No
Note that we only need to include the parameters array if the header text contains parameters. { type: "text", text: "parameter 1 OR @contact.field OR @field.custom_field" }
Image / Document / Video Format
Fields
Type
Mandatory
Example Value
parameters
Array
Yes
Refer to the Parameter Objectbelow for details on the array
Parameter Object
Fields
Type
Mandatory
Example Value
type
String
Yes
image OR video OR document
image OR document OR video
Object
Yes
Refer to the table below for details on the object
"message": "Sorry, Url provided is not an image/audio/video file",
4
"data": []
5
}
Copied!
Frequently Asked Questions
WhatsApp template with body text only
What happens if I send template text that does not match exactly with the one configured on WhatsApp Business Manager?
The contact will receive the template as configured on the WhatsApp Business Manager. However, on the Messages module of respond.io, it will appear as sent from the Messaging API. To prevent this mismatch, we advise you to use the exact template text in the request body
What happens if I do not include formatted text in the API request but my template has formatting included?
Similar to the case above, the contact will receive the template as configured on the WhatsApp Business Manager. However, on the Messages module of respond.io, it will appear as sent from the Messaging API. To prevent this mismatch, we advise you to use the exact template text in the request body
Since the contact will always receive the message configured on WhatsApp Business Manager, can I omit the text when sending the request?
If you omit the text, the contact will still receive the intended template message however it will not appear on the respond.io Messages module. To prevent this mismatch, we advise you to use the exact template text in the request body
WhatsApp template with body parameters
What happens if I do not include the parameters / have incorrect number of parameters in the request?
The template message will not be sent to the contact and an error code will be returned from the API as well as displayed on the Messages module
What happens if I use a deleted custom field as a parameter value?
The template message will be still be sent but the parameter value will be treated as a literal string instead
Can I format the parameter values?
Yes you may format the parameter values. Supported formatting are bold (e.g. Parameter 1), italics (Parameter 1), monospace (Parameter 1) and strikethrough (Parameter 1).
Can I omit the body text and only include the correct number of parameters?
The contact will receive the template as configured on the WhatsApp Business Manager with the parameter values sent. However, on the Messages module of respond.io, it will appear as sent from the Messaging API. To prevent this mismatch, we advise you to use the exact template text in the request body
WhatsApp Template with Header
What happens if I do not include the parameters / have incorrect number of parameters in the request?
The template message will not be sent to the contact and an error code will be returned from the API as well as displayed on the Messages module
If the header has no parameters, can I omit it from the request?
If you omit the header component from the request, the contact will still receive the header as part of the message however the header text will not be reflected on respond.io Messages module. In light of this, it is best to always include the header text on the API as well so as to sync up the behavior between respond.io Messages module and contact WhatsApp
What happens if I do not include filename values for image / video / document type headers?
For image and video files, the message will still be sent and will be reflected accordingly on both the contact phone and on respond.io Messages module. For document type header, if filename is omitted, the Messages module will display the document correctly but the contact message will have the file attachment displayed as null.pdf. In light of this, to keep the behavior consistent, please have the filename included as best practice
What format should image / video / document URL be?
Image / Video / Document URL should be a valid URL with http / https format and should be resolvable. Prior to including the image URL, try opening the image URL on a browser window and ensure that the image is loaded to ensure that it is working properly
WhatsApp template with CTA buttons
What happens if I do not include the parameters / have incorrect number of parameters in the request?
The template message will not be sent to the contact and an error code will be returned from the API as well as displayed on the Messages module
What happens if I do not include / partially include button options if the buttons do not include parameters?
The message sent to the contact will still contain all the buttons as configured in WhatsApp Business Manager. However, the Messages module on respond.io will not reflect this and may cause a mismatch. In light of this, it is best to have the button component included in the request body
WhatsApp template with quick replies
What happens if I do not include / partially include quick reply options?
The message sent to the contact will still contain all the quick reply as configured in WhatsApp Business Manager. However, the Messages module on respond.io will not reflect this and may cause a mismatch. In light of this, it is best to have the quick reply text included in the request body
What happens if the quick replies option does not match?
The message sent to the contact will still contain all the quick reply as configured in WhatsApp Business Manager. However, the Messages module on respond.io will not reflect this and may cause a mismatch. In light of this, it is best to have the quick reply text match the values configured on WhatsApp Business Manager
WhatsApp template with footer
Can I omit the footer component from the request since it is static?
If you omit the footer component from the request, the contact will still receive the footer as part of the message however the footer text will not be reflected on respond.io Messages module. In light of this, it is best to always include the footer text on the API as well so as to sync up the behavior between respond.io Messages module and contact WhatsApp
What happens if I send footer text that does not match exactly with the one configured on WhatsApp Business Manager?
The contact will receive the template as configured on the WhatsApp Business Manager. However, on the Messages module of respond.io, it will appear as sent from the Messaging API. To prevent this mismatch, we advise you to use the exact template text in the request body