×

Send Whatsapp Messages API

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

POST

https://<your_api_key>:<your_api_token><subdomain>/v2/accounts/<your_sid>/messages

  • Replace <your_api_key> and <your_api_token> with the API key and token created by you.
  • Replace <your_sid> with your “Account sid".
  • Replace <subdomain> with the region of your account
    1. <subdomain> of Singapore cluster is @api.exotel.com
    2. <subdomain> of Mumbai cluster is @api.in.exotel.com

<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.

whatsapp

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.

Channel Object

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 

Message Object

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

Whatsapp Message Object

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.
For Cloud API, Static third-party outbound stickers are supported in addition to all types of inbound stickers. A static sticker needs to be 512x512 pixels and cannot exceed 100 KB. An animated sticker must be 512x512 pixels and cannot exceed 500 KB.

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.

Text Object

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

Image Object

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.

Audio Object

Parameter Name

Parameter Type

Mandatory/Optional

Value

link

String

Mandatory

Link of the audio to be sent.Use only with HTTP/HTTPS URLs.

Video Object

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.

Document Object

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.

Sticker Object

Parameter Name

Parameter Type

Mandatory/Optional

Value

link

String

Mandatory

Link of the sticker to be sent. Use only with HTTP/HTTPS URLs.

Location Object

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.

Contact Object

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

Address Object

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

Email Object

Parameter Name

Parameter Type

Mandatory/Optional

Value

email

String

Optional

Email address.

type

String

Optional

Type of the email. Standard values are HOME and WORK.

Name Object

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.

Org Object

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.

Phone Object

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

URL Object

Parameter Name

Parameter Type

Mandatory/Optional

Value

URL

String

Optional

URL of the contact

type

String

Optional

Standard values are HOME and WORK.

Interactive Object

Parameter Name

Parameter Type

Mandatory/Optional

Value

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

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.

Header Object

Parameter Name

Parameter Type

Mandatory/Optional

Value

type

String

Mandatory

The header type you would like to use. Supported values:


  • text: Used for List Messages, Reply Buttons
  • video: Used for Reply Buttons.
  • image: Used for Reply Buttons.
  • document: Used for Reply Buttons.

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.

Body Object

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.

Footer Object

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.

Action Object

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.

Section Object

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.

Row Object

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

Button Object

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. 

Reply Object

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:

  • On success, the HTTP response status code will be 202
  • The Sid is the unique identifier of the message and it will be useful to log this for future debugging
  • the HTTP body will contain an JSON similar to the one below
{
   "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

Metadata Object

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)

Response Object

Parameter

Type

Mandatory/Optional

Notes

whatsapp

Channel Response Object

Mandatory

Response for Whatsapp messages specified in the request

Channel Response Object

Parameter

Type

Mandatory/Optional

Notes

messages

[]Create Message Response Object

Mandatory

Array of messages response for each message

Create Message Response Object

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

Error Response Object

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

Message Response Object

Parameter

Type

Mandatory/Optional

Notes

sid

String

Mandatory

SID (Unique identifier) of the single message

HTTP Error codes : 

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 Callbacks 

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.

  • If you pass status callback URL in send message/template message APIs, status callbacks will be triggered to the respective URL 
  • If you do not pass any status callback URL in send message/template message APIs, status callbacks will be triggered to the default URL, if any.

 

*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

whatsapp

Message DLR Object

Optional

Delivery report (DLR) of the Whatsapp channel

Message DLR Object

Parameter

Type

Mandatory

Notes

messages

[]Whatsapp Message DLR Object

Mandatory

Information relating to the messages for DLR

Whatsapp Message DLR Object

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

ExoStatus Codes

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


Send Whatsapp Payment Message API (India) Beta

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 via WhatsApp in a user-initiated conversation 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, all this is now possible using the Exotel APIs.

