API Documentaion Send Template APIThis guide is designed to provide you with a comprehensive understanding of how to effectively utilize our API for sending WhatsApp template messages.
Send WhatsApp Template
This Send WhatsApp Template API helps you to send a message to end user using an API.
This API requires an active WhatsApp Account on QuickReply.ai along with a non-negative WhatsApp Wallet Balance
Pre-requisites
The WhatsApp Template is already approved
You have Messaging Credits Wallet balance to send the template message
You have not exceeded your daily messaging limit on your WhatsApp number
Send WhatsApp Template Message by API
POST
https://app.quickreply.ai/api/whatsapp/send-template?templateId={{template_id}}
Body is a JSON Object
Query Parameters
You can find the template id by clicking on the 3 dots at the right of template block and clicking "Copy Template Id"
Request Body
Comma-Separated Strings representing the values that will replace the variables template's body
// Required - If Template has a Dynamic CTA URL
Comma-Separated Strings representing the variable part of dynamic url
Phone number of the recipient
Playbook or a Custom bot to which the user should be hooked on their response on the QuickReply button. This works only for templates with QuickReply buttons.
// Required - if the template is of type media
Public accessible media URL for Media Templates like an Image, Video, or Document.
IMAGE:
Supported types: image/jpeg, image/png
VIDEO:
Supported types: video/mp4, video/3gpp
DOCUMENT:
Supported types: Any valid MIME-type
200: OK On Success 400: Bad Request When params are missing 401: Unauthorized When client-id or secret-key is wrong 400: Bad Request When Template id is wrong 400: Bad Request When recipient's phone is missing 400: Bad Request When Template id is missing 400: Bad Request When message fails at WhatsApp
Copy {
"id" : "<message_id>" ,
"status" : "SENT"
}
Copy {
"error" : "Bad Request: params are missing"
}
Copy {
"error" : "Unauthorized"
}
Copy {
"error" : "Bad Request: Template not found"
}
Copy {
"error" : "Bad Request: Receiver not found"
}
Copy {
"error" : "Bad Request: Template id missing"
}
Copy {
"id" : "<message_id>" ,
"state" : "NOT_SENT" ,
"reason" : "<Error message recieved from Whatsapp>"
}
Fields marked with *️ are Required.
Sample CURL Request
Copy curl --location --request POST 'https://app.quickreply.ai/api/whatsapp/send-template?templateId=1531b8a3-cacb-4141-b267-51b7d9637191' \
--header 'client-id: oLtaHhFFVapeELFro_c' \
--header 'secret-key: 2gqRDCxNFHoYawRFh' \
--header 'Content-Type: application/json' \
--data-raw '{
"params": [
"var_1",
"var_2",
"var_3"
],
"button_params" : [
"url_suffix/something"
],
"to": "+919876543210",
"name": "Utkarsh",
"email": "test@yopmail.com",
"link": "https:/some-public-domain/sample_image.jpeg",
"hook_with_playbook": "61c01099380d7b33bf30d7cd"
}'
Simple Text Template
Copy curl --location --request POST 'https://app.quickreply.ai/api/whatsapp/send-template?templateId=1531b8a3-cacb-4141-b267-51b7d9637191' \
--header 'client-id: oLtaHhFFVapeELFro_c' \
--header 'secret-key: 2gqRDCxNFHoYawRFh' \
--header 'Content-Type: application/json' \
--data-raw '{
"params": [
"var_1",
"var_2",
"var_3"
],
"to": "+919876543210",
"name": "Utkarsh",
"email": "test@yopmail.com"
}'
Media with Text Template
Copy curl --location --request POST 'https://app.quickreply.ai/api/whatsapp/send-template?templateId=1531b8a3-cacb-4141-b267-51b7d9637191' \
--header 'client-id: oLtaHhFFVapeELFro_c' \
--header 'secret-key: 2gqRDCxNFHoYawRFh' \
--header 'Content-Type: application/json' \
--data-raw '{
"params": [
"var_1",
"var_2",
"var_3"
],
"to": "+919876543210",
"name": "Utkarsh",
"email": "test@yopmail.com",
"link": "https:/some-public-domain/sample_image.jpeg"
}'
Template with a Dynamic CTA Button
Copy curl --location --request POST 'https://app.quickreply.ai/api/whatsapp/send-template?templateId=1531b8a3-cacb-4141-b267-51b7d9637191' \
--header 'client-id: oLtaHhFFVapeELFro_c' \
--header 'secret-key: 2gqRDCxNFHoYawRFh' \
--header 'Content-Type: application/json' \
--data-raw '{
"params": [
"var_1",
"var_2",
"var_3"
],
"button_params" : [
"url_suffix/something"
],
"to": "+919876543210",
"name": "Utkarsh",
"email": "test@yopmail.com",
"link": "https:/some-public-domain/sample_image.jpeg"
}'
Template with a QuickReply Button
Copy curl --location --request POST 'https://app.quickreply.ai/api/whatsapp/send-template?templateId=1531b8a3-cacb-4141-b267-51b7d9637191' \
--header 'client-id: oLtaHhFFVapeELFro_c' \
--header 'secret-key: 2gqRDCxNFHoYawRFh' \
--header 'Content-Type: application/json' \
--data-raw '{
"params": [
"var_1",
"var_2",
"var_3"
],
"to": "+919876543210",
"name": "Utkarsh",
"email": "test@yopmail.com",
"link": "https:/some-public-domain/sample_image.jpeg",
"hook_with_playbook": "61c01099380d7b33bf30d7cd"
}'
Last updated 3 months ago