Send template message
API to send a WhatsApp templated message to recipient
WhatsApp template messages can be sent only to personal WhatsApp accounts not WhatsApp API accounts. If you are testing WhatsApp templated message API please use your personal WhatsApp phone number instead of your business phone number on Connectly.
Make sure your personal WhatsApp account you are using for testing has accepted all of WhatsApp app and privacy updates
24 hour WhatsApp restriction
If the recipient has not initiated the conversation first within the last 24 hours you MUST use templated message API /v1/businesses/{businessId}/send/whatsapp_templated_messages
.
Generally, you use
/v1/businesses/{businessId}/send/messages
to reply to the customers who already messaged you first.You use
/v1/businesses/{businessId}/send/whatsapp_templated_messages
to initiate with the customer first.
Select the WhatsApp number you want to send from
The endpoint supports an optional sender field in the body. If you have multiple WhatsApp phone numbers with Connectly you can choose which one you want to send the message from. The payload needs to contain the optional sender
key specifying the phone number.
Template languages
Your template can have different language translations which is why you need to provide the language in the API call.
To see a list of available languages go to Meta's official documentation.
Your template must have a language translation approved before you can use it for that specific language.
In most cases, the default template language is `en`.
Please see Meta Business Manager for the available templates and language translations.
Most common languages for templates
The language is specified in language
field. To see a list of available languages go to Meta's official documentation.
Brazilian Portuguese
Spanish
How to use template parameters
The template parameters is a list of objects in the following format:
Available options for name
keys
name
keysHeader
header_text
- indicates text in the header. Works only if the header has any variables in it. Substitutes the variables with the specified text.header_document
- indicates document in the header. Thevalue
must be a valid URL with valid document. You can also specify how to name the file usingfilename
parameter. See examples below.
For supported media types please reference Meta's official documentation.
Body
body_1
- indicates text in the bodybody_2
- indicates text in the bodybody_3
- indicates text in the bodybody_4
- indicates text in the bodybody_5
- indicates text in the bodybody_6
- indicates text in the bodybody_7
- indicates text in the bodybody_8
- indicates text in the bodybody_9
- indicates text in the bodybody_10
- indicates text in the bodybody_11
- indicates text in the bodybody_12
- indicates text in the bodybody_13
- indicates text in the bodybody_14
- indicates text in the bodybody_15
- indicates text in the body
Buttons
button_1_url_suffix
- indicates URL link in the button. Thevalue
must be a valid URLbutton_2_url_suffix
- indicates URL link in the button. Thevalue
must be a valid URLbutton_3_url_suffix
- indicates URL link in the button. Thevalue
must be a valid URL
Examples
You have a template with one header variable and several body variables
You have a template with a header image and multiple body variables
You have a template with a header document
You have a template with the link button and button has a suffix
The above payload will send a template where "Our Facebook" button will take the customer to www.facebook.com/connectlyai
You have a template with two quick reply buttons
If you have subscribed to Connectly Messaging Webhooks, whenever the customer presses a button the value (payload) that you specify will be sent through the webhook to indicate which button was pressed.
Rate Limiting
To ensure fair usage and maintain service stability, we have implemented rate limiting for above APIs. This endpoint is limited to 200 requests per second. If the limit is exceeded, the API will return a 429 Too Many Requests
response.
WhatsApp Message template
Please see the instructions here for instructions on how to create a WhatsApp message template.
Last updated