Before you start sending the Message with the order details and payment button, you need to complete the setup and follow the steps:

  • Request Access for the Payment APIs for your WhatsApp Business Account - Raise it to Exotel Account Manager
  • Choose and Link the Payment Gateway Account to your WhatsApp Business Account
  • Configure the user journey to purchase the product and initiate the Order Checkout message (You can use our WhatsApp Catalog APIs)
  • Construct the order details message using the API explained below and send the message.

How it Works:

  • Initiating Payment: To kick off the payment process, the business sends an 'order_details' message to the consumer. 
  • Unique Reference ID: Each 'order_details' message carries a unique reference_id provided by the business. 
  • Tracking Order Status: After sending the 'order_details' message, the business patiently awaits payment or transaction status updates directly from the Payment Gateway. 
  • Importance of Payment Signal Update (optional): Updating the user about the payment signal is vital and you can send the payment confirmation message to the users.

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:

POST

https://<your_api_key>:<your_api_token><subdomain>/v2/accounts/<your_sid>/messages

  • Replace <your_api_key> and <your_api_token> with the API key and token created by you.
  • Replace <your_sid> with your “Account sid".
  • Replace <subdomain> with the region of your account
    1. <subdomain> of Singapore cluster is @api.exotel.com
    2. <subdomain> of Mumbai cluster is @api.in.exotel.com

<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": "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"
                                    }
                                }
                            }
                        }
                    }
                }
            }
        ]
    }
}'
import requests
import json

url = "https://{{AuthKey}}:{{AuthToken}}@{{SubDomain}}/v2/accounts/{{AccountSid}}/messages"

