Please refer to support article on Whatsapp Cloud APIs to get more details on our offerings. You can use this sign up page to register yourself to use this feature . If you are an existing customer who needs access to Whatsapp Cloud APIs please drop an email to hello@exotel.com and we will surely assist you.
This API can send messages to a single number with a message content or different numbers with different message contents for each number. To send message through Exotel API, you will need to make a HTTP POST request to
https://<your_api_key>:<your_api_token><subdomain>/v2/accounts/<your_sid>/messages
<your_api_key>
and <your_api_token>
with the API key and token created by you.<your_sid>
with your “Account sid".<subdomain>
with the region of your account
<your_api_key>
, <your_api_token>
and <your_sid>
are available in the API settings page of your Exotel Dashboard
The following are the POST parameters -
Parameter Name |
Parameter Type |
Mandatory/Optional |
Value |
custom_data |
String |
Optional |
This parameter can be used to send any custom data at the API request level. This will be passed back in the callback. |
status_callback |
String (URL) |
Optional |
Once the message reaches terminal state, Exotel will do a POST callback to your end point if the URL is set as a parameter in the API. |
|
Channel Object |
Optional |
Information related to the messages to be sent out on whatsapp. |
* The Whatsapp parameter mentioned here will be used to send messages through Whatsapp communication channel. In future the API will be extended further to support other communication channels like SMS. Later, SMS parameter can also be passed to send SMSes.
Parameter Name |
Parameter Type |
Mandatory/Optional |
Value |
custom_data |
String |
Optional |
This parameter can be used to send any custom data at the API request level. This will be passed back in the callback. |
status_callback |
String (URL) |
Optional |
Once the message reaches terminal state, Exotel will do a POST callback to your end point if the URL is set as a parameter in the API. |
messages |
[]Message Object |
Mandatory |
Array of messages to be sent out |
Parameter Name |
Parameter Type |
Mandatory/Optional |
Value |
custom_data |
String |
Optional |
This parameter can be used to send any custom data at the API request level. This will be passed back in the callback. |
status_callback |
String (URL) |
Optional |
Once the message reaches terminal state, Exotel will do a POST callback to your end point if the URL is set as a parameter in the API. |
from |
String |
Mandatory |
From number from which the message has to be sent |
to |
String |
Mandatory |
Phone number of the user to whom a message needs to be sent. The number must be in e.164 format. Here are some examples of supported phone number formats: "+10000000000" "+919888888888" "+919876543210" |
content |
Whatsapp Message Object |
Mandatory |
Whatsapp message body |
This will be similar to Whatsapp Native API contracts [Refer Here]:
Parameter Name |
Parameter Type |
Mandatory/Optional |
Value |
recepient_type |
String |
Mandatory |
Recipient type of the user to whom message is being sent. Currently, you can only send messages to individuals. Set this as an individual. Default: individual |
type |
String |
Mandatory |
Type of the message. Type can be - Text Image Audio Video Document Sticker Location Contact Interactive - This is for List Messages, Reply Buttons |
text |
Text Object |
Mandatory/Optional |
Mandatory when type is text. To send a text message attach a WhatsappMessageObject with type = text and then add a text object |
image |
Image Object |
Mandatory/Optional |
Mandatory when type is image. To send a image attach a WhatsappMessageObject with type = image and then add a image object |
audio |
Audio Object |
Mandatory/Optional |
Mandatory when type is audio. To send a audio attach a WhatsappMessageObject with type = audio and then add a audio object |
video |
Video Object |
Mandatory/Optional |
Mandatory when type is video. To send a video attach a WhatsappMessageObject with type = video and then add a video object |
document |
Document Object |
Mandatory/Optional |
Mandatory when type is document. To send a sticker attach a WhatsappMessageObject with type = document and then add a document object |
sticker |
Sticker Object |
Mandatory/Optional |
Mandatory when type is sticker. To send a sticker attach a WhatsappMessageObject with type = sticker and then add a sticker object. The type of file should be image/webp. |
location |
Location Object |
Mandatory/Optional |
Mandatory when type is location. To send a location message attach a WhatsappMessageObject with type = location and then add a location object |
contacts |
Contact Object |
Mandatory/Optional |
Mandatory when type is contacts. To send a contact message attach a WhatsappMessageObject with type = contact and then add a contacts object |
interactive |
Interactive Object |
Mandatory/Optional |
Mandatory when type is interactive. To send interactive messages attach a WhatsappMessageObject with type = interactive and then add an interactive object. The components of each interactive object generally follow a consistent pattern: header, body, footer, and action. |
Parameter Name |
Parameter Type |
Mandatory/Optional |
Value |
body |
String |
Mandatory |
The text of the text message which can contain URLs which begin with http:// or https:// and formatting. If you include URLs in your text and want to include a preview box in text messages (preview_url: true), make sure the URL starts with http:// or https:// —https:// URLs are preferred. You must include a hostname, since IP addresses will not be matched. Maximum length: 4096 characters. |
preview_url |
Boolean |
Optional |
Set preview_url as ‘Yes’ only if the body includes a URL which begins with https:// or http:// and you want to preview the URL Set preview_url as ‘No’ if you do not want to preview the URL |
Parameter Name |
Parameter Type |
Mandatory/Optional |
Value |
link |
String |
Mandatory |
Link of the image to be sent.Use only with HTTP/HTTPS URLs. |
caption |
String |
Optional |
Caption for the image. Describes the specified image. |
Parameter Name |
Parameter Type |
Mandatory/Optional |
Value |
link |
String |
Mandatory |
Link of the audio to be sent.Use only with HTTP/HTTPS URLs. |
Parameter Name |
Parameter Type |
Mandatory/Optional |
Value |
link |
String |
Mandatory |
Link of the video to be sent. Use only with HTTP/HTTPS URLs. |
caption |
String |
Optional |
Caption for the video. Describes the specified video media. |
Parameter Name |
Parameter Type |
Mandatory/Optional |
Value |
link |
String |
Mandatory |
Link of the document to be sent. Use only with HTTP/HTTPS URLs. |
caption |
String |
Optional |
Caption for the document. Describes the specified document media. |
filename |
String |
Optional |
Describes the filename for the specific document. Use only with document media. The extension of the filename will specify what format the document is displayed as in WhatsApp. |
Parameter Name |
Parameter Type |
Mandatory/Optional |
Value |
link |
String |
Mandatory |
Link of the sticker to be sent. Use only with HTTP/HTTPS URLs. |
Parameter Name |
Parameter Type |
Mandatory/Optional |
Value |
longitude |
String |
Mandatory |
Longitude of the location |
latitude |
String |
Mandatory |
Latitude of the location |
name |
String |
Optional |
Name of the location |
address |
String |
Optional |
Address of the location. Only displayed if name is present. |
Parameter Name |
Parameter Type |
Mandatory/Optional |
Value |
addresses |
[]Address Object |
Optional |
List of addresses |
birthday |
String |
Optional |
Birthday of the contact. YYYY-MM-DD formatted string. |
emails |
[]Email Object |
Optional |
List of emails of the contact. |
name |
Name Object |
Mandatory |
Full contact name of the contact |
org |
Org Object |
Optional |
Organization information of the contact |
phones |
[]Phone Object |
Optional |
Phone number(s) of the contact |
urls |
[]URL Object |
Optional |
URL(s) of the contact |
Parameter Name |
Parameter Type |
Mandatory/Optional |
Value |
city |
String |
Optional |
City name of the address |
country |
String |
Optional |
Full country name of the address |
country_code |
String |
Optional |
Country code of the address. Two-letter country abbreviation. |
state |
String |
Optional |
State of the address. State abbreviation |
street |
String |
Optional |
Street number and name of the address |
type |
String |
Optional |
Type of the address. Standard values are HOME and WORK. |
zip |
String |
Optional |
ZIP code of the address |
Parameter Name |
Parameter Type |
Mandatory/Optional |
Value |
|
String |
Optional |
Email address. |
type |
String |
Optional |
Type of the email. Standard values are HOME and WORK. |
Parameter Name |
Parameter Type |
Mandatory/Optional |
Value |
first_name |
String |
Optional |
First Name of the contact |
formatted_name |
String |
Mandatory |
Full name, as it normally appears. |
last_name |
String |
Optional |
Last Name of the contact |
middle_name |
String |
Optional |
Middle Name of the contact |
suffix |
String |
Optional |
Suffix of the contact |
prefix |
String |
Optional |
Prefix of the contact |
*At least one of the optional parameters needs to be included along with the formatted_name parameter.
Parameter Name |
Parameter Type |
Mandatory/Optional |
Value |
company |
String |
Optional |
Name of the contact's company. |
department |
String |
Optional |
Name of the contact's department. |
title |
String |
Optional |
Contact's business title. |
Parameter Name |
Parameter Type |
Mandatory/Optional |
Value |
phone |
String |
Optional |
Phone number of the contact |
type |
String |
Optional |
Standard Values are CELL, MAIN, IPHONE, HOME, and WORK. |
wa_id |
String |
Optional |
Whatsapp Id of the phone number |
Parameter Name |
Parameter Type |
Mandatory/Optional |
Value |
URL |
String |
Optional |
URL of the contact |
type |
String |
Optional |
Standard values are HOME and WORK. |
Parameter Name |
Parameter Type |
Mandatory/Optional |
Value |
type |
String |
Optional |
The type of interactive message you want to send. Supported values:
|
header |
Header Object |
Optional |
Header content displayed on top of a message. |
body |
Body Object |
Mandatory/Optional |
Optional for type product. Required for other message types. |
footer |
Footer Object |
Optional |
Footer of the interactive message |
action |
Action Object |
Optional |
Action you want the user to perform after reading the message. |
Parameter Name |
Parameter Type |
Mandatory/Optional |
Value |
type |
String |
Mandatory |
The header type you would like to use. Supported values:
|
text |
String |
Mandatory/Optional |
Required if header type is set to text. Text for the header. Formatting allows emojis, but not markdown. Maximum length: 60 characters. |
image |
Image Object |
Mandatory/Optional |
Required if header type is set to image. |
video |
Video Object |
Mandatory/Optional |
Required if header type is set to video. |
document |
Document Object |
Mandatory/Optional |
Required if header type is set to document. |
Parameter Name |
Parameter Type |
Mandatory/Optional |
Value |
text |
String |
Mandatory |
Required if body is present. The content of the message. Emojis and markdown are supported. Maximum length: 1024 characters. |
Parameter Name |
Parameter Type |
Mandatory/Optional |
Value |
text |
String |
Mandatory |
Required if footer is present. The footer content. Emojis, markdown, and links are supported. Maximum length: 60 characters. |
Parameter Name |
Parameter Type |
Mandatory/Optional |
Value |
button |
String |
Mandatory |
Required for List Messages. Button content. It cannot be an empty string and must be unique within the message. Emojis are supported, markdown is not. Maximum length: 20 characters. |
sections |
[]Section Object |
Mandatory/Optional |
Sections of action (To send Interactive List message). Required for List Messages. Array of section objects. Minimum of 1, maximum of 10. |
buttons |
[]Button Object |
Mandatory/Optional |
Button of the action (To send Interactive Button message).Required for Reply Buttons.You can have up to 3 buttons. |
Parameter Name |
Parameter Type |
Mandatory/Optional |
Value |
title |
String |
Mandatory/Optional |
Title of the section.Required if the message has more than one section. Maximum length: 24 characters. |
rows |
[]Row Object |
Mandatory |
Contains a list of rows. You can have a total of 10 rows across your sections. Each row must have a title (Maximum length: 24 characters) and an ID (Maximum length: 200 characters). You can add a description (Maximum length: 72 characters), but it is optional. |
Parameter Name |
Parameter Type |
Mandatory/Optional |
Value |
id |
String |
Mandatory |
ID of the row |
title |
String |
Mandatory |
Title of the row |
description |
String |
Optional |
Description of the row |
Parameter Name |
Parameter Type |
Mandatory/Optional |
Value |
type |
String |
Mandatory |
Type of the Button. Only supported type is reply (for Reply Button) |
reply |
ReplyObject |
Mandatory |
Information to be added to the button. |
Parameter Name |
Parameter Type |
Mandatory/Optional |
Value |
id |
String |
Mandatory |
ID of the information. Unique identifier for your button. This ID is returned in the webhook when the button is clicked by the user. Maximum length: 256 characters. You cannot have leading or trailing spaces when setting the ID. |
title |
String |
Mandatory |
Title of the information. It cannot be an empty string and must be unique within the message. Emojis are supported, markdown is not. Maximum length: 20 characters. |
Please refer Exotel's sample postman collection to try out the APIs, we have also shared some examples here for your reference.
curl -XPOST "https://<api_key>:<api_token><subdomain>/v2/accounts/<your_sid>/messages" -d '{ "custom_data": "Order12", "status_callback": "https://webhook.site", "whatsapp": { "custom_data": "Order12", "status_callback": "https://webhook.site", "messages": [ { "custom_data": "Order12", "status_callback": "https://webhook.site", "from": "+919999XXXXXX", "to": "++919999XXXXXX", "content": { "recipient_type": "individual", "type": "text", "text": { "preview_url": false, "body": "MESSAGE_CONTENT" } } }, { "custom_data": "Order12", "status_callback": "https://webhook.site", "from": "+919999XXXXXX", "to": "+919999XXXXXX", "Content": { "recipient_type": "individual", "type": "text", "text": { "preview_url": false, "body": "MESSAGE_CONTENT" } } } ] } }'
var https = require('follow-redirects').https; var fs = require('fs'); var qs = require('querystring'); var options = { 'method': 'POST', 'hostname': '<api_key>', 'port': <api_token><subdomain>, 'path': '/v2/accounts/<your_sid>/messages', 'headers': { 'Content-Type': 'application/x-www-form-urlencoded' }, 'maxRedirects': 20 }; var req = https.request(options, function (res) { varchunks= []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function (chunk) { varbody=Buffer.concat(chunks); console.log(body.toString()); }); res.on("error", function (error) { console.error(error); }); }); var postData = qs.stringify({ '{\n "custom_data": "Order12",\n "status_callback": "https://webhook.site",\n "whatsapp": {\n "custom_data": "Order12",\n "status_callback": "https://webhook.site",\n "messages": [\n {\n "custom_data": "Order12",\n "status_callback": "https://webhook.site",\n "from": "+919999XXXXXX",\n "to": "+919999XXXXXX",\n "content": {\n "recipient_type": "individual",\n "type": "text",\n "text": {\n "preview_url": false,\n "body": "MESSAGE_CONTENT"\n }\n }\n },\n {\n "custom_data": "Order12",\n "status_callback": "https://webhook.site",\n "from": "+919999XXXXXX",\n "to": "+919999XXXXXX",\n "Content": {\n "recipient_type": "individual",\n "type": "text",\n "text": {\n "preview_url": false,\n "body": "MESSAGE_CONTENT"\n }\n }\n }\n ]\n }\n }': '' }); req.write(postData); req.end();
<?php $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => 'https://%3Capi_key%3E:%3Capi_token%3E%3Csubdomain%3E/v2/accounts/%3Cyour_sid%3E/messages', CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_POSTFIELDS => '%7B%0A%20%20%20%22custom_data%22%3A%20%22Order12%22%2C%0A%20%20%20%22status_callback%22%3A%20%22https%3A%2F%2Fwebhook.site%22%2C%0A%20%20%20%22whatsapp%22%3A%20%7B%0A%20%20%20%20%20%20%22custom_data%22%3A%20%22Order12%22%2C%0A%20%20%20%20%20%20%22status_callback%22%3A%20%22https%3A%2F%2Fwebhook.site%22%2C%0A%20%20%20%20%20%20%22messages%22%3A%20%5B%0A%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%22custom_data%22%3A%20%22Order12%22%2C%0A%20%20%20%20%20%20%20%20%20%20%22status_callback%22%3A%20%22https%3A%2F%2Fwebhook.site%22%2C%0A%20%20%20%20%20%20%20%20%20%20%22from%22%3A%20%22%2B9199XXXXXXXX%22%2C%0A%20%20%20%20%20%20%20%20%20%20%22to%22%3A%20%22%2B9199XXXXXXXX%22%2C%0A%20%20%20%20%20%20%20%20%20%20%22content%22%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%22recipient_type%22%3A%20%22individual%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22type%22%3A%20%22text%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22text%22%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22preview_url%22%3A%20false%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22body%22%3A%20%22MESSAGE_CONTENT%22%0A%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%22custom_data%22%3A%20%22Order12%22%2C%0A%20%20%20%20%20%20%20%20%20%22status_callback%22%3A%20%22https%3A%2F%2Fwebhook.site%22%2C%0A%20%20%20%20%20%20%20%20%20%22from%22%3A%20%22%2B9199XXXXXXXX%22%2C%0A%20%20%20%20%20%20%20%20%20%22to%22%3A%20%22%2B9199XXXXXXXX%22%2C%0A%20%20%20%20%20%20%20%20%20%22Content%22%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%22recipient_type%22%3A%20%22individual%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%22type%22%3A%20%22text%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%22text%22%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%22preview_url%22%3A%20false%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%22body%22%3A%20%22MESSAGE_CONTENT%22%0A%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%5D%0A%20%20%20%7D%0A%20%7D=', CURLOPT_HTTPHEADER => array( 'Content-Type: application/x-www-form-urlencoded' ), )); $response = curl_exec($curl); curl_close($curl); echo $response;
import requests url = "https://<api_key>:<api_token><subdomain>/v2/accounts/<your_sid>/messages" payload='%7B%0A%20%20%20%22custom_data%22%3A%20%22Order12%22%2C%0A%20%20%20%22status_callback%22%3A%20%22https%3A%2F%2Fwebhook.site%22%2C%0A%20%20%20%22whatsapp%22%3A%20%7B%0A%20%20%20%20%20%20%22custom_data%22%3A%20%22Order12%22%2C%0A%20%20%20%20%20%20%22status_callback%22%3A%20%22https%3A%2F%2Fwebhook.site%22%2C%0A%20%20%20%20%20%20%22messages%22%3A%20%5B%0A%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%22custom_data%22%3A%20%22Order12%22%2C%0A%20%20%20%20%20%20%20%20%20%20%22status_callback%22%3A%20%22https%3A%2F%2Fwebhook.site%22%2C%0A%20%20%20%20%20%20%20%20%20%20%22from%22%3A%20%22%2B9199XXXXXXXX%22%2C%0A%20%20%20%20%20%20%20%20%20%20%22to%22%3A%20%22%2B9199XXXXXXXX%22%2C%0A%20%20%20%20%20%20%20%20%20%20%22content%22%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%22recipient_type%22%3A%20%22individual%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22type%22%3A%20%22text%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22text%22%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22preview_url%22%3A%20false%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22body%22%3A%20%22MESSAGE_CONTENT%22%0A%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%22custom_data%22%3A%20%22Order12%22%2C%0A%20%20%20%20%20%20%20%20%20%22status_callback%22%3A%20%22https%3A%2F%2Fwebhook.site%22%2C%0A%20%20%20%20%20%20%20%20%20%22from%22%3A%20%22%2B919945566772%22%2C%0A%20%20%20%20%20%20%20%20%20%22to%22%3A%20%22%2B919988998899%22%2C%0A%20%20%20%20%20%20%20%20%20%22Content%22%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%22recipient_type%22%3A%20%22individual%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%22type%22%3A%20%22text%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%22text%22%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%22preview_url%22%3A%20false%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%22body%22%3A%20%22MESSAGE_CONTENT%22%0A%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%5D%0A%20%20%20%7D%0A%20%7D=' headers = { 'Content-Type': 'application/x-www-form-urlencoded' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text)
require "uri" require "net/http" url = URI("https://<api_key>:<api_token><subdomain>/v2/accounts/<your_sid>/messages") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = "application/x-www-form-urlencoded" request.body = "%7B%0A%20%20%20%22custom_data%22%3A%20%22Order12%22%2C%0A%20%20%20%22status_callback%22%3A%20%22https%3A%2F%2Fwebhook.site%22%2C%0A%20%20%20%22whatsapp%22%3A%20%7B%0A%20%20%20%20%20%20%22custom_data%22%3A%20%22Order12%22%2C%0A%20%20%20%20%20%20%22status_callback%22%3A%20%22https%3A%2F%2Fwebhook.site%22%2C%0A%20%20%20%20%20%20%22messages%22%3A%20%5B%0A%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%22custom_data%22%3A%20%22Order12%22%2C%0A%20%20%20%20%20%20%20%20%20%20%22status_callback%22%3A%20%22https%3A%2F%2Fwebhook.site%22%2C%0A%20%20%20%20%20%20%20%20%20%20%22from%22%3A%20%22%2B9199XXXXXXXX2%22%2C%0A%20%20%20%20%20%20%20%20%20%20%22to%22%3A%20%22%2B9199XXXXXXXX%22%2C%0A%20%20%20%20%20%20%20%20%20%20%22content%22%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%22recipient_type%22%3A%20%22individual%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22type%22%3A%20%22text%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22text%22%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22preview_url%22%3A%20false%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22body%22%3A%20%22MESSAGE_CONTENT%22%0A%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%22custom_data%22%3A%20%22Order12%22%2C%0A%20%20%20%20%20%20%20%20%20%22status_callback%22%3A%20%22https%3A%2F%2Fwebhook.site%22%2C%0A%20%20%20%20%20%20%20%20%20%22from%22%3A%20%22%2B9199XXXXXXXX%22%2C%0A%20%20%20%20%20%20%20%20%20%22to%22%3A%20%22%2B9199XXXXXXXX%22%2C%0A%20%20%20%20%20%20%20%20%20%22Content%22%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%22recipient_type%22%3A%20%22individual%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%22type%22%3A%20%22text%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%22text%22%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%22preview_url%22%3A%20false%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%22body%22%3A%20%22MESSAGE_CONTENT%22%0A%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%5D%0A%20%20%20%7D%0A%20%7D=" response = https.request(request) puts response.read_body
curl -XPOST "https://<api_key>:<api_token><subdomain>/v2/accounts/<your_sid>/messages" -d '{ "custom_data": "ORDER126", "status_callback": "https://webhook.site/", "whatsapp": { "messages": [ { "from": "9199XXXXXXXX", "to": "9199XXXXXXXX", "content": { "type": "image", "image": { "link": "https://image.587.jpg", "caption": "This is image caption" } } } ] } }'
var https = require('follow-redirects').https; var fs = require('fs'); var options = { 'method': 'POST', 'hostname': '{{Host}}', 'path': '/v2/accounts/{{AccountSid}}/messages', 'headers': { 'Content-Type': 'application/json' }, 'maxRedirects': 20 }; var req = https.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function (chunk) { var body = Buffer.concat(chunks); console.log(body.toString()); }); res.on("error", function (error) { console.error(error); }); }); var postData = JSON.stringify({ "custom_data": "ORDER126", "status_callback": "https://webhook.site/", "whatsapp": { "messages": [ { "from": "9199XXXXXXXX", "to": "9199XXXXXXXX", "content": { "type": "image", "image": { "link": "https://image.587.jpg", "caption": "This is image caption" } } } ] } }); req.write(postData); req.end();
<?php $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => 'https://%7B%7BAccountSid%7D%7D:%7B%7BAccountToken%7D%7D@%7B%7BHost%7D%7D/v2/accounts/%7B%7BAccountSid%7D%7D/messages', CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_POSTFIELDS =>'{ "custom_data": "ORDER126", "status_callback": "https://webhook.site/", "whatsapp": { "messages": [ { "from": "9199XXXXXXXX", "to": "9199XXXXXXXX", "content": { "type": "image", "image": { "link": "https://image.587.jpg", "caption": "This is image caption" } } } ] } }', CURLOPT_HTTPHEADER => array( 'Content-Type: application/json' ), )); $response = curl_exec($curl); curl_close($curl); echo $response;
import requests
import json
url = “https://{{AccountSid}}:{{AccountToken}}@{{Host}}/v2/accounts/{{AccountSid}}/messages”
payload = json.dumps({
“custom_data”: “ORDER126”,
“status_callback”: “https://webhook.site/”,
“whatsapp”: {
“messages”: [
{
“from”: “9199XXXXXXXX”,
“to”: “9199XXXXXXXX”,
“content”: {
“type”: “image”,
“image”: {
“link”: “https://image.587.jpg”,
“caption”: “This is image caption”
}
}
}
]
}
})
headers = {
‘Content-Type’: ‘application/json’
}
response = requests.request(“POST”, url, headers=headers, data=payload)
print(response.text)
require "uri" require "json" require "net/http" url = URI("https://{{AccountSid}}:{{AccountToken}}@{{Host}}/v2/accounts/{{AccountSid}}/messages") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = "application/json" request.body = JSON.dump({ "custom_data": "ORDER126", "status_callback": "https://webhook.site/", "whatsapp": { "messages": [ { "from": "9199XXXXXXXX", "to": "9199XXXXXXXX", "content": { "type": "image", "image": { "link": "https://image.587.jpg", "caption": "This is image caption" } } } ] } }) response = https.request(request) puts response.read_body
HTTP Response:
{ "request_id": "b434e927a5844175b23059cd96feea3d", "method": "POST", "http_code": 202, "metadata": { "failed": 0, "total": 1, "success": 1 }, "response": { "whatsapp": { "messages": [ { "code": 202, "error_data": null, "status": "success", "data": { "sid": "2FdiiEQUosckPhpZfuVwfjxiSlc16a4", } } ] } } }
The following are the response parameters -
Parameter |
Type |
Mandatory/Optional |
Notes |
request_id |
String |
Mandatory |
This indicates the unique id of the request. Useful for debugging and tracing purposes. |
method |
String |
Mandatory |
This indicates the HTTP method for the request such as POST |
http_code |
Integer |
Mandatory |
This indicates the HTTP code for the request such as 202, 400, 500 etc. |
metadata |
Metadata Object |
Mandatory |
Metadata pertaining to the request. Count of failed, total and success records. |
response |
Response Object |
Mandatory |
Response for the request |
Parameter |
Type |
Mandatory/Optional |
Notes |
total |
Integer |
Mandatory |
Total number of the messages in the request |
success |
Integer |
Mandatory |
Number of messages successfully accepted |
failed |
Integer |
Mandatory |
Number of messages that couldn’t be accepted (failed) |
Parameter |
Type |
Mandatory/Optional |
Notes |
|
Channel Response Object |
Mandatory |
Response for Whatsapp messages specified in the request |
Parameter |
Type |
Mandatory/Optional |
Notes |
messages |
[]Create Message Response Object |
Mandatory |
Array of messages response for each message |
Parameter |
Type |
Mandatory/Optional |
Notes |
code |
Integer |
Mandatory |
Response code for the individual message |
error_data |
Error Response Object |
Optional |
Error related to a single message |
status |
String |
Mandatory |
Status of the single message |
data |
Message Response Object |
Optional |
Data pertaining to a single message |
Parameter |
Type |
Mandatory/Optional |
Notes |
code |
Numeric |
Mandatory |
Numeric HTTP code for a Single message |
message |
String |
Mandatory |
Brief description of the error |
description |
String |
Mandatory |
Detailed explanation of error |
Parameter |
Type |
Mandatory/Optional |
Notes |
sid |
String |
Mandatory |
SID (Unique identifier) of the single message |
HTTP Error Codes |
Error Message |
202 |
Accepted - Request accepted. |
400 |
Bad Request - Something in your header or request body was malformed/missing. More than 100 messages specified in a request |
401 |
Unauthorized - Necessary credentials were either missing or invalid. |
402 |
Payment Required - The action is not available on your plan, or you have exceeded usage limits for your current plan. |
403 |
Your credentials are valid, but you don’t have access to the requested resource. |
404 |
Not Found - The object you’re requesting doesn’t exist. |
5xx |
Server Errors - Something went wrong at our end. Please try again. |
Status callback URL can be passed in status_callback parameter in send message/template message APIs and it can also be configured as default to receive the responses. Exotel team will help you configure the default URL while onboarding.
*NOTE: Any callback can be received only in one status callback URL at any time
"whatsapp": { "messages": [ { "callback_type": "dlr", "sid": "1234", "to": "2365564965", "exo_status_code": 25001, "exo_detailed_status": "EX_MESSAGE_DELIVERED", "description": "Message delivered", "timestamp": "2022-12-07T17:00:00.000+05:30", "custom_data": "custom" } ] } }
The following are the status callback parameters -
Parameter |
Type |
Mandatory |
Notes |
|
Message DLR Object |
Optional |
Delivery report (DLR) of the Whatsapp channel |
Parameter |
Type |
Mandatory |
Notes |
messages |
[]Whatsapp Message DLR Object |
Mandatory |
Information relating to the messages for DLR |
Parameter |
Type |
Mandatory |
Notes |
callback_type |
String |
Mandatory |
Type of the callback. Possible values: dlr, icm |
sid |
String |
Mandatory |
SID (Unique Identifier) of the message |
to |
String |
Mandatory |
Phone Number of the user to whom the message was sent. |
exo_status_code |
Integer |
Mandatory |
ExoStatusCode for the message |
exo_detailed_status |
String |
Mandatory |
Detailed status of ExoStatus code |
description |
String |
Mandatory |
Description of the ExoStatus code |
timestamp |
String |
Mandatory |
Timestamp at which the event occurred |
custom_data |
String |
Optional |
It will return the custom data, if the same was passed in the API request |
Detailed Status Code |
Detailed Status |
Description |
30001 |
EX_MESSAGE_SENT |
The message has been sent to the user |
30002 |
EX_MESSAGE_DELIVERED |
The message has been successfully delivered to the user |
30003 |
EX_MESSAGE_SEEN |
The message has been seen by the user |
30004 |
EX_SYSTEM_ERROR |
The message failed due to an issue with the system. For eg: Authentication/Access Token/Permission related issue, service not available issue etc. |
30005 |
EX_NUMBER_ERROR |
The message failed due to an issue with the phone number |
30006 |
EX_SETUP_ERROR |
The message failed due to set-up error |
30007 |
EX_RATE_LIMIT_HIT |
The message failed due to a breach in rate limit |
30008 |
EX_SPAM_RATE_LIMIT_HIT |
The message failed as spam rate limit has been breached |
30009 |
EX_TOO_MANY_REQUEST |
The message failed as too many request has been made in short span |
30010 |
EX_INVALID_REQUEST |
The message failed as the request is invalid |
30011 |
EX_UNKNOWN_ERROR |
The message failed due to an unknown error |
30012 |
EX_INVALID_RECIPIENT |
The message failed as the recipient was invalid |
30013 |
EX_INCAPABLE_RECIPIENT |
The message failed as the recipient is unable to receive the message |
30014 |
EX_RECIPIENT_BLOCKED |
The message failed as the recipient is not in allowed list |
30015 |
EX_UNSUPPORTED_MESSAGE |
The message failed as unsupported message type has been passed in the request body |
30016 |
EX_MEDIA_DOWNLOAD_ERROR |
The message failed as Whatsapp is unable to download the sender media |
30017 |
EX_MEDIA_UPLOAD_ERROR |
The message failed as unsupported media type has been passed in the request body |
30018 |
EX_REENGAGEMENT_ERROR |
The message failed as 24 hours window of the conversation is over |
30019 |
EX_INVALID_PARAM |
The message failed as invalid parameters has been passed in the request body |
30020 |
EX_MISSING_PARAM |
The message has failed as mandatory parameter is missing from the request body |
30021 |
EX_INVALID_PARAM_VALUE |
The message failed as invalid parameter value has been passed in the request body |
30022 |
EX_TEMPLATE_ERROR |
The message failed as the template format char policy has been violated |
30023 |
EX_TEMPLATE_PARAM_ERROR |
The message failed due to mismatch in count of template parameters |
30024 |
EX_TEMPLATE_NOT_FOUND |
The message failed as the passed message template does not exist |
30025 |
EX_TEMPLATE_TEXT_TOO_LONG |
The message failed as the translated text from template message is too long |
30026 |
EX_INVALID_TEMPLATE_NAMESPACE |
The message failed as invalid template namespace has been passed |
30027 |
EX_MESSAGE_PENDING_TOO_LONG |
The message failed as the message was pending for too long |
30028 |
EX_MESSAGE_EXPIRED |
The message failed as the message got expired |
30029 |
EX_MESSAGE_TOO_LONG |
The message failed as the number of characters in the message was more than 4096 characters |
30030 |
EX_WEBHOOK_ERROR |
Webhook is not configured |
30031 |
EX_SECTION_COUNT_ERROR |
The message failed due to invalid no. of sections |
30032 |
EX_ROWS_COUNT_ERROR |
The message failed due to invalid no. of rows |
30033 |
EX_PRODUCT_COUNT_ERROR |
The message failed due to invalid no. of product |
30034 |
EX_CATALOGUE_NOT_FOUND |
The message failed as the catalog ID has not been found |
30035 |
EX_CATALOGUE_NOT_LINKED |
The message failed as the catalog ID has not been linked to the API number |
30036 |
EX_MISSING_PRODUCT |
The message failed as the product is missing in the catalog |
30037 |
EX_PRODUCT_NOT_FOUND |
The message failed as all the products in the request body has not been found in the product catalog |
30038 |
EX_PRODUCT_COMPLIANCE_ERROR |
The message failed as the listed products failed compliance |
30039 |
EX_INVALID_HEADER |
The message failed due to invalid header structure |
30040 |
EX_MISSING_COMPLIANCE |
The message failed as compliance information was missing |
30041 |
EX_CHAR_POLICY_VIOLATION |
The message failed as character policy got violated |
This WhatsApp Payment API feature is only available for WhatsApp businesses operating in India, catering specifically to their Indian customer base. Please note that access to this functionality is limited to transactions within the Indian region from Meta.
You can now send the Payment Message (order_details) and your business can enable customers to pay for their orders using all the UPI Apps installed on their devices or via Credit cards or Internet Banking via WhatsApp.
A WhatsApp Payment flow is a user-initiated conversation that is initiated by the user or available in the existing chatbot flow and sent as a free-form message.
Businesses can send customers invoice (order_details) messages, and then get notified about payment status updates via webhook notifications from Payment Gateway or Exotel (via Meta) based on the Payment method you choose to integrate.
Based on particular use cases, businesses can collect payment from customers using one of the following integrations.
In case you want to support all the types of payment methods to your end users, then we would suggest you proceed ahead with the Payment Gateway method with preferred PGs (RazorPay or PayU) as natively supported by Meta. Other PGs would require a deep integration based on the requirement.
The below comparison will help you understand the differences and proceed accordingly.
User Experience:
User Experience |
UPI Intent Mode |
Payment Gateway Deep Integration Mode |
Native support for "Other payment methods" Eg: Netbanking, cards, wallets |
❌ Alternative: Send payment links |
✅ |
Native support for UPI Intent |
✅ |
✅ |
Native Payment Status Notification |
❌ |
✅ |
Integration Features |
UPI Intent Mode |
Payment Gateway Deep Integration Mode |
Refunds from WhatsApp APIs |
❌ |
✅ |
Payment Status from WhatsApp webhooks |
❌ |
✅ |
Note: In the case of UPI Intent payment flow, the payment success & failure need to be integrated with the VPA's payment switch or the Payment Gateway to whomever the VPA IDs belong to. Exotel (via Meta) will not be able to send any callbacks natively and will require an integration to be done.
Before you start sending the Message with the order details and payment button, you need to complete the setup and follow the steps:
Please go through our detailed WhatsApp Payments Integration Guide here.
To send messages to a single number with configured Flow button content via Exotel API, make an HTTP POST request to:
https://<your_api_key>:<your_api_token><subdomain>/v2/accounts/<your_sid>/messages
<your_api_key>
and <your_api_token>
with the API key and token created by you.<your_sid>
with your “Account sid".<subdomain>
with the region of your account
<your_api_key>
, <your_api_token>
and <your_sid>
are available in the API settings page of your Exotel Dashboard
The following are the POST parameters -
Payment Interactive Object
Parameter Name | Parameter Type | Mandatory/Optional | Parameter Description |
type | String | Optional | The type of interactive message you want to send. Supported values:button: Use it for Reply Buttons. list: Use it for List Messages. |
header | HeaderObject | Optional | Header content displayed on top of a message. If a header is not provided, the API uses an image of the first available product as the header |
body | BodyObject | Mandatory | Optional for type product. Required for other message types. |
footer | FooterObject | Optional | An object with the footer of the message. The object contains the following fields: text string |
action | ActionObject | Mandatory | An action object you want the user to perform after reading the message. This action object contains the following fields: name string Must be "review_and_pay"PaymentParametersObject Refer to PaymentParametersObject for details on the fields |
Payment Parameters Object
Parameter Name | Parameter Type | Mandatory/Optional | Parameter Description |
reference_id | string | Mandatory | Unique identifier for the order or invoice provided by the business. This cannot be an empty string and can only contain English letters, numbers, underscores, dashes, or dots, and should not exceed 35 characters. The reference_id must be unique for each order_details message for the same business. If the partner would like to send multiple order_details messages for the same order, invoice, etc. it is recommended to include a sequence number in the reference_id (for example, -) to ensure reference_id uniqueness. |
type | string | Mandatory | The type of goods being paid for in this order. supported options are digital-goods physical-goods |
beneficiaries | PaymentBeneficiariesObject | Mandatory/Optional | Mandatory for shipped physical-goods. See PayementBeneficiariesObject |
payment_type | string | Mandatory | Must be "payment_gateway" |
payment_configuration | string | Mandatory | The name of the pre-configured payment configuration to use for this order and must not exceed 60 characters. |
currency | string | Mandatory | The currency for this order. Currently the only supported value is INR. |
total_amount object |
PaymentAmountObject | Mandatory | The total_amount object Refer to PaymentAmountObject for details on the parameters total_amount.value must be equal to order.subtotal.value + order.tax.value + order.shipping.value - order.discount.value. |
object | PaymentParametersOrderObject | Mandatory | See PaymentParametersOrderObject for details on this object |
Payment Parameter Items Object
Parameter Name | Parameter Type | Mandatory/Optional | Parameter Description |
retailer_id | string | Mandatory | Unique identifier for an item in the order. |
name | string | Mandatory | The item’s name to be displayed to the user. Cannot exceed 60 characters |
amout | string | Mandatory | The price per item Refer to PaymentAmount object |
sale_amount | AmountObject | Optional | The discounted price per item. This should be less than the original amount. If included, this field is used to calculate the subtotal amount |
quantity | string | Mandatory | The number of items in this order, this field cannot be decimal has to be integer. |
country_of_origin | string | Mandatory/Optional | Required if catalog_id is not present. Name of the importer company |
importer_name | string | Mandatory/Optional | Required if catalog_id is not present. Name of the importer company |
importer_address | string | Mandatory/Optional | Required if catalog_id is not present. Name of the importer company |
Payment Amount Object
Parameter Name | Parameter Type | Mandatory/Optional | Value |
offset | Integer | Mandatory | Must be 100 for INR |
value | Integer | Mandatory | Positive integer representing the amount value multiplied by offset. For example, ₹12.34 has value 1234. |
Payment Beneficiaries Object (Required for shipped physical-goods)
Parameter Name | Parameter Type | Mandatory/Optional | Parameter Description |
name | string | Mandatory | Name of the individual or business receiving the physical goods. Cannot exceed 200 characters |
address_line1 | string | Mandatory | Shipping address (Door/Tower Number, Street Name etc.). Cannot exceed 100 characters |
address_line2 | string | Optional | Shipping address (Landmark, Area, etc.). Cannot exceed 100 characters |
city | string | Mandatory | Name of the city |
state | string | Mandatory | Name of the state |
country | string | Mandatory | Support values India |
postal_code | string | Mandatory | 6-digit zipcode of shipping address. |
Payment Sub Total Amount Object
Parameter Name | Parameter Type | Mandatory/Optional | Parameter Description |
offset | Integer | Mandatory | Must be 100 for INR |
value | Integer | Mandatory | Positive integer representing the amount value multiplied by offset. For example, ₹12.34 has value 1234. |
Payment Tax Amount Object
Parameter Name | Parameter Type | Mandatory/Optional | Parameter Description |
offset | Integer | Mandatory | Must be 100 for INR |
value | Integer | Mandatory | Positive integer representing the amount value multiplied by offset. For example, ₹12.34 has value 1234. |
description | string | Optional | Max character limit is 60 characters |
Payment Shipping Cost Object
Parameter Name | Parameter Type | Mandatory/Optional | Parameter Description |
offset | Integer | Mandatory | Must be 100 for INR |
value | Integer | Mandatory | Positive integer representing the amount value multiplied by offset. For example, ₹12.34 has value 1234. |
description | string | Optional | Max character limit is 60 characters |
Payment Discount Object
Parameter Name | Parameter Type | Mandatory/Optional | Parameter Description |
offset | Integer | Mandatory | Must be 100 for INR |
value | Integer | Mandatory | Positive integer representing the amount value multiplied by offset. For example, ₹12.34 has value 1234. |
description | string | Optional | Max character limit is 60 characters |
Payment Expiration Object
Parameter Name | Parameter Type | Mandatory/Optional | Parameter Description |
timestamp | string | Mandatory | UTC timestamp in seconds of time when order should expire. Minimum threshold is 300 seconds |
description | string | Optional | Text explanation for expiration. Max character limit is 120 characters |
curl --location 'https://{{AuthKey}}:{{AuthToken}}@{{SubDomain}}/v2/accounts/{{AccountSid}}/messages' \ --header 'Content-Type: application/json' \ --data '{ "whatsapp": { "messages": [ { "from": "9199XXXXXXXX", "to": "9190XXXXXXXX", "content": { "type": "interactive", "interactive": { "type": "order_details", "header": { "type": "image", "image": { "link": "https://upload.wikimedia.org/wikipedia/commons/thumb/3/3b/Home_made_sour_dough_bread.jpg/640px-Home_made_sour_dough_bread.jpg" } }, "body": { "text": "Click on the Pay Now button to complete the order" }, "footer": { "text": "Thank You!" }, "action": { "name": "review_and_pay", "parameters": { "reference_id": "57848", "type": "digital-goods", "payment_type": "payment_gateway:razorpay", "payment_configuration": "XXXXXXXX", "currency": "INR", "total_amount": { "value": 1000, "offset": 100 }, "order": { "status": "pending", "items": [ { "retailer_id": "1234567", "name": "Bread", "amount": { "value": 1400, "offset": 100 }, "sale_amount": { "value": 1000, "offset": 100 }, "quantity": 1 } ], "subtotal": { "value": 1000, "offset": 100 }, "tax": { "value": 100, "offset": 100, "description": "GST Inclusive" }, "shipping": { "value": 0, "offset": 100, "description": "Via Postal" }, "discount": { "value": 100, "offset": 100, "description": "For Premium Customers", "discount_program_name": "optional_text" } } } } } } } ] } }'
import requests import json url = "https://{{AuthKey}}:{{AuthToken}}@{{SubDomain}}/v2/accounts/{{AccountSid}}/messages" payload = json.dumps({ "whatsapp": { "messages": [ { "from": "9172XXXXXXXX", "to": "9190XXXXXXXX", "content": { "type": "interactive", "interactive": { "type": "order_details", "header": { "type": "image", "image": { "link": "https://upload.wikimedia.org/wikipedia/commons/thumb/3/3b/Home_made_sour_dough_bread.jpg/640px-Home_made_sour_dough_bread.jpg" } }, "body": { "text": "Click on the Pay Now button to complete the order" }, "footer": { "text": "Thank You!" }, "action": { "name": "review_and_pay", "parameters": { "reference_id": "57848", "type": "digital-goods", "payment_type": "payment_gateway:razorpay", "payment_configuration": "Checking-paymentstest", "currency": "INR", "total_amount": { "value": 1000, "offset": 100 }, "order": { "status": "pending", "items": [ { "retailer_id": "1234567", "name": "Bread", "amount": { "value": 1400, "offset": 100 }, "sale_amount": { "value": 1000, "offset": 100 }, "quantity": 1 } ], "subtotal": { "value": 1000, "offset": 100 }, "tax": { "value": 100, "offset": 100, "description": "GST Inclusive" }, "shipping": { "value": 0, "offset": 100, "description": "Via Postal" }, "discount": { "value": 100, "offset": 100, "description": "For Premium Customers", "discount_program_name": "optional_text" } } } } } } } ] } }) headers = { 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text)
curl --location 'https://{{AuthKey}}:{{AuthToken}}@{{SubDomain}}/v2/accounts/{{AccountSid}}/messages' \ --header 'Content-Type: application/json' \ --data '{ "status_callback": "https://webhook.site/90XXXXXX", "whatsapp": { "messages": [ { "from": "+9180XXXXXXXX", "to": "+9186XXXXXXXX", "content": { "type": "interactive", "interactive": { "type": "order_details", "header": { "type": "image", "image": { "link": "https://upload.wikimedia.org/wikipedia/commons/thumb/3/3b/Home_made_sour_dough_bread.jpg/640px-Home_made_sour_dough_bread.jpg" } }, "body": { "text": "Click on the Pay Now button to complete the order" }, "footer": { "text": "Thank You!" }, "action": { "name": "review_and_pay", "parameters": { "type": "digital-goods", "currency": "INR", "reference_id": "1033XXXX", "payment_type": "upi", "payment_configuration": "XXXXXXXX", "total_amount": { "value": 1100, "offset": 100 }, "order": { "status": "pending", "items": [ { "retailer_id": "12345678", "name": "Bread", "amount": { "value": 1500, "offset": 100 }, "sale_amount": { "value": 1000, "offset": 100 }, "quantity": 1 } ], "subtotal": { "value": 1000, "offset": 100 }, "tax": { "value": 100, "offset": 100, "description": "GST Inclusive" }, "shipping": { "value": 100, "offset": 100, "description": "Via Postal" }, "discount": { "value": 100, "offset": 100, "description": "For Premium Customers", "discount_program_name": "optional_text" } } } } } } } ] } }'
HTTP Response:
{ "request_id": "b434e92XXXXXXXXXXXXX", "method": "POST", "http_code": 202, "metadata": { "failed": 0, "total": 1, "success": 1 }, "response": { "whatsapp": { "messages": [ { "code": 202, "error_data": null, "status": "success", "data": { "sid": "2FdiXXXXXXXXXXXXXXXXX", } } ] } } }
The following are the response parameters -
Parameter | Type | Mandatory/Optional | Notes |
request_id | String | Mandatory | This indicates the unique id of the request. Useful for debugging and tracing purposes. |
method | String | Mandatory | This indicates the HTTP method for the request such as POST |
http_code | Integer | Mandatory | This indicates the HTTP code for the request such as 202, 400, 500 etc. |
metadata | Metadata Object | Mandatory | Metadata pertaining to the request. Count of failed, total and success records. |
response | Response Object | Mandatory | Response for the request |
Parameter | Type | Mandatory/Optional | Notes |
total | Integer | Mandatory | Total number of the messages in the request |
success | Integer | Mandatory | Number of messages successfully accepted |
failed | Integer | Mandatory | Number of messages that couldn’t be accepted (failed) |
Parameter | Type | Mandatory/Optional | Notes |
Channel Response Object | Mandatory | Response for Whatsapp messages specified in the request |
Parameter | Type | Mandatory/Optional | Notes |
messages | []Create Message Response Object | Mandatory | Array of messages response for each message |
Parameter | Type | Mandatory/Optional | Notes |
code | Integer | Mandatory | Response code for the individual message |
error_data | Error Response Object | Optional | Error related to a single message |
status | String | Mandatory | Status of the single message |
data | Message Response Object | Optional | Data pertaining to a single message |
Parameter | Type | Mandatory/Optional | Notes |
code | Numeric | Mandatory | Numeric HTTP code for a Single message |
message | String | Mandatory | Brief description of the error |
description | String | Mandatory | Detailed explanation of error |
Parameter | Type | Mandatory/Optional | Notes |
sid | String | Mandatory | SID (Unique identifier) of the single message |
HTTP Error Codes | Error Message |
202 | Accepted - Request accepted. |
400 | Bad Request - Something in your header or request body was malformed/missing.More than 100 messages specified in a request |
401 | Unauthorized - Necessary credentials were either missing or invalid. |
402 | Payment Required - The action is not available on your plan, or you have exceeded usage limits for your current plan. |
403 | Your credentials are valid, but you don’t have access to the requested resource. |
404 | Not Found - The object you’re requesting doesn’t exist. |
5xx | Server Errors - Something went wrong at our end. Please try again. |
Status callback URL can be passed in the status_callback parameter in send message APIs and it can also be configured as default to receive the responses. The Exotel team will help you configure the default URL while onboarding.
*NOTE: Any callback can be received only in one status callback URL at any time.
The sent message with the Order Details message will have a different Status Callback when the user completes the payment.
{ "params": { "whatsapp": { "messages": [ { "callback_type": "dlr", "sid": "e96ec08a641612cXXXXXXXX", "to": "+9186XXXXXXXX", "exo_status_code": 30002, "exo_detailed_status": "EX_MESSAGE_DELIVERED", "description": "Message Delivered", "timestamp": "2024-05-21T12:48:26+05:30", "payment_reference_id": "1033XX", "conversation_id": "675625c2XXXXXXX" } ] } }
{ "whatsapp": { "messages": [ { "callback_type": "dlr", "sid": "659f8XXXXXXXX", "from": "+9180XXXXXXXX", "to": "+9194XXXXXXXX", "exo_status_code": 30050, "exo_detailed_status": "EX_PAYMENT_SUCCESS", "description": "Payment Succeeded", "timestamp": "2024-08-06T14:59:10+05:30", "payment_reference_id": "ka90XXXXXX", "payment_transaction_id": "order_OhXXXXXX", "payment": { "reference_id": "ka90XXXXXX", "currency": "INR", "amount": { "value": 100, "offset": 100 }, "transaction": { "id": "order_OhXXXXXX", "type": "razorpay", "status": "success", "created_timestamp": 1722936549, "updated_timestamp": 1722936549, "amount": { "value": 100, "offset": 100 }, "currency": "INR" } } } ] } }
{ "whatsapp": { "messages": [ { "callback_type": "dlr", "sid": "4ad65c8751815192820af097e0501886", "from": "+9180XXXXXXXX", "to": "+9194XXXXXXXX", "exo_status_code": 30049, "exo_detailed_status": "EX_PAYMENT_PENDING", "description": "Payment is pending", "timestamp": "2024-08-06T16:54:26+05:30", "payment_reference_id": "ka90XXXXXX", "payment_transaction_id": "order_OaXXXXXX", "payment": { "reference_id": "ka90XXXXXX", "currency": "INR", "amount": { "value": 100, "offset": 100 }, "transaction": { "id": "order_OaXXXXXX", "type": "razorpay", "status": "failed", "created_timestamp": 1722943465, "updated_timestamp": 1722943465, "amount": { "value": 100, "offset": 100 }, "currency": "INR" } } } ] } }
You can now send the Payment Order Status message to the end-users after the payment success or failure to update the status of the order purchase using our Exotel APIs.
https://<your_api_key>:<your_api_token><subdomain>/v2/accounts/<your_sid>/messages
Upon receiving transaction signals from the payment gateway through webhook, the business must update the order status to keep the user up to date. Currently, we support the following order status values:
Value | Description |
pending | User has not successfully paid yet |
processing | User payment authorized, merchant/partner is fulfilling the order, performing service, etc. |
partially-shipped | A portion of the products in the order have been shipped by the merchant |
shipped | All the products in the order have been shipped by the merchant |
completed | The order is completed and no further action is expected from the user or the partner/merchant |
canceled | The partner/merchant would like to cancel the order_details message for the order/invoice. The status update will fail if there is already a successful or pending payment for this order_details message |
Typically businesses update the order_status using either the WhatsApp payment status change notifications or their own internal processes. To update order_status, the partner sends an order_status message to the user.
curl --location --globoff 'https://{{AuthKey}}:{{AuthToken}}@{{SubDomain}}/v2/accounts/{{AccountSid}}/messages' \ --header 'Content-Type: application/json' \ --data '{ "custom_data": "ORDXXXXXX", "status_callback": "https://webhook.site", "whatsapp": { "messages": [ { "from": "{{FromNumber}}", "to": "{{ToNumber}}", "content": { "type": "interactive", "interactive": { "type": "order_status", "body": { "text": "your-text-body-content" }, "action": { "name": "review_order", "parameters": { "reference_id": "reference-id-value", "order": { "status":"processing | partially_shipped | shipped | completed | canceled", "description": "optional-text" } } } } } } ] } }'
import requests import json url = "https://{{AuthKey}}:{{AuthToken}}@{{SubDomain}}/v2/accounts/{{AccountSid}}/messages" payload = json.dumps({ "custom_data": "ORDER12356894", "status_callback": "https://eoj72flq0lwx2gs.m.pipedream.net/", "whatsapp": { "messages": [ { "from": "{{FromNumber}}", "to": "{{ToNumber}}", "content": { "type": "interactive", "interactive": { "type": "order_status", "body": { "text": "your-text-body-content" }, "action": { "name": "review_order", "parameters": { "reference_id": "reference-id-value", "order": { "status": "processing | partially_shipped | shipped | completed | canceled", "description": "optional-text" } } } } } } ] } }) headers = { 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text)
Please understand that this feature is currently in Beta and it’s important to note that certain capabilities, such as Reports and Analytics are not yet available on the dashboard. We will be working on this and is part of our next phase launch.
You can now send a Message with a Flow in a user-initiated conversation as a free-form message with a Call To Action (CTA) using the Exotel APIs.
Before you start sending the Message with a Flow button, you need to create and publish the Flow JSON. Follow the below steps:
Note: Currently, the creation of templates with flows via API or on the Exotel dashboard is not supported. We plan to enable this feature soon. Until then, create the JSON Flows using the WhatsApp Manager on the Meta dashboard.
To send messages to a single number with configured Flow button content via Exotel API, make an HTTP POST request to:
https://<your_api_key>:<your_api_token><subdomain>/v2/accounts/<your_sid>/messages
<your_api_key>
and <your_api_token>
with the API key and token created by you.<your_sid>
with your “Account sid".<subdomain>
with the region of your account
<your_api_key>
, <your_api_token>
and <your_sid>
are available in the API settings page of your Exotel Dashboard
The following are the POST parameters -
Parameter Name |
Parameter Type |
Mandatory/Optional |
Value |
custom_data |
String |
Optional |
This parameter can be used to send any custom data at the API request level. This will be passed back in the callback. |
status_callback |
String (URL) |
Optional |
Once the message reaches terminal state, Exotel will do a POST callback to your end point if the URL is set as a parameter in the API. |
|
Channel Object |
Optional |
Information related to the messages to be sent out on whatsapp. |
* The Whatsapp parameter mentioned here will be used to send messages through the Whatsapp communication channel. In future, the API will be extended further to support other communication channels like SMS. Later, the SMS parameter can also be passed to send SMSes.
Parameter Name |
Parameter Type |
Mandatory/Optional |
Value |
custom_data |
String |
Optional |
This parameter can be used to send any custom data at the API request level. This will be passed back in the callback. |
status_callback |
String (URL) |
Optional |
Once the message reaches the terminal state, Exotel will do a POST callback to your endpoint if the URL is set as a parameter in the API. |
messages |
[]Message Object |
Mandatory |
An array of messages to be sent out |
Parameter Name |
Parameter Type |
Mandatory/Optional |
Value |
custom_data |
String |
Optional |
This parameter can be used to send any custom data at the API request level. This will be passed back in the callback. |
status_callback |
String (URL) |
Optional |
Once the message reaches the terminal state, Exotel will do a POST callback to your endpoint if the URL is set as a parameter in the API. |
from |
String |
Mandatory |
From number from which the message has to be sent |
to |
String |
Mandatory |
Phone number of the user to whom a message needs to be sent. The number must be in e.164 format. Here are some examples of supported phone number formats: "+10000000000" "+919888888888" "+919876543210" |
content |
Whatsapp Message Object |
Mandatory |
Whatsapp message body |
This will be similar to Whatsapp Native API contracts [Refer Here]:
Parameter Name |
Parameter Type |
Mandatory/ Optional |
Value |
recepient_type |
String |
Mandatory |
Recipient type of the user to whom the message is being sent. Currently, you can only send messages to individuals. Set this as an individual. Default: individual |
type |
String |
Mandatory |
Type of the message. Type can be - Text, Image, Audio, Video, Document, Sticker, Location, Contact Interactive - This is for List Messages, Reply Buttons, Flows |
text |
Text Object |
Mandatory/Optional |
Mandatory when type is text. To send a text message attach a WhatsappMessageObject with type = text and then add a text object |
image |
Image Object |
Mandatory/Optional |
Mandatory when the type is an image. To send an image attach a WhatsappMessageObject with type = image and then add an image object |
audio |
Audio Object |
Mandatory/Optional |
Mandatory when the type is audio. To send audio attach a WhatsappMessageObject with type = audio and then add an audio object |
video |
Video Object |
Mandatory/Optional |
Mandatory when type is video. To send a video attach a WhatsappMessageObject with type = video and then add a video object |
document |
Document Object |
Mandatory/Optional |
Mandatory when type is a document. To send a sticker attach a WhatsappMessageObject with type = document and then add a document object |
sticker |
Sticker Object |
Mandatory/Optional |
Mandatory when the type is a sticker. To send a sticker attach a WhatsappMessageObject with type = sticker and then add a sticker object. The type of file should be image/webp. |
location |
Location Object |
Mandatory/Optional |
Mandatory when type is location. To send a location message attach a WhatsappMessageObject with type = location and then add a location object |
contacts |
Contact Object |
Mandatory/Optional |
Mandatory when type is contacts. To send a contact message attach a WhatsappMessageObject with type = contact and then add a contacts object |
interactive |
Interactive Object |
Mandatory/Optional |
Mandatory when type is interactive. To send interactive messages attach a WhatsappMessageObject with type = interactive and then add an interactive object. The components of each interactive object generally follow a consistent pattern: header, body, footer, and action. |
Parameter Name |
Parameter Type |
Mandatory/Optional |
Value |
body |
String |
Mandatory |
The text of the text message can contain URLs that begin with http:// or https:// and formatting. If you include URLs in your text and want to include a preview box in text messages (preview_url: true), make sure the URL starts with http:// or https:// —https:// URLs are preferred. You must include a hostname since IP addresses will not be matched. Maximum length: 4096 characters. |
preview_url |
Boolean |
Optional |
Set preview_url as ‘Yes’ only if the body includes a URL that begins with https:// or http:// and you want to preview the URL Set preview_url as ‘No’ if you do not want to preview the URL |
Parameter Name |
Parameter Type |
Mandatory/Optional |
Value |
link |
String |
Mandatory |
Link of the image to be sent. Use only with HTTP/HTTPS URLs. |
caption |
String |
Optional |
Caption for the image. Describes the specified image. |
Parameter Name |
Parameter Type |
Mandatory/Optional |
Value |
link |
String |
Mandatory |
Link of the audio to be sent. Use only with HTTP/HTTPS URLs. |
Parameter Name |
Parameter Type |
Mandatory/Optional |
Value |
link |
String |
Mandatory |
Link of the video to be sent. Use only with HTTP/HTTPS URLs. |
caption |
String |
Optional |
Caption for the video. Describes the specified video media. |
Parameter Name |
Parameter Type |
Mandatory/Optional |
Value |
link |
String |
Mandatory |
Link of the document to be sent. Use only with HTTP/HTTPS URLs. |
caption |
String |
Optional |
Caption for the document. Describes the specified document media. |
filename |
String |
Optional |
Describes the filename for the specific document. Use only document media. The extension of the filename will specify what format the document is displayed in WhatsApp. |
Parameter Name |
Parameter Type |
Mandatory/Optional |
Value |
type |
String |
Optional |
The type of interactive message you want to send. Set this to:
|
header |
Header Object |
Optional |
Header content displayed on top of a message. |
body |
Body Object |
Mandatory/Optional |
Optional for type product. Required for other message types. |
footer |
Footer Object |
Optional |
Footer of the interactive message |
action |
Action Object |
Optional |
Action you want the user to perform after reading the message. |
Parameter Name |
Parameter Type |
Mandatory/Optional |
Value |
type |
String |
Mandatory |
The header type you would like to use. Supported values:
|
text |
String |
Mandatory/Optional |
Required if header type is set to text. Text for the header. Formatting allows emojis, but not markdown. Maximum length: 60 characters. |
image |
Image Object |
Mandatory/Optional |
Required if header type is set to image. |
video |
Video Object |
Mandatory/Optional |
Required if header type is set to video. |
document |
Document Object |
Mandatory/Optional |
Required if header type is set to document. |
Parameter Name |
Parameter Type |
Mandatory/Optional |
Value |
text |
String |
Mandatory |
Required if body is present. The content of the message. Emojis and markdown are supported. Maximum length: 1024 characters. |
Parameter Name |
Parameter Type |
Mandatory/Optional |
Value |
text |
String |
Mandatory |
Required if the footer is present. The footer content. Emojis, markdowns, and links are supported. Maximum length: 60 characters. |
Parameter Name |
Parameter Type |
Mandatory/Optional |
Value |
name | String | Mandatory | Value must be "flow". |
mode | String | Mandatory | The Flow can be in either draft or published mode. (Default value: published) |
flow_message_version | String | Mandatory | Value must be "3". |
flow_token | String | Mandatory | Flow token that is generated by the business to serve as an identifier. You can get this from the Meta Dashboard for the JSON Flow by clicking on the "Manage" button on the right hand side. |
flow_id | String | Mandatory |
Unique ID of the Flow provided by WhatsApp on the Meta Dashboard under the Flows section.
|
flow_cta | String | Mandatory | Text on the CTA button. For example: "Signup" Character limit - 20 characters (no emoji). |
flow_action | String | Mandatory | navigate or data_exchange (Default value: navigate) |
flow_action_payload | String | Mandatory | Required if flow_action is navigate. Should be omitted otherwise. |
screen | String | Mandatory | The ID of the first Screen. You can get the Screen Name from the Meta Dashboard for the right-hand side preview page. |
data | Object | Optional | Optional input data for the first Screen of the Flow. If provided, this must be a non-empty object. |
Please refer to Exotel's sample Postman collection to try out the APIs, we have also shared some examples here for your reference.
curl --location 'https://0677f84029ded8bae022bc115c1c4e05dc75360595feb7dc:8e0342b396bc14a2881c9abb1e686ad91373b8dd5835fe74@api.exotel.com/v2/accounts/Exotel/messages' \ --header 'Content-Type: application/json' \ --data '{ "custom_data": "ORDXXXXXXX", "status_callback": "https://webhook.site", "whatsapp": { "messages": [ { "from": "91804XXXXXX", "to": "{{ToNumber}}", "content": { "type": "interactive", "interactive": { "type": "flow", "header": { "type": "text", "text": "Flow message header" }, "body": { "text": "Flow message body" }, "footer": { "text": "Flow message footer" }, "action": { "name": "flow", "parameters": { "flow_message_version": "3", "flow_id": "1323XXXXXXXXX", "flow_token": "flows-builder-97XXXXX", "flow_cta": "Click Here", "flow_action": "navigate", "flow_action_payload": { "screen": "screen_name", "data": { "product_name": "test", "product_description": "test", "product_price": 1 } } } } } } } ] } }'
import requests
import json
url = “https://{{AuthKey}}:{{AuthToken}}@{{SubDomain}}/v2/accounts/{{AccountSid}}/messages”
payload = json.dumps({
“custom_data”: “ORDXXXXXXX”,
“status_callback”: “https://webhook.site”,
“whatsapp”: {
“messages”: [
{
“from”: “{{FromNumber}}”,
“to”: “{{ToNumber}}”,
“content”: {
“type”: “interactive”,
“interactive”: {
“type”: “flow”,
“header”: {
“type”: “text”,
“text”: “Flow message header”
},
“body”: {
“text”: “Flow message body”
},
“footer”: {
“text”: “Flow message footer”
},
“action”: {
“name”: “flow”,
“parameters”: {
“flow_message_version”: “3”,
“flow_id”: “1323XXXXXXXXX”,
“flow_token”: “flows-builder-97XXXXX”,
“flow_cta”: “Click Here”,
“flow_action”: “navigate”,
“flow_action_payload”: {
“screen”: “screen_name”,
“data”: {
“product_name”: “test”,
“product_description”: “test”,
“product_price”: 1
}
}
}
}
}
}
}
]
}
})
headers = {
‘Content-Type’: ‘application/json’
}
response = requests.request(“POST”, url, headers=headers, data=payload)
print(response.text)
HTTP Response:
{ "request_id": "b434e927a5844175b23059cd96feea3d", "method": "POST", "http_code": 202, "metadata": { "failed": 0, "total": 1, "success": 1 }, "response": { "whatsapp": { "messages": [ { "code": 202, "error_data": null, "status": "success", "data": { "sid": "2FdiXXXXXXXXXXXXXXXXX", } } ] } } }
The following are the response parameters -
Parameter |
Type |
Mandatory/Optional |
Notes |
request_id |
String |
Mandatory |
This indicates the unique id of the request. Useful for debugging and tracing purposes. |
method |
String |
Mandatory |
This indicates the HTTP method for the request such as POST |
http_code |
Integer |
Mandatory |
This indicates the HTTP code for the request such as 202, 400, 500 etc. |
metadata |
Metadata Object |
Mandatory |
Metadata pertaining to the request. Count of failed, total and success records. |
response |
Response Object |
Mandatory |
Response for the request |
Parameter |
Type |
Mandatory/Optional |
Notes |
total |
Integer |
Mandatory |
Total number of the messages in the request |
success |
Integer |
Mandatory |
Number of messages successfully accepted |
failed |
Integer |
Mandatory |
Number of messages that couldn’t be accepted (failed) |
Parameter |
Type |
Mandatory/Optional |
Notes |
|
Channel Response Object |
Mandatory |
Response for Whatsapp messages specified in the request |
Parameter |
Type |
Mandatory/Optional |
Notes |
messages |
[]Create Message Response Object |
Mandatory |
Array of messages response for each message |
Parameter |
Type |
Mandatory/Optional |
Notes |
code |
Integer |
Mandatory |
Response code for the individual message |
error_data |
Error Response Object |
Optional |
Error related to a single message |
status |
String |
Mandatory |
Status of the single message |
data |
Message Response Object |
Optional |
Data pertaining to a single message |
Parameter |
Type |
Mandatory/Optional |
Notes |
code |
Numeric |
Mandatory |
Numeric HTTP code for a Single message |
message |
String |
Mandatory |
Brief description of the error |
description |
String |
Mandatory |
Detailed explanation of error |
Parameter |
Type |
Mandatory/Optional |
Notes |
sid |
String |
Mandatory |
SID (Unique identifier) of the single message |
HTTP Error Codes |
Error Message |
202 |
Accepted - Request accepted. |
400 |
Bad Request - Something in your header or request body was malformed/missing. More than 100 messages specified in a request |
401 |
Unauthorized - Necessary credentials were either missing or invalid. |
402 |
Payment Required - The action is not available on your plan, or you have exceeded usage limits for your current plan. |
403 |
Your credentials are valid, but you don’t have access to the requested resource. |
404 |
Not Found - The object you’re requesting doesn’t exist. |
5xx |
Server Errors - Something went wrong at our end. Please try again. |
Status callback URL can be passed in the status_callback parameter in send message APIs and it can also be configured as default to receive the responses. The Exotel team will help you configure the default URL while onboarding.
*NOTE: Any callback can be received only in one status callback URL at any time.
What is different for Flow Template?
"whatsapp": { "messages": [ { "callback_type": "dlr", "sid": "1234", "to": "23XXXXXXX", "exo_status_code": 25001, "exo_detailed_status": "EX_MESSAGE_DELIVERED", "description": "Message delivered", "timestamp": "2022-12-07T17:00:00.000+05:30", "custom_data": "custom" } ] } }
This API can send messages to a single number with a message content or different numbers with different message contents for each number. To send message through Exotel API, you will need to make a HTTP POST request to
https://<your_api_key>:<your_api_token><subdomain>/v2/accounts/<your_sid>/messages
<your_api_key>
and <your_api_token>
with the API key and token created by you.<your_sid>
with your “Account sid".<subdomain>
with the region of your account
<your_api_key>
, <your_api_token>
and <your_sid>
are available in the API settings page of your Exotel Dashboard
The following are the POST parameters -
Parameter Name |
Parameter Type |
Mandatory/Optional |
Value |
custom_data |
String |
Optional |
This parameter can be used to send any custom data at the API request level. This will be passed back in the callback. |
status_callback |
String (URL) |
Optional |
Once the message reaches terminal state, Exotel will do a POST callback to your end point if the URL is set as a parameter in the API. |
|
Channel Object |
Optional |
Information related to the messages to be sent out on whatsapp. |
* The Whatsapp parameter mentioned here will be used to send messages through Whatsapp communication channel. In future the API will be extended further to support other communication channels like SMS. Later, SMS parameter can also be passed to send SMSes.
Parameter Name |
Parameter Type |
Mandatory/Optional |
Value |
custom_data |
String |
Optional |
This parameter can be used to send any custom data at the API request level. This will be passed back in the callback. |
status_callback |
String (URL) |
Optional |
Once the message reaches terminal state, Exotel will do a POST callback to your end point if the URL is set as a parameter in the API. |
messages |
[]Message Object |
Mandatory |
Array of messages to be sent out |
Parameter Name |
Parameter Type |
Mandatory/Optional |
Value |
custom_data |
String |
Optional |
This parameter can be used to send any custom data at the API request level. This will be passed back in the callback. |
status_callback |
String (URL) |
Optional |
Once the message reaches terminal state, Exotel will do a POST callback to your end point if the URL is set as a parameter in the API. |
from |
String |
Mandatory |
From number from which the message has to be sent |
to |
String |
Mandatory |
Phone number of the user to whom a message needs to be sent. The number must be in e.164 format. Here are some examples of supported phone number formats: "+10000000000" "+919888888888" "+919876543210" |
content |
Whatsapp Message Object |
Mandatory |
Whatsapp message body |
This will be similar to Whatsapp Native API contracts [Refer Here]:
Parameter Name |
Parameter Type |
Mandatory/Optional |
Value |
template |
Template Object |
Mandatory/Optional |
Mandatory when type is template |
Parameter |
Type |
Mandatory/Optional |
Notes |
namespace |
String |
Mandatory |
Namespace of the template |
name |
String |
Mandatory |
Name of the template |
language |
Language Object |
Mandatory |
Specifies the language the template may be rendered in. |
components |
[]Component Object |
Mandatory |
Components of the template, containing the parameters of the message. |
Parameter |
Type |
Mandatory/Optional |
Notes |
policy |
String |
Mandatory |
The language policy the message should follow. The only supported option is deterministic. |
code |
String |
Mandatory |
The code of the language or locale to use. Accepts both language and language_locale formats (e.g., en and en_US). |
Parameter |
Type |
Mandatory/Optional |
Notes |
type |
String |
Mandatory |
Type of the component. Supported types are -
Header Body Button For text-based templates, we only support the type=body. |
text |
String |
Optional |
Text for the component |
sub_type |
String |
Mandatory/Optional |
Required when type=button. Not used for the other types. Type of button to create. quick_reply: Refers to a previously created quick reply button that allows for the customer to return a predefined message. url: Refers to a previously created button that allows the customer to visit the URL generated by appending the text parameter to the predefined prefix URL in the template. |
index |
String |
Mandatory/Optional |
Required when type=button. Not used for the other types. Position index of the button. You can have up to 3 buttons using index values of 0 to 2. |
footer |
String |
Optional |
Footer of the component |
parameters |
[]Parameter Object |
Mandatory/Optional |
Required when type=button. Array of parameter objects with the content of the message. |
Parameter |
Type |
Mandatory/Optional |
Notes |
type |
String |
Mandatory |
Type of the parameter. Describes the parameter type. Supported values: currency date_time document image text video For text-based templates, the only supported parameter types are currency, date_time, and text. |
text |
String |
Mandatory/Optional |
Required when type=text. The message’s text. Character limit varies based on the following included component type. For the header component type: 60 characters For the body component type: 1024 characters if other component types are included 32768 characters if body is the only component type included |
image |
Image Object |
Mandatory/Optional |
Required when type =image |
video |
Video Object |
Mandatory/Optional |
Required when type =video |
document |
Document Object |
Mandatory/Optional |
Required when type = document. Only PDF documents are supported for media-based message templates. Captions not supported when used in a media template. |
date_time |
DateTime Object |
Mandatory/Optional |
Required when type = date_time |
currency |
Currency Object |
Mandatory/Optional |
Required when type = currency |
Parameter Name |
Parameter Type |
Mandatory/Optional |
Value |
link |
String |
Mandatory |
Link of the image to be sent.Use only with HTTP/HTTPS URLs. |
caption |
String |
Optional |
Caption for the image. Describes the specified image. |
Parameter Name |
Parameter Type |
Mandatory/Optional |
Value |
link |
String |
Mandatory |
Link of the audio to be sent.Use only with HTTP/HTTPS URLs. |
Parameter Name |
Parameter Type |
Mandatory/Optional |
Value |
link |
String |
Mandatory |
Link of the video to be sent. Use only with HTTP/HTTPS URLs. |
caption |
String |
Optional |
Caption for the video. Describes the specified video media. |
Parameter Name |
Parameter Type |
Mandatory/Optional |
Value |
link |
String |
Mandatory |
Link of the document to be sent. Use only with HTTP/HTTPS URLs. |
caption |
String |
Optional |
Caption for the document. Describes the specified document media. |
filename |
String |
Optional |
Describes the filename for the specific document. Use only with document media. The extension of the filename will specify what format the document is displayed as in WhatsApp. |
Parameter |
Type |
Mandatory/Optional |
Notes |
fallback_value |
String |
Mandatory |
Default text. we always use the fallback value, and we do not attempt to localize using other optional fields. |
Parameter |
Type |
Mandatory/Optional |
Notes |
fallback_value |
String |
Mandatory |
Fallback value of currency. Default text if localization fails. |
code |
String |
Mandatory |
Currency Code. Currency code as defined in ISO 4217. |
amount_1000 |
Integer |
Mandatory |
Amount of currency. Amount multiplied by 1000. |
Please refer Exotel's sample postman collection to try out the APIs, we have also shared some examples here for your reference.
curl -XPOST "https://<api_key>:<api_token><subdomain>/v2/accounts/<your_sid>/messages" -d '{ "custom_data": "order12", "status_callback": "https://webhook.site", "whatsapp": { "messages": [ { "from": "9199XXXXXXXX", "to": "9199XXXXXXXX", "content": { "type": "template", "template": { "name": "candidate_feedback_message", "language": { "policy": "deterministic", "code": "en" }, "components": [ { "type": "body", "parameters": [ { "type": "text", "text": "Good!" } ] } ] } } } ] } }'
var https = require('follow-redirects').https; var fs = require('fs'); var qs = require('querystring'); var options = { 'method': 'POST', 'hostname': '<api_key>', 'port': <api_token><subdomain>, 'path': '/v2/accounts/<your_sid>/messages', 'headers': { 'Content-Type': 'application/x-www-form-urlencoded' }, 'maxRedirects': 20 }; var req = https.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function (chunk) { var body = Buffer.concat(chunks); console.log(body.toString()); }); res.on("error", function (error) { console.error(error); }); }); var postData = qs.stringify({ '{ "custom_data": "order12", "status_callback": "https://webhook.site", "whatsapp": { "messages": [ { "from": "9199XXXXXXXX", "to": "9199XXXXXXXX", "content": { "type": "template", "template": { "name": "candidate_feedback_message", "language": { "policy": "deterministic", "code": "en" }, "components": [ { "type": "body", "parameters": [ { "type": "text", "text": "Good!" } ] } ] } } } ] } }': '' }); req.write(postData); req.end();
<?php $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => 'https://%3Capi_key%3E:%3Capi_token%3E%3Csubdomain%3E/v2/accounts/%3Cyour_sid%3E/messages', CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_POSTFIELDS => '%7B%20%22custom_data%22%3A%20%22order12%22%2C%20%C2%A0%C2%A0%C2%A0%22status_callback%22%3A%20%22https%3A%2F%2Fwebhook.site%22%2C%20%C2%A0%C2%A0%C2%A0%22whatsapp%22%3A%20%7B%20%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%22messages%22%3A%20%5B%20%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%7B%20%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%22from%22%3A%20%229199XXXXXXXX%22%2C%20%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%22to%22%3A%20%229199XXXXXXXX%22%2C%20%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%22content%22%3A%20%7B%20%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%22type%22%3A%20%22template%22%2C%20%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%22template%22%3A%20%7B%20%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A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%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%7D%20%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%7D%20%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%5D%20%C2%A0%C2%A0%C2%A0%7D%20%C2%A0%C2%A0%C2%A0%7D=', CURLOPT_HTTPHEADER => array( 'Content-Type: application/x-www-form-urlencoded' ), )); $response = curl_exec($curl); curl_close($curl); echo $response;
import requests url = "https://<api_key>:<api_token><subdomain>/v2/accounts/<your_sid>/messages" payload='%7B%20%22custom_data%22%3A%20%22order12%22%2C%20%C2%A0%C2%A0%C2%A0%22status_callback%22%3A%20%22https%3A%2F%2Fwebhook.site%22%2C%20%C2%A0%C2%A0%C2%A0%22whatsapp%22%3A%20%7B%20%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%22messages%22%3A%20%5B%20%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%7B%20%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%22from%22%3A%20%229199XXXXXXXX%22%2C%20%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%22to%22%3A%20%229199XXXXXXXX%22%2C%20%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%22content%22%3A%20%7B%20%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0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%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%5D%20%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%7D%20%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%7D%20%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%7D%20%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%5D%20%C2%A0%C2%A0%C2%A0%7D%20%C2%A0%C2%A0%C2%A0%7D=' headers = { 'Content-Type': 'application/x-www-form-urlencoded' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text)
require "uri" require "net/http" require "uri" require "net/http" url = URI("https://<api_key>:<api_token><subdomain>/v2/accounts/<your_sid>/messages") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = "application/x-www-form-urlencoded" request.body = "%7B%20%22custom_data%22%3A%20%22order12%22%2C%20%C2%A0%C2%A0%C2%A0%22status_callback%22%3A%20%22https%3A%2F%2Fwebhook.site%22%2C%20%C2%A0%C2%A0%C2%A0%22whatsapp%22%3A%20%7B%20%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%22messages%22%3A%20%5B%20%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%7B%20%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%22from%22%3A%20%229199XXXXXXXX%22%2C%20%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%22to%22%3A%20%229199XXXXXXXX%22%2C%20%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%22content%22%3A%20%7B%20%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%22type%22%3A%20%22template%22%2C%20%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%22template%22%3A%20%7B%20%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%22name%22%3A%20%22candidate_feedback_message%22%2C%20%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%22language%22%3A%20%7B%20%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%22policy%22%3A%20%22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A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%5D%20%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%7D%20%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%5D%20%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%7D%20%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%7D%20%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%7D%20%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%5D%20%C2%A0%C2%A0%C2%A0%7D%20%C2%A0%C2%A0%C2%A0%7D=" response = https.request(request) puts response.read_body
curl -XPOST "https://<api_key>:<api_token><subdomain>/v2/accounts/<your_sid>/messages" -d '{ "custom_data": "ORDER12", "status_callback": "https://webhook.site", "whatsapp": { "messages": [ { "from": "9199XXXXXXXX", "to": "9199XXXXXXXX", "content": { "type": "template", "template": { "name": "image_1", "language": { "policy": "deterministic", "code": "en" }, "components": [ { "type": "header", "parameters": [ { "type": "image", "image": { "link": "https://image.jpg" } } ] }, { "type": "body", "parameters": [ { "type": "text", "text": "Name" } ] } ] } } } ] } }'
var https = require('follow-redirects').https; var fs = require('fs'); var qs = require('querystring'); var options = { 'method': 'POST', 'hostname': '<api_key>', 'port': <api_token><subdomain>, 'path': '/v2/accounts/<your_sid>/messages', 'headers': { 'Content-Type': 'application/x-www-form-urlencoded' }, 'maxRedirects': 20 }; var req = https.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function (chunk) { var body = Buffer.concat(chunks); console.log(body.toString()); }); res.on("error", function (error) { console.error(error); }); }); var postData = qs.stringify({ '{\n"custom_data": "ORDER12",\n "status_callback": "https://webhook.site",\n "whatsapp": {\n "messages": [\n {\n "from": "9199XXXXXXXX",\n "to": "9199XXXXXXXX",\n "content": {\n "type": "template",\n "template": {\n "name": "image_1",\n "language": {\n "policy": "deterministic",\n "code": "en"\n },\n "components": [\n {\n "type": "header",\n "parameters": [\n {\n "type": "image",\n "image": {\n "link": "https://image.jpg"\n }\n }\n ]\n },\n {\n "type": "body",\n "parameters": [\n {\n "type": "text",\n "text": "Name"\n }\n ]\n }\n ]\n }\n }\n }\n ]\n }\n }': '' }); req.write(postData); req.end();
<?php $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => 'https://%3Capi_key%3E:%3Capi_token%3E%3Csubdomain%3E/v2/accounts/%3Cyour_sid%3E/messages', CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_POSTFIELDS => '%7B%0A%22custom_data%22%3A%20%22ORDER12%22%2C%0A%20%20%20%22status_callback%22%3A%20%22https%3A%2F%2Fwebhook.site%22%2C%0A%20%20%20%22whatsapp%22%3A%20%7B%0A%20%20%20%20%20%20%20%22messages%22%3A%20%5B%0A%20%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22from%22%3A%20%229199XXXXXXXX%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22to%22%3A%20%229199XXXXXXXX%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22content%22%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22type%22%3A%20%22template%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22template%22%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22name%22%3A%20%22image_1%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22language%22%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22policy%22%3A%20%22deterministic%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22code%22%3A%20%22en%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22components%22%3A%20%5B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22type%22%3A%20%22header%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22parameters%22%3A%20%5B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22type%22%3A%20%22image%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22image%22%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22link%22%3A%20%22https%3A%2F%2Fimage.jpg%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22type%22%3A%20%22body%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22parameters%22%3A%20%5B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22type%22%3A%20%22text%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22text%22%3A%20%22Name%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%5D%0A%20%20%20%7D%0A%20%20%20%7D=', CURLOPT_HTTPHEADER => array( 'Content-Type: application/x-www-form-urlencoded' ), )); $response = curl_exec($curl); curl_close($curl); echo $response;
import requests url = "https://<api_key>:<api_token><subdomain>/v2/accounts/<your_sid>/messages" payload='%7B%0A%22custom_data%22%3A%20%22ORDER12%22%2C%0A%20%20%20%22status_callback%22%3A%20%22https%3A%2F%2Fwebhook.site%22%2C%0A%20%20%20%22whatsapp%22%3A%20%7B%0A%20%20%20%20%20%20%20%22messages%22%3A%20%5B%0A%20%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22from%22%3A%20%229199XXXXXXXX%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22to%22%3A%20%229199XXXXXXXX%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22content%22%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22type%22%3A%20%22template%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22template%22%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22name%22%3A%20%22image_1%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22language%22%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22policy%22%3A%20%22deterministic%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22code%22%3A%20%22en%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22components%22%3A%20%5B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22type%22%3A%20%22header%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22parameters%22%3A%20%5B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22type%22%3A%20%22image%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22image%22%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22link%22%3A%20%22https%3A%2F%2Fimage.jpg%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22type%22%3A%20%22body%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22parameters%22%3A%20%5B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22type%22%3A%20%22text%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22text%22%3A%20%22Name%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%5D%0A%20%20%20%7D%0A%20%20%20%7D=' headers = { 'Content-Type': 'application/x-www-form-urlencoded' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text)
require "uri" require "net/http" url = URI("https://<api_key>:<api_token><subdomain>/v2/accounts/<your_sid>/messages") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = "application/x-www-form-urlencoded" request.body = "%7B%0A%22custom_data%22%3A%20%22ORDER12%22%2C%0A%20%20%20%22status_callback%22%3A%20%22https%3A%2F%2Fwebhook.site%22%2C%0A%20%20%20%22whatsapp%22%3A%20%7B%0A%20%20%20%20%20%20%20%22messages%22%3A%20%5B%0A%20%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22from%22%3A%20%229199XXXXXXXX%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22to%22%3A%20%229199XXXXXXXX%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22content%22%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22type%22%3A%20%22template%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22template%22%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22name%22%3A%20%22image_1%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22language%22%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22policy%22%3A%20%22deterministic%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22code%22%3A%20%22en%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22components%22%3A%20%5B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22type%22%3A%20%22header%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22parameters%22%3A%20%5B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22type%22%3A%20%22image%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22image%22%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22link%22%3A%20%22https%3A%2F%2Fimage.jpg%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22type%22%3A%20%22body%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22parameters%22%3A%20%5B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22type%22%3A%20%22text%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22text%22%3A%20%22Name%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%5D%0A%20%20%20%7D%0A%20%20%20%7D=" response = https.request(request) puts response.read_body
Example Request
Example request to send a carousel template that uses a message bubble requiring values for two variables, and 2 carousel cards that each use an image header and require values for body text and button variables.
curl --location --globoff 'https://{{AuthKey}}:{{AuthToken}}@{{SubDomain}}/v2/accounts/{{AccountSid}}/messages' \ --header 'Content-Type: application/json' \ --data '{ "custom_data": "ORDER123456", "whatsapp": { "messages": [ { "from": "{{FromNumber}}", "to": "{{ToNumber}}", "content": { "type": "template", "template": { "name": "carousel_content", "language": { "code": "en" }, "components": [ { "type": "BODY", "parameters": [ { "type": "TEXT", "text": "20OFF" } ] }, { "type": "CAROUSEL", "cards": [ { "card_index": 0, "components": [ { "type": "HEADER", "parameters": [ { "type": "IMAGE", "image": { "link": "https://mir-s3-cdn-cf.behance.net/project_modules/fs/95a42970048085.5b968d022db76.jpg" } } ] }, { "type": "BODY", "parameters": [ { "type": "TEXT", "text": "10OFF" } ] }, { "type": "BUTTON", "sub_type": "QUICK_REPLY", "index": "0", "parameters": [ { "type": "PAYLOAD", "payload": "59NqSd" } ] }, { "type": "button", "sub_type": "URL", "index": "1", "parameters": [ { "type": "payload", "payload": "last_chance_2023" } ] } ] }, { "card_index": 1, "components": [ { "type": "HEADER", "parameters": [ { "type": "IMAGE", "image": { "link": "https://images.immediate.co.uk/production/volatile/sites/30/2020/01/retro-cocktails-b12b00d.jpg" } } ] }, { "type": "BODY", "parameters": [ { "type": "TEXT", "text": "30OFF" } ] }, { "type": "BUTTON", "sub_type": "QUICK_REPLY", "index": "0", "parameters": [ { "type": "PAYLOAD", "payload": "7C4xhY" } ] }, { "type": "BUTTON", "sub_type": "URL", "index": "1", "parameters": [ { "type": "payload", "payload": "summer_blues_2023" } ] } ] } ] } ] } } } ] } }'
Example request to send a limited-time offer template that uses:
curl --location 'https://{{AuthKey}}:{{AuthToken}}@{{SubDomain}}/v2/accounts/{{AccountSid}}/messages' \ --header 'Content-Type: application/json' \ --data '{ "custom_data": "ORDER123456", "status_callback": "https://webhook.site/XXXX-61e6-4873-XXXX", "whatsapp": { "messages": [ { "from": "+918047109880", "to": "919878434250", "content": { "type": "template", "template": { "name": "lto_parleagro", "language": { "code": "en" }, "components": [ { "type": "header", "parameters": [ { "type": "image", "image": { "link": "https://www.parleproducts.com/Uploads/image/1CategoryImg_biscuits-cookie.png" } } ] }, { "type": "body", "parameters": [ { "type": "text", "text": "Kaustubh" } ] }, { "type": "limited_time_offer", "parameters": [ { "type": "limited_time_offer", "limited_time_offer": { "expiration_time_ms": 1716261112000 } } ] }, { "type": "button", "sub_type": "copy_code", "index": "0", "parameters": [ { "type": "coupon_code", "coupon_code": "PARLE25" } ] }, { "type": "button", "sub_type": "url", "index": "1", "parameters": [ { "type": "text", "text": "biscuits" } ] } ] } } } ] } } '
What is an Authentication Templates?
It allows businesses to send OTP or Delivery code messages to authenticate users through one-time passcodes, typically digit alphanumeric codes without users initiating the conversation over WhatsApp. This is launched as a Template message under the category of Authentication.
Please make sure your Authentication Template is created on the correct WABA ID before sending the template message.
Components
This document explains how to send approved authentication templates with one-time password buttons.
Body Properties
Placeholder |
Description |
Sample Value |
ToNumber |
The customer's WhatsApp phone number. |
12015553931 |
one-time-password code |
The one-time password or verification code is to be delivered to the customer. Note that this value must appear twice in the payload, one in the button. |
12345 or FpnYnP |
template language code |
The template's language and locale code. |
en_US |
template name |
The unique template's name. |
verification_code |
curl --location --globoff 'https://{{AuthKey}}:{{AuthToken}}@{{SubDomain}}/v2/accounts/{{AccountSid}}/messages' \ --header 'Content-Type: application/json' \ --data '{ "custom_data": "OrderXXXXX", "status_callback": "status_callback_url", "whatsapp": { "messages": [ { "from": "{{FromNumber}}", "to": "{{ToNumber}}", "content": { "type": "template", "template": { "name": "authentication_template_name", "language": { "code": "en" }, "components": [ { "type": "body", "parameters": [ { "type": "text", "text": "" } ] }, { "type": "button", "sub_type": "url", "index": "0", "parameters": [ { "type": "text", "text": "" } ] } ] } } } ] } }'
HTTP Response:
{ "request_id": "b434e927a5844175b23059cd96feea3d", "method": "POST", "http_code": 202, "metadata": { "failed": 0, "total": 1, "success": 1 }, "response": { "whatsapp": { "messages": [ { "code": 202, "error_data": null, "status": "success", "data": { "sid": "2FdiiEQUosckPhpZfuVwfjxiSlc16a4", } } ] } } }
The following are the response parameters -
Parameter |
Type |
Mandatory/Optional |
Notes |
request_id |
String |
Mandatory |
This indicates the unique id of the request. Useful for debugging and tracing purposes. |
method |
String |
Mandatory |
This indicates the HTTP method for the request such as POST |
http_code |
Integer |
Mandatory |
This indicates the HTTP code for the request such as 202, 400, 500 etc. |
metadata |
Metadata Object |
Mandatory |
Metadata pertaining to the request. Count of failed, total and success records. |
response |
Response Object |
Mandatory |
Response for the request |
Parameter |
Type |
Mandatory/Optional |
Notes |
total |
Integer |
Mandatory |
Total number of the messages in the request |
success |
Integer |
Mandatory |
Number of messages successfully accepted |
failed |
Integer |
Mandatory |
Number of messages that couldn’t be accepted (failed) |
Parameter |
Type |
Mandatory/Optional |
Notes |
|
Channel Response Object |
Mandatory |
Response for Whatsapp messages specified in the request |
Parameter |
Type |
Mandatory/Optional |
Notes |
messages |
[]Create Message Response Object |
Mandatory |
Array of messages response for each message |
Parameter |
Type |
Mandatory/Optional |
Notes |
code |
Integer |
Mandatory |
Response code for the individual message |
error_data |
ErrorResponseObject |
Optional |
Error related to a single message |
status |
String |
Mandatory |
Status of the single message |
data |
Message Response Object |
Optional |
Data pertaining to a single message |
Parameter |
Type |
Mandatory/Optional |
Notes |
code |
Numeric |
Mandatory |
Numeric HTTP code for a Single message |
message |
String |
Mandatory |
Brief description of the error |
description |
String |
Mandatory |
Detailed explanation of error |
Parameter |
Type |
Mandatory/Optional |
Notes |
sid |
String |
Mandatory |
SID (Unique identifier) of the single message |
HTTP Error Codes |
Error Message |
202 |
Accepted - Request accepted. |
400 |
Bad Request - Something in your header or request body was malformed/missing. More than 100 messages specified in a request |
401 |
Unauthorized - Necessary credentials were either missing or invalid. |
402 |
Payment Required - The action is not available on your plan, or you have exceeded usage limits for your current plan. |
403 |
Your credentials are valid, but you don’t have access to the requested resource. |
404 |
Not Found - The object you’re requesting doesn’t exist. |
5xx |
Server Errors - Something went wrong at our end. Please try again. |
Status callback URL can be passed in status_callback parameter in send message/template message APIs and it can also be configured as default to receive the responses. Exotel team will help you configure the default URL while onboarding.
*NOTE: Any callback can be received only in one status callback URL at any time
"whatsapp": { "messages": [ { "callback_type": "dlr", "sid": "1234", "to": "2365564965", "exo_status_code": 25001, "exo_detailed_status": "EX_MESSAGE_DELIVERED", "description": "Message delivered", "timestamp": "2022-12-07T17:00:00.000+05:30", "custom_data": "custom" } ] } }
The following are the status callback parameters -
Parameter |
Type |
Mandatory |
Notes |
|
Message DLR Object |
Optional |
Delivery report (DLR) of the Whatsapp channel |
Parameter |
Type |
Mandatory |
Notes |
messages |
[]Whatsapp Message DLR Object |
Mandatory |
Information relating to the messages for DLR |
Parameter |
Type |
Mandatory |
Notes |
callback_type |
String |
Mandatory |
Type of the callback. Possible values: dlr, icm |
sid |
String |
Mandatory |
SID (Unique Identifier) of the message |
to |
String |
Mandatory |
Phone Number of the user to whom the message was sent. |
exo_status_code |
Integer |
Mandatory |
ExoStatusCode for the message |
exo_detailed_status |
String |
Mandatory |
Detailed status of ExoStatus code |
description |
String |
Mandatory |
Description of the ExoStatus code |
timestamp |
String |
Mandatory |
Timestamp at which the event occurred |
custom_data |
String |
Optional |
It will return the custom data, if the same was passed in the API request |
Detailed Status Code |
Detailed Status |
Description |
30001 |
EX_MESSAGE_SENT |
The message has been sent to the user |
30002 |
EX_MESSAGE_DELIVERED |
The message has been successfully delivered to the user |
30003 |
EX_MESSAGE_SEEN |
The message has been seen by the user |
30004 |
EX_SYSTEM_ERROR |
The message failed due to an issue with the system. For eg: Authentication/Access Token/Permission related issue, service not available issue etc. |
30005 |
EX_NUMBER_ERROR |
The message failed due to an issue with the phone number |
30006 |
EX_SETUP_ERROR |
The message failed due to set-up error |
30007 |
EX_RATE_LIMIT_HIT |
The message failed due to a breach in rate limit |
30008 |
EX_SPAM_RATE_LIMIT_HIT |
The message failed as spam rate limit has been breached |
30009 |
EX_TOO_MANY_REQUEST |
The message failed as too many request has been made in short span |
30010 |
EX_INVALID_REQUEST |
The message failed as the request is invalid |
30011 |
EX_UNKNOWN_ERROR |
The message failed due to an unknown error |
30012 |
EX_INVALID_RECIPIENT |
The message failed as the recipient was invalid |
30013 |
EX_INCAPABLE_RECIPIENT |
The message failed as the recipient is unable to receive the message |
30014 |
EX_RECIPIENT_BLOCKED |
The message failed as the recipient is not in allowed list |
30015 |
EX_UNSUPPORTED_MESSAGE |
The message failed as unsupported message type has been passed in the request body |
30016 |
EX_MEDIA_DOWNLOAD_ERROR |
The message failed as Whatsapp is unable to download the sender media |
30017 |
EX_MEDIA_UPLOAD_ERROR |
The message failed as unsupported media type has been passed in the request body |
30018 |
EX_REENGAGEMENT_ERROR |
The message failed as 24 hours window of the conversation is over |
30019 |
EX_INVALID_PARAM |
The message failed as invalid parameters has been passed in the request body |
30020 |
EX_MISSING_PARAM |
The message has failed as mandatory parameter is missing from the request body |
30021 |
EX_INVALID_PARAM_VALUE |
The message failed as invalid parameter value has been passed in the request body |
30022 |
EX_TEMPLATE_ERROR |
The message failed as the template format char policy has been violated |
30023 |
EX_TEMPLATE_PARAM_ERROR |
The message failed due to mismatch in count of template parameters |
30024 |
EX_TEMPLATE_NOT_FOUND |
The message failed as the passed message template does not exist |
30025 |
EX_TEMPLATE_TEXT_TOO_LONG |
The message failed as the translated text from template message is too long |
30026 |
EX_INVALID_TEMPLATE_NAMESPACE |
The message failed as invalid template namespace has been passed |
30027 |
EX_MESSAGE_PENDING_TOO_LONG |
The message failed as the message was pending for too long |
30028 |
EX_MESSAGE_EXPIRED |
The message failed as the message got expired |
30029 |
EX_MESSAGE_TOO_LONG |
The message failed as the number of characters in the message was more than 4096 characters |
30030 |
EX_WEBHOOK_ERROR |
Webhook is not configured |
30031 |
EX_SECTION_COUNT_ERROR |
The message failed due to invalid no. of sections |
30032 |
EX_ROWS_COUNT_ERROR |
The message failed due to invalid no. of rows |
30033 |
EX_PRODUCT_COUNT_ERROR |
The message failed due to invalid no. of product |
30034 |
EX_CATALOGUE_NOT_FOUND |
The message failed as the catalog ID has not been found |
30035 |
EX_CATALOGUE_NOT_LINKED |
The message failed as the catalog ID has not been linked to the API number |
30036 |
EX_MISSING_PRODUCT |
The message failed as the product is missing in the catalog |
30037 |
EX_PRODUCT_NOT_FOUND |
The message failed as all the products in the request body has not been found in the product catalog |
30038 |
EX_PRODUCT_COMPLIANCE_ERROR |
The message failed as the listed products failed compliance |
30039 |
EX_INVALID_HEADER |
The message failed due to invalid header structure |
30040 |
EX_MISSING_COMPLIANCE |
The message failed as compliance information was missing |
30041 |
EX_CHAR_POLICY_VIOLATION |
The message failed as character policy got violated |
30042 |
EX_MESSAGE_EXOTEL_EXPIRED |
The Exotel message expired because it was not delivered within its configured Time-To-Live (TTL) duration. |
Please understand that this feature is currently in Beta and it’s important to note that certain capabilities, such as Reports and Analytics are not yet available on the dashboard. We will be working on this and is part of our next phase launch.
Currently, the creation of Templates with Flow via API or the Template Management Exotel dashboard is not supported. We plan to enable this feature in the future. Until then, you need to create Templates with Flow button using the Meta dashboard on the WhatsApp Manager. (Other types of template creation are supported via API and Exotel Dashboard.)
You can now send the Template message with the Flow button using the Exotel APIs. To start sending the Template message with the Flow button, you need to follow the below steps:
To send messages to a single number with configured Template message content via Exotel API, make an HTTP POST request to:
https://<your_api_key>:<your_api_token><subdomain>/v2/accounts/<your_sid>/messages
<your_api_key>
and <your_api_token>
with the API key and token created by you.<your_sid>
with your “Account sid".<subdomain>
with the region of your account
<your_api_key>
, <your_api_token>
and <your_sid>
are available on the API settings page of your Exotel Dashboard
The following are the POST parameters -
Parameter Name |
Parameter Type |
Mandatory/ Optional |
Value |
custom_data |
String |
Optional |
This parameter can be used to send any custom data at the API request level. This will be passed back in the callback. |
status_callback |
String (URL) |
Optional |
Once the message reaches the terminal state, Exotel will do a POST callback to your endpoint if the URL is set as a parameter in the API. |
|
Channel Object |
Optional |
Information related to the messages to be sent out on WhatsApp. |
*The Whatsapp parameter mentioned here will be used to send messages through the Whatsapp communication channel. In the future, the API will be extended further to support other communication channels like SMS. Later, the SMS parameter can also be passed to send SMSes.
Parameter Name |
Parameter Type |
Mandatory/ Optional |
Value |
custom_data |
String |
Optional |
This parameter can be used to send any custom data at the API request level. This will be passed back in the callback. |
status_callback |
String (URL) |
Optional |
Once the message reaches the terminal state, Exotel will do a POST callback to your endpoint if the URL is set as a parameter in the API. |
from |
String |
Mandatory |
From number from which the message has to be sent |
to |
String |
Mandatory |
Phone number of the user to whom a message needs to be sent. The number must be in e.164 format. Here are some examples of supported phone number formats: "+10000000000" "+919888888888" "+919876543210" |
content |
Whatsapp Message Object |
Mandatory |
Whatsapp message body |
This will be similar to Whatsapp Native API contracts:
Parameter Name |
Parameter Type |
Mandatory/ Optional |
Value |
template |
Template Object |
Mandatory/ |
Mandatory when type is template |
Parameter |
Type |
Mandatory/ Optional |
Value |
namespace |
String |
Mandatory |
The namespace of the template |
name |
String |
Mandatory |
Name of the template |
language |
Language Object |
Mandatory |
Specifies the language the template may be rendered in. |
components |
[]Component Object |
Mandatory |
Components of the template, containing the parameters of the message. |
Parameter |
Type |
Mandatory/ Optional |
Value |
policy |
String |
Mandatory |
The language policy the message should follow. The only supported option is deterministic. |
code |
String |
Mandatory |
The code of the language or locale to use. Accepts both language and language_locale formats (e.g., en and en_US). |
Parameter |
Type |
Mandatory/ Optional |
Value |
type |
String |
Mandatory |
Type of the component. Supported types are - Header Body Button |
text |
String |
Optional |
Text for the component |
sub_type |
String |
Mandatory |
Required when type=button. Not used for the other types. Type of button to create - form: Set this to 'form' for sending the template message with the flow button. quick_reply & url. |
index |
String |
Mandatory/ Optional |
Required when type=button. Not used for the other types. Position the index of the button. You can have up to 3 buttons using index values of 0 to 2. |
footer |
String |
Optional |
The footer of the component |
parameters |
[]Parameter Object |
Mandatory/ Optional |
Required when type=button. An array of parameter objects with the content of the message. |
Parameter |
Type |
Mandatory/ Optional |
Value |
type |
String |
Mandatory |
Type of the parameter. Describes the parameter type. Supported values: action: Set this to 'action' for sending the template message with the flow button. |
action (object) |
String |
Mandatory |
Required when type is 'action' |
flow_token |
String |
Optional |
flow_token: 0000, default is "unused". |
flow_action_data |
String |
Optional |
flow_action_data optional, JSON object with the data payload for the first screen |
Please refer to Exotel's sample Postman collection to try out the APIs, we have also shared some examples here for your reference.
curl --location 'https://{{AuthKey}}:{{AuthToken}}@{{SubDomain}}/v2/accounts/{{AccountSid}}/messages' \ --header 'Content-Type: application/json' \ --data '{ "custom_data": "ORXXXXXXX", "status_callback": "https://webhook.site", "whatsapp": { "messages": [ { "from": "+911XXXXXXXX", "to": "+9199XXXXXXXX", "content": { "type": "template", "template": { "name": "flow_template", "language": { "code": "en_US" }, "components": [ { "type": "button", "sub_type": "flow", "index": "0", "parameters": [ { "type": "action", "action": { "flow_token": "0000", "flow_action_data": { "product_name": "test", "product_description": "test", "product_price": 1 } } } ] } ] } } } ] } }'
import requests import json url = "https://{{AuthKey}}:{{AuthToken}}@{{SubDomain}}/v2/accounts/{{AccountSid}}/messages" payload = json.dumps({ "custom_data": "ORXXXXXXX", "status_callback": "https://webhook.site", "whatsapp": { "messages": [ { "from": "+911XXXXXXXX", "to": "+9199XXXXXXXX", "content": { "type": "template", "template": { "name": "flow_template", "language": { "code": "en_US" }, "components": [ { "type": "button", "sub_type": "flow", "index": "0", "parameters": [ { "type": "action", "action": { "flow_token": "0000", "flow_action_data": { "product_name": "test", "product_description": "test", "product_price": 1 } } } ] } ] } } } ] } }) headers = { 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text)
curl --location --globoff 'https://{{AuthKey}}:{{AuthToken}}@{{SubDomain}}/v2/accounts/{{AccountSid}}/messages' \ --header 'Content-Type: application/json' \ --data '{ "custom_data": "ORDXXXXX", "status_callback": "https://webhook.site", "whatsapp": { "messages": [ { "from": "{{FromNumber}}", "to": "{{ToNumber}}", "content": { "type": "template", "template": { "name": "template_flow_text_header", "language": { "code": "en" }, "components": [ { "type": "header", "parameters": [ { "type": "text", "text": "Exotel" } ] }, { "type": "body", "parameters": [ { "type": "text", "text": "John" } ] }, { "type": "button", "sub_type": "flow", "index": "0", "parameters": [ { "type": "action", "action": { "flow_token": "0000", "flow_action_data": { "product_name": "test", "product_description": "test", "product_price": 1 } } } ] } ] } } } ] } }'
import requests import json url = "https://{{AuthKey}}:{{AuthToken}}@{{SubDomain}}/v2/accounts/{{AccountSid}}/messages" payload = json.dumps({ "custom_data": "ORDER123456", "status_callback": "https://webhook.site", "whatsapp": { "messages": [ { "from": "{{FromNumber}}", "to": "{{ToNumber}}", "content": { "type": "template", "template": { "name": "template_flow_text_header", "language": { "code": "en", "policy": "deterministic" //Only for On-Premise APIs }, "components": [ { "type": "header", "parameters": [ { "type": "text", "text": "Exotel" } ] }, { "type": "body", "parameters": [ { "type": "text", "text": "Javed" } ] }, { "type": "button", "sub_type": "flow", "index": "0", "parameters": [ { "type": "action", "action": { "flow_token": "0000", "flow_action_data": { "product_name": "test", "product_description": "test", "product_price": 1 } } } ] } ] } } } ] } }) headers = { 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text)
curl --location --globoff 'https://{{AuthKey}}:{{AuthToken}}@{{SubDomain}}/v2/accounts/{{AccountSid}}/messages' \ --header 'Content-Type: application/json' \ --data '{ "custom_data": "ORDXXXXX", "status_callback": "https://webhook.site", "whatsapp": { "messages": [ { "from": "{{FromNumber}}", "to": "{{ToNumber}}", "content": { "type": "template", "template": { "name": "flow_template_header_image", "language": { "code": "en" }, "components": [ { "type": "header", "parameters": [ { "type": "image", "image": { "link": "https://image.shutterstock.com/image-photo/happy-XXXXXXXXX.jpg" } } ] }, { "type": "body", "parameters": [ { "type": "text", "text": "John" } ] }, { "type": "button", "sub_type": "flow", "index": "0", "parameters": [ { "type": "action", "action": { "flow_token": "0000", "flow_action_data": { "product_name": "test", "product_description": "test", "product_price": 1 } } } ] } ] } } } ] } }'
import requests import json url = "https://{{AuthKey}}:{{AuthToken}}@{{SubDomain}}/v2/accounts/{{AccountSid}}/messages" payload = json.dumps({ "custom_data": "ORDXXXXX", "status_callback": "https://webhook.site", "whatsapp": { "messages": [ { "from": "{{FromNumber}}", "to": "{{ToNumber}}", "content": { "type": "template", "template": { "name": "flow_template_header_image", "language": { "policy": "deterministic", //Only for On-Premise APIs "code": "en" }, "components": [ { "type": "header", "parameters": [ { "type": "image", "image": { "link": "https://image.shutterstock.com/image-photo/happy-puppy-dog-smiling-on-260nw-1799966587.jpg" } } ] }, { "type": "body", "parameters": [ { "type": "text", "text": "Javed" } ] }, { "type": "button", "sub_type": "flow", "index": "0", "parameters": [ { "type": "action", "action": { "flow_token": "0000", "flow_action_data": { "product_name": "test", "product_description": "test", "product_price": 1 } } } ] } ] } } } ] } }) headers = { 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text)
HTTP Response:
{ "request_id": "210bd1cda8004a2e913eac7a580eb159", "method": "POST", "http_code": 202, "metadata": { "failed": 0, "total": 1, "success": 1 }, "response": { "whatsapp": { "messages": [ { "code": 202, "error_data": null, "status": "success", "data": { "sid": "f65047444e5c782a56f76f40e06717b9" } } ] } } }
The following are the response parameters -
Parameter |
Type |
Mandatory/Optional |
Notes |
request_id |
String |
Mandatory |
This indicates the unique id of the request. Useful for debugging and tracing purposes. |
method |
String |
Mandatory |
This indicates the HTTP method for the request such as POST |
http_code |
Integer |
Mandatory |
This indicates the HTTP code for the request such as 202, 400, 500 etc. |
metadata |
Metadata Object |
Mandatory |
Metadata pertaining to the request. Count of failed, total and success records. |
response |
Response Object |
Mandatory |
Response for the request |
Parameter |
Type |
Mandatory/Optional |
Notes |
total |
Integer |
Mandatory |
Total number of the messages in the request |
success |
Integer |
Mandatory |
Number of messages successfully accepted |
failed |
Integer |
Mandatory |
Number of messages that couldn’t be accepted (failed) |
Parameter |
Type |
Mandatory/Optional |
Notes |
|
Channel Response Object |
Mandatory |
Response for Whatsapp messages specified in the request |
Parameter |
Type |
Mandatory/Optional |
Notes |
messages |
[]Create Message Response Object |
Mandatory |
Array of messages response for each message |
Parameter |
Type |
Mandatory/Optional |
Notes |
code |
Integer |
Mandatory |
Response code for the individual message |
error_data |
ErrorResponseObject |
Optional |
Error related to a single message |
status |
String |
Mandatory |
Status of the single message |
data |
Message Response Object |
Optional |
Data pertaining to a single message |
Parameter |
Type |
Mandatory/Optional |
Notes |
code |
Numeric |
Mandatory |
Numeric HTTP code for a Single message |
message |
String |
Mandatory |
Brief description of the error |
description |
String |
Mandatory |
Detailed explanation of error |
Parameter |
Type |
Mandatory/Optional |
Notes |
sid |
String |
Mandatory |
SID (Unique identifier) of the single message |
HTTP Error Codes |
Error Message |
202 |
Accepted - Request accepted. |
400 |
Bad Request - Something in your header or request body was malformed/missing. More than 100 messages specified in a request |
401 |
Unauthorized - Necessary credentials were either missing or invalid. |
402 |
Payment Required - The action is not available on your plan, or you have exceeded usage limits for your current plan. |
403 |
Your credentials are valid, but you don’t have access to the requested resource. |
404 |
Not Found - The object you’re requesting doesn’t exist. |
5xx |
Server Errors - Something went wrong at our end. Please try again. |
Status callback URL can be passed in the status_callback parameter in send message/template message APIs and it can also be configured as default to receive the responses. The Exotel team will help you configure the default URL while onboarding.
*NOTE: Any callback can be received only in one status callback URL at any time
What is different for Flow Template?
"whatsapp": { "messages": [ { "callback_type": "dlr", "sid": "1234XXXXX", "to": "2365XXXXXX", "exo_status_code": 25001, "exo_detailed_status": "EX_MESSAGE_DELIVERED", "description": "Message delivered", "timestamp": "2022-12-07T17:00:00.000+05:30", "custom_data": "custom" } ] } }
Above mentioned Send Whatsapp Messages API and Send Whatsapp Template Messages API can also be used to send bulk Whatsapp messages to different numbers with both static and dynamic content to each number. You can send upto 100 messages per request.
curl -XPOST "https://<api_key>:<api_token><subdomain>/v2/accounts/<your_sid>/messages" -d '{ { "custom_data": "custom12", "status_callback": "www.webhook.site", "whatsapp": { "messages": [ { "from": "+91XXXXXXXXXX", "to": "+91XXXXXXXXXX"", "content": { "recipient_type": "individual", "type": "text", "text": { "preview_url": false, "body": "MESSAGE_CONTENT" } } }, { "from": "+91XXXXXXXXXX"", "to": "+91XXXXXXXXXX"", "content": { "recipient_type": "individual", "type": "text", "text": { "preview_url": false, "body": "MESSAGE_CONTENT" } } } ] } } }'
var https = require('follow-redirects').https; var fs = require('fs'); var qs = require('querystring'); var options = { 'method': 'POST', 'hostname': '<api_key>', 'port': <api_token><subdomain>, 'path': '/v2/accounts/<your_sid>/messages', 'headers': { 'Content-Type': 'application/x-www-form-urlencoded' }, 'maxRedirects': 20 }; var req = https.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function (chunk) { var body = Buffer.concat(chunks); console.log(body.toString()); }); res.on("error", function (error) { console.error(error); }); }); var postData = qs.stringify({ '{ \n{\n "custom_data": "custom12",\n "status_callback": "www.webhook.site",\n "whatsapp": {\n "messages": [\n {\n "from": "+91XXXXXXXXXX",\n "to": "+91XXXXXXXXXX"",\n "content": {\n "recipient_type": "individual",\n "type": "text",\n "text": {\n "preview_url": false,\n "body": "MESSAGE_CONTENT"\n }\n }\n },\n {\n "from": "+91XXXXXXXXXX"",\n "to": "+91XXXXXXXXXX"",\n "content": {\n "recipient_type": "individual",\n "type": "text",\n "text": {\n "preview_url": false,\n "body": "MESSAGE_CONTENT"\n }\n }\n }\n ]\n }\n}\n }': '' }); req.write(postData); req.end();
<?php $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => 'https://%3Capi_key%3E:%3Capi_token%3E%3Csubdomain%3E/v2/accounts/%3Cyour_sid%3E/messages', CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_POSTFIELDS => '%7B%C2%A0%0A%7B%0A%C2%A0%C2%A0%C2%A0%22custom_data%22%3A%20%22custom12%22%2C%0A%C2%A0%C2%A0%C2%A0%22status_callback%22%3A%20%22www.webhook.site%22%2C%0A%C2%A0%C2%A0%C2%A0%22whatsapp%22%3A%20%7B%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%22messages%22%3A%20%5B%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%7B%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%22from%22%3A%20%22%2B91XXXXXXXXXX%22%2C%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%22to%22%3A%20%22%2B91XXXXXXXXXX%22%22%2C%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%22content%22%3A%20%7B%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%22recipient_type%22%3A%20%22individual%22%2C%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%22type%22%3A%20%22text%22%2C%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%22text%22%3A%20%7B%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%22preview_url%22%3A%20false%2C%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%22body%22%3A%20%22MESSAGE_CONTENT%22%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%7D%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%7D%0A%C2%A0%C2%A0%C2%A0%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%C2%A0%7D%0A%7D%0A%C2%A0%7D=', CURLOPT_HTTPHEADER => array( 'Content-Type: application/x-www-form-urlencoded' ), )); $response = curl_exec($curl); curl_close($curl); echo $response;
import requests url = "https://<api_key>:<api_token><subdomain>/v2/accounts/<your_sid>/messages" payload='%7B%C2%A0%0A%7B%0A%C2%A0%C2%A0%C2%A0%22custom_data%22%3A%20%22custom12%22%2C%0A%C2%A0%C2%A0%C2%A0%22status_callback%22%3A%20%22www.webhook.site%22%2C%0A%C2%A0%C2%A0%C2%A0%22whatsapp%22%3A%20%7B%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%22messages%22%3A%20%5B%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%7B%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%22from%22%3A%20%22%2B91XXXXXXXXXX%22%2C%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%22to%22%3A%20%22%2B91XXXXXXXXXX%22%22%2C%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%22content%22%3A%20%7B%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%22recipient_type%22%3A%20%22individual%22%2C%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%22type%22%3A%20%22text%22%2C%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%22text%22%3A%20%7B%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%22preview_url%22%3A%20false%2C%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0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%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%7D%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%7D%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%7D%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%5D%0A%C2%A0%C2%A0%C2%A0%7D%0A%7D%0A%C2%A0%7D=' headers = { 'Content-Type': 'application/x-www-form-urlencoded' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text)
require "uri" require "net/http" url = URI("https://<api_key>:<api_token><subdomain>/v2/accounts/<your_sid>/messages") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = "application/x-www-form-urlencoded" request.body = "%7B%C2%A0%0A%7B%0A%C2%A0%C2%A0%C2%A0%22custom_data%22%3A%20%22custom12%22%2C%0A%C2%A0%C2%A0%C2%A0%22status_callback%22%3A%20%22www.webhook.site%22%2C%0A%C2%A0%C2%A0%C2%A0%22whatsapp%22%3A%20%7B%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%22messages%22%3A%20%5B%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%7B%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%22from%22%3A%20%22%2B91XXXXXXXXXX%22%2C%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%22to%22%3A%20%22%2B91XXXXXXXXXX%22%22%2C%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%22content%22%3A%20%7B%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%22recipient_type%22%3A%20%22individual%22%2C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%20%22text%22%2C%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%22text%22%3A%20%7B%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%22preview_url%22%3A%20false%2C%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%22body%22%3A%20%22MESSAGE_CONTENT%22%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%7D%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%7D%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%7D%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%5D%0A%C2%A0%C2%A0%C2%A0%7D%0A%7D%0A%C2%A0%7D=" response = https.request(request) puts response.read_body
curl -XPOST "https://<api_key>:<api_token><subdomain>/v2/accounts/<your_sid>/messages" -d '{ { "custom_data": "custom12", "status_callback": "www.webhook.site", "whatsapp": { "messages": [ { "from": "+91XXXXXXXXXX", "to": "91XXXXXXXXXX", "content": { "type": "template", "template": { "name": "exotel_image_1", "language": { "policy": "deterministic", "code": "en" }, "components": [ { "type": "header", "parameters": [ { "type": "image", "image": { "link": "https://image.shutterstock.com/image-photo/happy-puppy-dog-smiling-on-260nw-1799966587.jpg" } } ] }, { "type": "body", "parameters": [ { "type": "text", "text": "ABC" } ] } ] } } }, { "from": "+91XXXXXXXXXX", "to": "91XXXXXXXXXX", "content": { "type": "template", "template": { "name": "exotel_image_1", "language": { "policy": "deterministic", "code": "en" }, "components": [ { "type": "header", "parameters": [ { "type": "image", "image": { "link": "https://image.shutterstock.com/image-photo/happy-puppy-dog-smiling-on-260nw-1799966587.jpg" } } ] }, { "type": "body", "parameters": [ { "type": "text", "text": "ABC" } ] } ] } } } ] } } }'
var https = require('follow-redirects').https; var fs = require('fs'); var qs = require('querystring'); var options = { 'method': 'POST', 'hostname': '<api_key>', 'port': <api_token><subdomain>, 'path': '/v2/accounts/<your_sid>/messages', 'headers': { 'Content-Type': 'application/x-www-form-urlencoded' }, 'maxRedirects': 20 }; var req = https.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function (chunk) { var body = Buffer.concat(chunks); console.log(body.toString()); }); res.on("error", function (error) { console.error(error); }); }); var postData = qs.stringify({ '{\n{\n "custom_data": "custom12",\n "status_callback": "www.webhook.site",\n "whatsapp": {\n "messages": [\n {\n "from": "+91XXXXXXXXXX",\n "to": "91XXXXXXXXXX",\n "content": {\n "type": "template",\n "template": {\n "name": "exotel_image_1",\n "language": {\n "policy": "deterministic",\n "code": "en"\n },\n "components": [\n {\n "type": "header",\n "parameters": [\n {\n "type": "image",\n "image": {\n "link": "https://image.shutterstock.com/image-photo/happy-puppy-dog-smiling-on-260nw-1799966587.jpg"\n }\n }\n ]\n },\n {\n "type": "body",\n "parameters": [\n {\n "type": "text",\n "text": "ABC"\n }\n ]\n }\n ]\n }\n }\n },\n {\n "from": "+91XXXXXXXXXX",\n "to": "91XXXXXXXXXX",\n "content": {\n "type": "template",\n "template": {\n "name": "exotel_image_1",\n "language": {\n "policy": "deterministic",\n "code": "en"\n },\n "components": [\n {\n "type": "header",\n "parameters": [\n {\n "type": "image",\n "image": {\n "link": "https://image.shutterstock.com/image-photo/happy-puppy-dog-smiling-on-260nw-1799966587.jpg"\n }\n }\n ]\n },\n {\n "type": "body",\n "parameters": [\n {\n "type": "text",\n "text": "ABC"\n }\n ]\n }\n ]\n }\n }\n }\n ]\n }\n}\n }': '' }); req.write(postData); req.end();
<?php $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => 'https://%3Capi_key%3E:%3Capi_token%3E%3Csubdomain%3E/v2/accounts/%3Cyour_sid%3E/messages', CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_POSTFIELDS => '%7B%0A%7B%0A%C2%A0%C2%A0%C2%A0%22custom_data%22%3A%20%22custom12%22%2C%0A%C2%A0%C2%A0%C2%A0%22status_callback%22%3A%20%22www.webhook.site%22%2C%0A%C2%A0%C2%A0%C2%A0%22whatsapp%22%3A%20%7B%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%22messages%22%3A%20%5B%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%7B%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%22from%22%3A%20%22%2B91XXXXXXXXXX%22%2C%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%22to%22%3A%20%2291XXXXXXXXXX%22%2C%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%22content%22%3A%20%7B%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%22type%22%3A%20%22template%22%2C%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0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PHEADER => array( 'Content-Type: application/x-www-form-urlencoded' ), )); $response = curl_exec($curl); curl_close($curl); echo $response;
import requests url = "https://<api_key>:<api_token><subdomain>/v2/accounts/<your_sid>/messages" payload='%7B%0A%7B%0A%C2%A0%C2%A0%C2%A0%22custom_data%22%3A%20%22custom12%22%2C%0A%C2%A0%C2%A0%C2%A0%22status_callback%22%3A%20%22www.webhook.site%22%2C%0A%C2%A0%C2%A0%C2%A0%22whatsapp%22%3A%20%7B%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%22messages%22%3A%20%5B%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%7B%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%22from%22%3A%20%22%2B91XXXXXXXXXX%22%2C%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%22to%22%3A%20%2291XXXXXXXXXX%22%2C%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%22content%22%3A%20%7B%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%22type%22%3A%20%22template%22%2C%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%22template%22%3A%20%7B%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0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%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%7D%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%5D%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%7D%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%5D%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%7D%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%7D%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%7D%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%5D%0A%C2%A0%C2%A0%C2%A0%7D%0A%7D%0A%C2%A0%C2%A0%C2%A0%7D=' headers = { 'Content-Type': 'application/x-www-form-urlencoded' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text)
require "uri" require "net/http" url = URI("https://<api_key>:<api_token><subdomain>/v2/accounts/<your_sid>/messages") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = "application/x-www-form-urlencoded" request.body = "%7B%0A%7B%0A%C2%A0%C2%A0%C2%A0%22custom_data%22%3A%20%22custom12%22%2C%0A%C2%A0%C2%A0%C2%A0%22status_callback%22%3A%20%22www.webhook.site%22%2C%0A%C2%A0%C2%A0%C2%A0%22whatsapp%22%3A%20%7B%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%22messages%22%3A%20%5B%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%7B%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%22from%22%3A%20%22%2B91XXXXXXXXXX%22%2C%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%22to%22%3A%20%2291XXXXXXXXXX%22%2C%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%22content%22%3A%20%7B%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%22type%22%3A%20%22template%22%2C%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%22template%22%3A%20%7B%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%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C2%A0%C2%A0%C2%A0%C2%A0%7D%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%5D%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%7D%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%5D%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%7D%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%7D%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%7D%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%5D%0A%C2%A0%C2%A0%C2%A0%7D%0A%7D%0A%C2%A0%C2%A0%C2%A0%7D=" response = https.request(request) puts response.read_body
HTTP Response:
"request_id": "b434e927a5844175b23059cd96feea3d", "method": "POST", "http_code": 202, "metadata": { "failed": 0, "total": 2, "success": 2 }, "response": { "whatsapp": { "messages": [ { "code": 202, "error_data": null, "status": "success", "data": { "sid": "2FdiiEQUosckPhpZfuVwfjxiSlc16a4", } }, { "code": 202, "error_data": null, "status": "success", "data": { "sid": "2FdiiDU5hAK8tW0Atq340Ayngpx16a4", } } ] } } }
The following are the response parameters -
Parameter |
Type |
Mandatory/Optional |
Notes |
request_id |
String |
Mandatory |
This indicates the unique id of the request. Useful for debugging and tracing purposes. |
method |
String |
Mandatory |
This indicates the HTTP method for the request such as POST |
http_code |
Integer |
Mandatory |
This indicates the HTTP code for the request such as 202, 400, 500 etc. |
metadata |
Metadata Object |
Mandatory |
Metadata pertaining to the request. Count of failed, total and success records. |
response |
Response Object |
Mandatory |
Response for the request |
Parameter |
Type |
Mandatory/Optional |
Notes |
total |
Integer |
Mandatory |
Total number of the messages in the request |
success |
Integer |
Mandatory |
Number of messages successfully accepted |
failed |
Integer |
Mandatory |
Number of messages that couldn’t be accepted (failed) |
Parameter |
Type |
Mandatory/Optional |
Notes |
|
Channel Response Object |
Mandatory |
Response for Whatsapp messages specified in the request |
Parameter |
Type |
Mandatory/Optional |
Notes |
messages |
[]Create Message Response Object |
Mandatory |
Array of messages response for each message |
Parameter |
Type |
Mandatory/Optional |
Notes |
code |
Integer |
Mandatory |
Response code for the individual message |
error_data |
Error Response Object |
Optional |
Error related to a single message |
status |
String |
Mandatory |
Status of the single message |
data |
Message Response Object |
Optional |
Data pertaining to a single message |
Parameter |
Type |
Mandatory/Optional |
Notes |
code |
Numeric |
Mandatory |
Numeric HTTP code for a Single message |
message |
String |
Mandatory |
Brief description of the error |
description |
String |
Mandatory |
Detailed explanation of error |
Parameter |
Type |
Mandatory/Optional |
Notes |
sid |
String |
Mandatory |
SID (Unique identifier) of the single message |
HTTP Error Codes |
Error Message |
202 |
Accepted - Request accepted. |
400 |
Bad Request - Something in your header or request body was malformed/missing. More than 100 messages specified in a request |
401 |
Unauthorized - Necessary credentials were either missing or invalid. |
402 |
Payment Required - The action is not available on your plan, or you have exceeded usage limits for your current plan. |
403 |
Your credentials are valid, but you don’t have access to the requested resource. |
404 |
Not Found - The object you’re requesting doesn’t exist. |
5xx |
Server Errors - Something went wrong at our end. Please try again. |
Status callback URL can be passed in status_callback parameter in send message/template message APIs and it can also be configured as default to receive the responses. Exotel team will help you configure the default URL while onboarding.
*NOTE: Any callback can be received only in one status callback URL at any time
"whatsapp": { "messages": [ { "callback_type": "dlr", "sid": "1234", "to": "2365564965", "exo_status_code": 25001, "exo_detailed_status": "EX_MESSAGE_DELIVERED", "description": "Message delivered", "timestamp": "2022-12-07T17:00:00.000+05:30", "custom_data": "custom" } ] } }
The following are the status callback parameters -
Parameter |
Type |
Mandatory |
Notes |
|
Message DLR Object |
Optional |
Delivery report (DLR) of the Whatsapp channel |
Parameter |
Type |
Mandatory |
Notes |
messages |
[]Whatsapp Message DLR Object |
Mandatory |
Information relating to the messages for DLR |
Parameter |
Type |
Mandatory |
Notes |
callback_type |
String |
Mandatory |
Type of the callback. Possible values: dlr, icm |
sid |
String |
Mandatory |
SID (Unique Identifier) of the message |
to |
String |
Mandatory |
Phone Number of the user to whom the message was sent. |
exo_status_code |
Integer |
Mandatory |
ExoStatusCode for the message |
exo_detailed_status |
String |
Mandatory |
Detailed status of ExoStatus code |
description |
String |
Mandatory |
Description of the ExoStatus code |
timestamp |
String |
Mandatory |
Timestamp at which the event occurred |
custom_data |
String |
Optional |
It will return the custom data, if the same was passed in the API request |
Detailed Status Code |
Detailed Status |
Description |
30001 |
EX_MESSAGE_SENT |
The message has been sent to the user |
30002 |
EX_MESSAGE_DELIVERED |
The message has been successfully delivered to the user |
30003 |
EX_MESSAGE_SEEN |
The message has been seen by the user |
30004 |
EX_SYSTEM_ERROR |
The message failed due to an issue with the system. For eg: Authentication/Access Token/Permission related issue, service not available issue etc. |
30005 |
EX_NUMBER_ERROR |
The message failed due to an issue with the phone number |
30006 |
EX_SETUP_ERROR |
The message failed due to set-up error |
30007 |
EX_RATE_LIMIT_HIT |
The message failed due to a breach in rate limit |
30008 |
EX_SPAM_RATE_LIMIT_HIT |
The message failed as spam rate limit has been breached |
30009 |
EX_TOO_MANY_REQUEST |
The message failed as too many request has been made in short span |
30010 |
EX_INVALID_REQUEST |
The message failed as the request is invalid |
30011 |
EX_UNKNOWN_ERROR |
The message failed due to an unknown error |
30012 |
EX_INVALID_RECIPIENT |
The message failed as the recipient was invalid |
30013 |
EX_INCAPABLE_RECIPIENT |
The message failed as the recipient is unable to receive the message |
30014 |
EX_RECIPIENT_BLOCKED |
The message failed as the recipient is not in allowed list |
30015 |
EX_UNSUPPORTED_MESSAGE |
The message failed as unsupported message type has been passed in the request body |
30016 |
EX_MEDIA_DOWNLOAD_ERROR |
The message failed as Whatsapp is unable to download the sender media |
30017 |
EX_MEDIA_UPLOAD_ERROR |
The message failed as unsupported media type has been passed in the request body |
30018 |
EX_REENGAGEMENT_ERROR |
The message failed as 24 hours window of the conversation is over |
30019 |
EX_INVALID_PARAM |
The message failed as invalid parameters has been passed in the request body |
30020 |
EX_MISSING_PARAM |
The message has failed as mandatory parameter is missing from the request body |
30021 |
EX_INVALID_PARAM_VALUE |
The message failed as invalid parameter value has been passed in the request body |
30022 |
EX_TEMPLATE_ERROR |
The message failed as the template format char policy has been violated |
30023 |
EX_TEMPLATE_PARAM_ERROR |
The message failed due to mismatch in count of template parameters |
30024 |
EX_TEMPLATE_NOT_FOUND |
The message failed as the passed message template does not exist |
30025 |
EX_TEMPLATE_TEXT_TOO_LONG |
The message failed as the translated text from template message is too long |
30026 |
EX_INVALID_TEMPLATE_NAMESPACE |
The message failed as invalid template namespace has been passed |
30027 |
EX_MESSAGE_PENDING_TOO_LONG |
The message failed as the message was pending for too long |
30028 |
EX_MESSAGE_EXPIRED |
The message failed as the message got expired |
30029 |
EX_MESSAGE_TOO_LONG |
The message failed as the number of characters in the message was more than 4096 characters |
30030 |
EX_WEBHOOK_ERROR |
Webhook is not configured |
30031 |
EX_SECTION_COUNT_ERROR |
The message failed due to invalid no. of sections |
30032 |
EX_ROWS_COUNT_ERROR |
The message failed due to invalid no. of rows |
30033 |
EX_PRODUCT_COUNT_ERROR |
The message failed due to invalid no. of product |
30034 |
EX_CATALOGUE_NOT_FOUND |
The message failed as the catalog ID has not been found |
30035 |
EX_CATALOGUE_NOT_LINKED |
The message failed as the catalog ID has not been linked to the API number |
30036 |
EX_MISSING_PRODUCT |
The message failed as the product is missing in the catalog |
30037 |
EX_PRODUCT_NOT_FOUND |
The message failed as all the products in the request body has not been found in the product catalog |
30038 |
EX_PRODUCT_COMPLIANCE_ERROR |
The message failed as the listed products failed compliance |
30039 |
EX_INVALID_HEADER |
The message failed due to invalid header structure |
30040 |
EX_MISSING_COMPLIANCE |
The message failed as compliance information was missing |
30041 |
EX_CHAR_POLICY_VIOLATION |
The message failed as character policy got violated |
Receive messages webhook can be passed in status_callback parameter in send message/template message APIs to receive replies on messages from the business. To receive any message from an end user which is not a reply to a business message, a default callback value needs to be configured. Exotel team will help you configure the default URL while onboarding.
*NOTE: Any messages from an user can be received only in one webhook at any time
Parameter |
Type |
Mandatory |
Notes |
|
Message ICM Object |
Mandatory |
Incoming message callback for Whatsapp |
Parameter |
Type |
Mandatory |
Notes |
messages |
[]Whatsapp Message ICM Object |
Mandatory |
Information relating to the incoming messages from the end-users |
Parameter |
Type |
Mandatory |
Notes |
callback_type |
String |
Mandatory |
Type of the callback. Possible values: dlr/icm |
from |
String |
Mandatory |
Number of the end user who has sent the incoming message to the business |
to |
String |
Mandatory |
Business number to whom the message was sent |
profile_name |
String |
Mandatory |
Profile Name of the user who has sent the incoming message |
timestamp |
String |
Mandatory |
Timestamp at which incoming message was sent |
content |
Content Object |
Mandatory |
Content related to the incoming message |
Parameter |
Type |
Mandatory |
Notes |
type |
String |
Mandatory |
Type of the message |
text |
TextObject |
Optional |
Mandatory if type is text |
image |
MediaResponseObject |
Optional |
Mandatory if type is image |
audio |
MediaResponseObject |
Optional |
Mandatory if type is audio |
sticker |
MediaResponseObject |
Optional |
Mandatory if type is sticker |
video |
MediaResponseObject |
Optional |
Mandatory if type is video |
document |
MediaResponseObject |
Optional |
Mandatory if type is document |
error |
MessageICMErrorObject |
Optional |
If there is an error |
Parameter |
Type |
Mandatory |
Notes |
url |
String |
Mandatory |
URL to download the media |
caption |
String |
Optional |
Caption for the media. Describes the specified media. |
filename |
String |
Optional |
This is passed if the media is document. Describes the filename for the specific document. The extension of the filename will specify what format the document is displayed as in WhatsApp. |
Parameter |
Type |
Mandatory |
Notes |
exo_status_code |
Integer |
Mandatory |
Exo Status Code for the error |
exo_detailed_status |
String |
Mandatory |
Detailed Status of the Exo Status Code |
description |
String |
Mandatory |
Description of the Exo Status code |
{ "whatsapp": { "messages": [ { "callback_type": "incoming_message", "from": "1234", "profile_name": "John", "to": "5698", "timestamp": "1235654654", "content": { "type": "text", "text": { "body": "This is a text message from Whatsapp" } } } ] } }
{ "whatsapp": { "messages": [ { "callback_type": "incoming_message", "sid": "b4352d7XXXXXXX", "from": "+9199XXXXXXXX", "to": "+9180XXXXXXXX", "timestamp": "2024-09-16T17:05:35+05:30", "profile_name": "KXXXXX", "content": { "type": "button", "context": { "sid": "b4352d7XXXXXXX" }, "button": { "payload": "Good", "text": "Good" } } } ] } }
{ "whatsapp": { "messages": [ { "callback_type": "incoming_message", "sid": "2f77028adcb7XXXXXX", "from": "+9199XXXXXXXX", "to": "+9180XXXXXXXX", "timestamp": "2024-09-16T17:05:01+05:30", "profile_name": "KXXXXXX", "content": { "type": "interactive", "context": { "sid": "95126d4462XXXXX" }, "interactive": { "type": "list_reply", "list_reply": { "id": "1", "title": "./Time: 10:00", "description": "./Place: Whitefield, Bangalore" } } } } ] } }
{ "whatsapp": { "messages": [ { "callback_type": "incoming_message", "from": "1234", "profile_name": "John", "to": "5698", "timestamp": "1235654654", "content": { "type": "image", "image": { "url": "https://exotel.com/abc.jpeg", "caption": "Hello this is image from Whatsapp" } } } ] } }
{ "whatsapp": { "messages": [ { "callback_type": "incoming_message", "from": "1234", "profile_name": "John", "to": "5698", "timestamp": "1235654654", "content": { “type”: “unsupported”, "error": { "exo_status_code": 24501, "exo_detailed_status": "EX_UNSUPPORTED_MEDIA_TYPE", "description": "The media type is currently not supported" } } } ] } }
Please understand that this feature is currently in Beta and it’s important to note that certain capabilities, such as Reports and Analytics are not yet available on the dashboard. We will be working on this and is part of our next phase launch.
This is a new type of incoming message for the WhatsApp Flows Message.Upon flow completion, a response message will be sent to the WhatsApp chat. You will receive it in the same way as you receive all other messages from the user - via message webhook. This response field will contain flow-specific data provided by the end-users after submitting the filled flow form.
Receive messages webhook can be passed in the status_callback parameter in send message/template message APIs to receive replies on messages from the business. To receive any message from an end user that is not a reply to a business message, a default callback value needs to be configured. The Exotel team will help you configure the default URL while onboarding.
*NOTE: Any messages from a user can be received only in one webhook at any time
Parameter |
Type |
Mandatory |
Value |
|
Message ICM Object |
Mandatory |
Incoming message callback for Whatsapp |
Parameter |
Type |
Mandatory |
Value |
messages |
[]Whatsapp Message ICM Object |
Mandatory |
Information relating to the incoming messages from the end-users |
Parameter |
Type |
Mandatory |
Value |
callback_type |
String |
Mandatory |
Type of the callback. Possible values: dlr/icm |
from |
String |
Mandatory |
Number of the end user who has sent the incoming message to the business |
to |
String |
Mandatory |
Business number to whom the message was sent |
profile_name |
String |
Mandatory |
Profile Name of the user who has sent the incoming message |
timestamp |
String |
Mandatory |
Timestamp at which incoming message was sent |
content |
Content Object |
Mandatory |
Content related to the incoming message |
Parameter |
Type |
Mandatory |
Value |
type |
String |
Mandatory |
Type of the message - interactive for Flow messages |
sid |
String |
Mandatory |
The unique message ID for this incoming message |
interactive - type |
String |
Mandatory |
For flow type of messages, this will be nfm_reply |
interactive.nfm_reply.name |
String |
Mandatory |
flow- Cloud API |
interactive.nfm_reply.response_json |
String |
Mandatory |
Flow-specific data. The structure is either defined in flow JSON or if the flow is using an endpoint, controlled by the endpoint |
error |
MessageICMErrorObject |
Optional |
Check the below object for any error |
{ "whatsapp": { "messages": [ { "callback_type": "incoming_message", "sid": "4743da5XXXXXXXXXX", "from": "+9188XXXXXXXX", "to": "+9122XXXXXXXX", "timestamp": "2023-10-21T12:35:00+05:30", "profile_name": "John", "content": { "type": "interactive", "context": { "sid": "f317c72XXXXXXXXXXXXXXX" }, "interactive": { "type": "nfm_reply", "nfm_reply": { "body": "Sent", "name": "galaxy_message", "response_json": "{\"terms_and_conditions\":true,\"flow_token\":\"flows-builder-97XXXX\",\"vehicle_number\":\"74XXXX\",\"name\":\"John Shaw\",\"phone_number\":\"9180XXXXXXXX\",\"email\":\"emXXX@gmail.com\",\"cover_type\":\"0\"}" } } } } ] } }
Parameter |
Type |
Mandatory |
Value |
exo_status_code |
Integer |
Mandatory |
Exo Status Code for the error |
exo_detailed_status |
String |
Mandatory |
Detailed Status of the Exo Status Code |
description |
String |
Mandatory |
Description of the Exo Status code |
{ "whatsapp": { "messages": [ { "callback_type": "incoming_message", "from": "1234", "profile_name": "John", "to": "5698", "timestamp": "1235654654", "content": { “type”: “unsupported”, "error": { "exo_status_code": 24501, "exo_detailed_status": "EX_UNSUPPORTED_MEDIA_TYPE", "description": "The media type is currently not supported" } } } ] } }
Please refer to this section to understand about the error codes you would receive when sending WhatsApp messages using Exotel APIs.
Detailed Status Code |
Detailed Status |
Description |
30001 |
EX_MESSAGE_SENT |
The message has been sent to the user |
30002 |
EX_MESSAGE_DELIVERED |
The message has been successfully delivered to the user |
30003 |
EX_MESSAGE_SEEN |
The message has been seen by the user |
30004 |
EX_SYSTEM_ERROR |
The message failed due to an issue with the system. For eg: Authentication/Access Token/Permission related issue, service not available issue etc. |
30005 |
EX_NUMBER_ERROR |
The message failed due to an issue with the phone number |
30006 |
EX_SETUP_ERROR |
The message failed due to set-up error |
30007 |
EX_RATE_LIMIT_HIT |
The message failed due to a breach in rate limit |
30008 |
EX_SPAM_RATE_LIMIT_HIT |
The message failed as spam rate limit has been breached |
30009 |
EX_TOO_MANY_REQUEST |
The message failed as too many request has been made in short span |
30010 |
EX_INVALID_REQUEST |
The message failed as the request is invalid |
30011 |
EX_UNKNOWN_ERROR |
The message failed due to an unknown error |
30012 |
EX_INVALID_RECIPIENT |
The message failed as the recipient was invalid |
30013 |
EX_INCAPABLE_RECIPIENT |
The message failed as the recipient is unable to receive the message |
30014 |
EX_RECIPIENT_BLOCKED |
The message failed as the recipient is not in allowed list |
30015 |
EX_UNSUPPORTED_MESSAGE |
The message failed as unsupported message type has been passed in the request body |
30016 |
EX_MEDIA_DOWNLOAD_ERROR |
The message failed as Whatsapp is unable to download the sender media |
30017 |
EX_MEDIA_UPLOAD_ERROR |
The message failed as unsupported media type has been passed in the request body |
30018 |
EX_REENGAGEMENT_ERROR |
The message failed as 24 hours window of the conversation is over |
30019 |
EX_INVALID_PARAM |
The message failed as invalid parameters has been passed in the request body |
30020 |
EX_MISSING_PARAM |
The message has failed as mandatory parameter is missing from the request body |
30021 |
EX_INVALID_PARAM_VALUE |
The message failed as invalid parameter value has been passed in the request body |
30022 |
EX_TEMPLATE_ERROR |
The message failed as the template format char policy has been violated |
30023 |
EX_TEMPLATE_PARAM_ERROR |
The message failed due to mismatch in count of template parameters |
30024 |
EX_TEMPLATE_NOT_FOUND |
The message failed as the passed message template does not exist |
30025 |
EX_TEMPLATE_TEXT_TOO_LONG |
The message failed as the translated text from template message is too long |
30026 |
EX_INVALID_TEMPLATE_NAMESPACE |
The message failed as invalid template namespace has been passed |
30027 |
EX_MESSAGE_PENDING_TOO_LONG |
The message failed as the message was pending for too long |
30028 |
EX_MESSAGE_EXPIRED |
The message failed as the message got expired |
30029 |
EX_MESSAGE_TOO_LONG |
The message failed as the number of characters in the message was more than 4096 characters |
30030 |
EX_WEBHOOK_ERROR |
Webhook is not configured |
30031 |
EX_SECTION_COUNT_ERROR |
The message failed due to invalid no. of sections |
30032 |
EX_ROWS_COUNT_ERROR |
The message failed due to invalid no. of rows |
30033 |
EX_PRODUCT_COUNT_ERROR |
The message failed due to invalid no. of product |
30034 |
EX_CATALOGUE_NOT_FOUND |
The message failed as the catalog ID has not been found |
30035 |
EX_CATALOGUE_NOT_LINKED |
The message failed as the catalog ID has not been linked to the API number |
30036 |
EX_MISSING_PRODUCT |
The message failed as the product is missing in the catalog |
30037 |
EX_PRODUCT_NOT_FOUND |
The message failed as all the products in the request body has not been found in the product catalog |
30038 |
EX_PRODUCT_COMPLIANCE_ERROR |
The message failed as the listed products failed compliance |
30039 |
EX_INVALID_HEADER |
The message failed due to invalid header structure |
30040 |
EX_MISSING_COMPLIANCE |
The message failed as compliance information was missing |
30041 |
EX_CHAR_POLICY_VIOLATION |
The message failed as character policy got violated |