payload = json.dumps({
  "whatsapp": {
    "messages": [
      {
        "from": "917217676152",
        "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)

HTTP Response:

  • On success, the HTTP response status code will be 202
  • The Sid is the unique identifier of the message and it will be useful to log this for future debugging
  • the HTTP body will contain a JSON similar to the one below
{
   "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

Metadata Object

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)

Response Object

Parameter Type Mandatory/Optional Notes
whatsapp Channel Response Object Mandatory Response for Whatsapp messages specified in the request

Channel Response Object

Parameter Type Mandatory/Optional Notes
messages []Create Message Response Object Mandatory Array of messages response for each message

Create Message Response Object

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

Error Response Object

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

Message Response Object

Parameter Type Mandatory/Optional Notes
sid String Mandatory SID (Unique identifier) of the single message

HTTP Error codes : 

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 Callbacks 

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.

  • If you pass the status callback URL in send message/template message APIs, status callbacks will be triggered to the respective URL 
  • If you do not pass any status callback URL in send message/template message APIs, status callbacks will be triggered to the default URL, if any.

*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.

 
{
    "whatsapp": {
        "messages": [
            {
                "callback_type": "dlr",
                "sid": "3485XXXXXXXXXXXX",
                "to": "+9188XXXXXXXX",
                "exo_status_code": 25001,
                "exo_detailed_status": "EX_PAYMENT_SUCCESS",
                "description": "Payment Succeeded",
                "timestamp": "2022-12-07T17:00:00.000+05:30",
                "custom_data": "custom_data",
                "payment": {
                    "reference_id": "72XXXXX"
                }
            }
        ]
    }
}

Update Order Status

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.

POST

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)

Send Whatsapp Messages with Flows API Beta

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:

  • Log in to the Meta dashboard and select your WhatsApp Business Manager account where you intend to create the Flow JSON.
  • In the left-side menu, go to the Flows section under Account Tools.
  • Click on the Create Flow button or Start Building Flows. Follow the steps mentioned here to create your JSON Flow under Option 2: Using Flows Builder under the Account Tools section in the Create Flow section  - WhatsApp Flows Integration Guide.

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:

POST

https://<your_api_key>:<your_api_token><subdomain>/v2/accounts/<your_sid>/messages

  • Replace <your_api_key> and <your_api_token> with the API key and token created by you.
  • Replace <your_sid> with your “Account sid".
  • Replace <subdomain> with the region of your account
    1. <subdomain> of Singapore cluster is @api.exotel.com
    2. <subdomain> of Mumbai cluster is @api.in.exotel.com

<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.

whatsapp

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.

Channel Object

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 

Message Object

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

Whatsapp Message Object

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.
For Cloud API, Static third-party outbound stickers are supported in addition to all types of inbound stickers. A static sticker needs to be 512x512 pixels and cannot exceed 100 KB. An animated sticker must be 512x512 pixels and cannot exceed 500 KB.

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.

Text Object

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

Image Object

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.

Audio Object

Parameter Name

Parameter Type

Mandatory/Optional

Value

link

String

Mandatory

Link of the audio to be sent. Use only with HTTP/HTTPS URLs.

Video Object

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.

Document Object

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.

Interactive Object

Parameter Name

Parameter Type

Mandatory/Optional

Value

type

String

Optional

The type of interactive message you want to send. Set this to:

  • flow: Use it for Flow Messages.

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.

Header Object

Parameter Name

Parameter Type

Mandatory/Optional

Value

type

String

Mandatory

The header type you would like to use. Supported values:


  • text: Used for List Messages, Reply Buttons
  • video: Used for Reply Buttons.
  • image: Used for Reply Buttons.
  • document: Used for Reply Buttons.

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.

Body Object

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.

Footer Object

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.

Action Object

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:

  • On success, the HTTP response status code will be 202
  • The Sid is the unique identifier of the message and it will be useful to log this for future debugging
  • the HTTP body will contain a JSON similar to the one below
{
   "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

Metadata Object

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)

Response Object

Parameter

Type

Mandatory/Optional

Notes

whatsapp

Channel Response Object

Mandatory

Response for Whatsapp messages specified in the request

Channel Response Object

Parameter

Type

Mandatory/Optional

Notes

messages

[]Create Message Response Object

Mandatory

Array of messages response for each message

Create Message Response Object

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

Error Response Object

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

Message Response Object

Parameter

Type

Mandatory/Optional

Notes

sid

String

Mandatory

SID (Unique identifier) of the single message

HTTP Error codes : 

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 Callbacks 

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.

  • If you pass the status callback URL in send message/template message APIs, status callbacks will be triggered to the respective URL 
  • If you do not pass any status callback URL in send message/template message APIs, status callbacks will be triggered to the default URL, if any.

*NOTE: Any callback can be received only in one status callback URL at any time.

What is different for Flow Template?

  • The sent message with the Flow button will have the same delivery callbacks as another type of message.
  • But the incoming message callback is different than the other types of WhatsApp messages, please check the Receive Whatsapp Messages section to find the callback sample for the Flow messages.
 
 "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"
       }
     ]
   }
 }

Send Whatsapp Template Messages API

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

POST

https://<your_api_key>:<your_api_token><subdomain>/v2/accounts/<your_sid>/messages

  • Replace <your_api_key> and <your_api_token> with the API key and token created by you.
  • Replace <your_sid> with your “Account sid".
  • Replace <subdomain> with the region of your account
    1. <subdomain> of Singapore cluster is @api.exotel.com
    2. <subdomain> of Mumbai cluster is @api.in.exotel.com

<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.

whatsapp

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.

Channel Object

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 

Message Object

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

Whatsapp Message Object

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

Template Object

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.

Language Object

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).

Component Object

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 Object

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

Image Object

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.

Audio Object

Parameter Name

Parameter Type

Mandatory/Optional

Value

link

String

Mandatory

Link of the audio to be sent.Use only with HTTP/HTTPS URLs.

Video Object

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.

Document Object

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.

DateTime Object

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.

Currency Object

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%A0%C2%A0%C2%A0%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%A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2%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%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%C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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%22deterministic%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%A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2%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

HTTP Response:

  • On success, the HTTP response status code will be 202
  • The Sid is the unique identifier of the message and it will be useful to log this for future debugging
  • the HTTP body will contain an JSON similar to the one below
{
   "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

Metadata Object

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)

Response Object

Parameter

Type

Mandatory/Optional

Notes

whatsapp

Channel Response Object

Mandatory

Response for Whatsapp messages specified in the request

Channel Response Object

Parameter

Type

Mandatory/Optional

Notes

messages

[]Create Message Response Object

Mandatory

Array of messages response for each message

Create Message Response Object

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

Error Response Object

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

Message Response Object

Parameter

Type

Mandatory/Optional

Notes

sid

String

Mandatory

SID (Unique identifier) of the single message

HTTP Error codes : 

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 Callbacks 

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.

  • If you pass status callback URL in send message/template message APIs, status callbacks will be triggered to the respective URL 
  • If you do not pass any status callback URL in send message/template message APIs, status callbacks will be triggered to the default URL, if any.

 

*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

whatsapp

Message DLR Object

Optional

Delivery report (DLR) of the Whatsapp channel

Message DLR Object

Parameter

Type

Mandatory

Notes

messages

[]Whatsapp Message DLR Object

Mandatory

Information relating to the messages for DLR

Whatsapp Message DLR Object

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

ExoStatus Codes

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


Send Whatsapp Template Messages with Flows API Beta

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:

  • Log in to the Meta dashboard and select your WhatsApp Business Manager account where you intend to create the template.
  • In the left-side menu, go to the Templates section under Account Tools.
  • Click on the Create Template button. Choose the Marketing category and select Form as the sub-category.
  • Click on the Create button under the Buttons section. This action opens the Meta Flow Form Builder UI. Design the required form and submit the template for approval.

To send messages to a single number with configured Template message content via Exotel API, make an HTTP POST request to:

POST

https://<your_api_key>:<your_api_token><subdomain>/v2/accounts/<your_sid>/messages

  • Replace <your_api_key> and <your_api_token> with the API key and token created by you.
  • Replace <your_sid> with your “Account sid".
  • Replace <subdomain> with the region of your account
    1. <subdomain> of Singapore cluster is @api.exotel.com
    2. <subdomain> of Mumbai cluster is @api.in.exotel.com

<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.

whatsapp

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.

Message Object

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

Whatsapp Message Object

This will be similar to Whatsapp Native API contracts

Parameter Name

Parameter Type

Mandatory/ Optional

Value

template

Template Object

Mandatory/
Optional

Mandatory when type is template

Template Object

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.

Language Object

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).

Component Object

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 Object

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".
You do not generate a flow token on the Meta dashboard for a Flow created via  Template, so you can pass 0000 for a template with a flow message.

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:

  • On success, the HTTP response status code will be 202
  • The Sid is the unique identifier of the message and it will be useful to log this for future debugging
  • the HTTP body will contain a JSON similar to the one below
{
"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

Metadata Object

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)

Response Object

Parameter

Type

Mandatory/Optional

Notes

whatsapp

Channel Response Object

Mandatory

Response for Whatsapp messages specified in the request

Channel Response Object

Parameter

Type

Mandatory/Optional

Notes

messages

[]Create Message Response Object

Mandatory

Array of messages response for each message

Create Message Response Object

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

Error Response Object

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

Message Response Object

Parameter

Type

Mandatory/Optional

Notes

sid

String

Mandatory

SID (Unique identifier) of the single message

HTTP Error codes : 

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 Callbacks 

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.

  • If you pass the status callback URL in send message/template message APIs, status callbacks will be triggered to the respective URL 
  • If you do not pass any status callback URL in send message/template message APIs, status callbacks will be triggered to the default URL, if any.

*NOTE: Any callback can be received only in one status callback URL at any time

What is different for Flow Template?

  • The sent Template message with the Flow button will have the same delivery callbacks as another type of Template message.
  • But the incoming message callback is different than the other types of WhatsApp messages after the end-user fills and submits the Form on WhatsApp, please check the Receive Whatsapp Messages section to find the callback sample for the Flow messages.
 "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"
       }
     ]
   }
 }

Send bulk Whatsapp Messages API

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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2%A0%C2%A0%C2%A0%5D%0A%C2%A0%C2%A0%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%3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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='
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%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%C2%A0%C2%A0%C2%A0%C2%A0%7D%2C%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%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%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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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%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=',
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%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%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2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%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%3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2%A0%C2%A0%C2%A0%C2%A0%C2%A0%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:

  • On success, the HTTP response status code will be 202
  • The Sid is the unique identifier of the message and it will be useful to log this for future debugging
  • the HTTP body will contain an JSON similar to the one below
   "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

Metadata Object

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)

Response Object

Parameter

Type

Mandatory/Optional

Notes

whatsapp

Channel Response Object

Mandatory

Response for Whatsapp messages specified in the request

Channel Response Object

Parameter

Type

Mandatory/Optional

Notes

messages

[]Create Message Response Object

Mandatory

Array of messages response for each message

Create Message Response Object

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

Error Response Object

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

Message Response Object

Parameter

Type

Mandatory/Optional

Notes

sid

String

Mandatory

SID (Unique identifier) of the single message

HTTP Error codes : 

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 Callbacks 

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.

  • If you pass status callback URL in send message/template message APIs, status callbacks will be triggered to the respective URL 
  • If you do not pass any status callback URL in send message/template message APIs, status callbacks will be triggered to the default URL, if any.

 

*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

whatsapp

Message DLR Object

Optional

Delivery report (DLR) of the Whatsapp channel

Message DLR Object

Parameter

Type

Mandatory

Notes

messages

[]Whatsapp Message DLR Object

Mandatory

Information relating to the messages for DLR

Whatsapp Message DLR Object

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

ExoStatus Codes

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 Whatsapp Messages

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.

  • If you pass receive messages webhook in send message/template message APIs, reply messages from users will be triggered to the respective URL 
  • If you do not pass any receive messages webhook in send message/template message APIs, reply messages from users will be triggered to the default URL, if any.
  • All user initiated conversations and messages which are not a reply on business message, will be triggered to the default URL

*NOTE: Any messages from an user can be received only in one webhook at any time

Webhook Parameter

Parameter

Type

Mandatory

Notes

whatsapp

Message ICM Object

Mandatory

Incoming message callback for Whatsapp

Message ICM Object

Parameter

Type

Mandatory

Notes

messages

[]Whatsapp Message ICM Object

Mandatory

Information relating to the incoming messages from the end-users

Whatsapp Message ICM Object

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

Content Object

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

Media Response Object

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.

Message ICM Error Object

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",
         "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"
           }
         }
       }
     ]
   }
 }

Receive Whatsapp Flow Messages Beta

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.

  • If you pass receive messages webhook in send message/template message APIs, reply messages from users will be triggered to the respective URL 
  • If you do not pass any receive messages webhook in send message/template message APIs, reply messages from users will be triggered to the default URL, if any.
  • All user-initiated conversations and messages that are not a reply to business messages will be triggered to the default URL

*NOTE: Any messages from a user can be received only in one webhook at any time

Webhook Parameter

Parameter

Type

Mandatory

Value

whatsapp

Message ICM Object

Mandatory

Incoming message callback for Whatsapp

Message ICM Object

Parameter

Type

Mandatory

Value

messages

[]Whatsapp Message ICM Object

Mandatory

Information relating to the incoming messages from the end-users

Whatsapp Message ICM Object

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

Content Object

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
galaxy_message - On-Premise 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\"}"
                        }
                    }
                }
            }
        ]
    }
}

Message ICM Error Object

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"
           }
         }
       }
     ]
   }
 }