This API sends a generated WhatsApp template from the WhatsApp Business Account (WABA) to a single recipient or to multiple recipients (up to 20).
Key New Capabilities of V2 version
Marketing and Utility Templates may have a header with text or added media (attached document, image, or video), a footer, and a call for action or quick reply buttons.
The API can also create CommBox object(s), support subchannels, and enable scheduled publishing by adding unix timestamp code to the schedule field (see the 'Send a template with text' example).
Send Templated Message + Object data
Sending any templated WhatsApp message with Object data also creates a conversation (Object) on the CommBox platform.
Note: Adding the ManagerId field with the agent’s Id (optional) will ensure the agent is reflected in various reports. Objects without a managerId will display conversations as being initiated by 'customer'.
The required and optional fields are described here: https://www.commbox.io/api/#operation/Create_Object
Send Templated Message with an Attached Media
There are two ways to do so:
Sending a Templated Message with a link to the file. Example below: 'Send a template with an attachment (doc)'.
ORUse the /whatsapp/uploadmedia/ API endpoint to upload the file to WhatsApp servers and then fetch the uploaded file ID from the response for sending a templated message with the attachment ID. See the 'Send a template with an attachment ID (video)' example.
Authentication Templates
See the Examples for sending an authentication template.
For more information:
API key is needed to authorize requests. You can get your API key via the management console.
A Bearer Token is needed to be set in the Authorization header of every API call.
For additional support you can contact us.
CommBox generated encryption for the channel
{
"data": [
{
"schedule": 1739365010,
"template_data": {
"to": "19172537000",
"template": {
"name": "Text Template",
"language": {
"code": "en"
},
"components": []
}
}
}
]
}
{
"data": [
{
"template_data": {
"to": "19172537000",
"template": {
"name": "Text Template",
"language": {
"code": "en"
},
"components": []
}
},
"object_data": {
"createChildObject": true,
"SubStreamId": 0,
"StatusId": 1,
"ManagerId": 78121,
"Content": {},
"User": {
"UniqueId": "01234567",
"LastName": "Doe",
"FirstName": "John",
"Phone1": "19172537000",
"Email": "John.D@gmail.com",
"Remarks": "Returning customer"
}
}
}
]
}
{
"data": [
{
"template_data": {
"to": "19172537000",
"template": {
"name": "Basic WA template",
"language": {
"code": "en"
},
"components": [
{
"type": "body",
"parameters": [
{
"type": "text",
"text": "Hellooooo"
},
{
"type": "text",
"text": "my friend"
}
]
}
]
}
}
}
]
}
{
"data": [
{
"template_data": {
"to": "972537280000",
"template": {
"name": "Text Header & Body",
"language": {
"code": "he"
},
"components": [
{
"type": "header",
"parameters": [
{
"type": "text",
"text": "text1"
}
]
},
{
"type": "body",
"parameters": [
{
"type": "text",
"text": "text2"
}
]
}
]
}
}
}
]
}
{
"data": [
{
"template_data": {
"to": "972537280801",
"template": {
"name": "ren_text_header_body",
"language": {
"code": "he"
},
"components": [
{
"type": "header",
"parameters": [
{
"type": "text",
"text": "text1"
}
]
},
{
"type": "body",
"parameters": [
{
"type": "text",
"text": "text2"
}
]
}
]
}
},
"object_data": {
"createChildObject": true,
"SubStreamId": 0,
"StatusId": 1,
"ManagerId": 78121,
"Content": {},
"User": {
"UniqueId": "01234567",
"LastName": "Doe",
"FirstName": "John",
"Phone1": "97253720000",
"Email": "John.Doe@gmail.com",
"Remarks": "some remark for user"
}
}
}
]
}
{
"data": [
{
"template_data": {
"to": "972537280801",
"template": {
"name": "multiple_params_in_body",
"language": {
"code": "en_GB"
},
"components": [
{
"type": "body",
"parameters": [
{
"type": "text",
"text": "https://www.commbox.io"
},
{
"type": "text",
"text": "https://www.commbox.io2"
},
{
"type": "text",
"text": "https://www.commbox.io3"
}
]
}
]
}
},
"object_data": {
"createChildObject": true,
"SubStreamId": 0,
"StatusId": 1,
"ManagerId": 78121,
"Content": {},
"User": {
"UniqueId": "01234567",
"LastName": "Doe",
"FirstName": "John",
"Phone1": "97253720000",
"Email": "john.doe@gmail.com",
"Remarks": "some remark for user"
}
}
}
]
}
{
"data": [
{
"template_data": {
"to": "19172537000",
"template": {
"name": "header_image",
"language": {
"code": "en"
},
"components": [
{
"type": "header",
"parameters": [
{
"type": "image",
"image": {
"link": "https://picsum.photos/200"
}
}
]
},
{
"type": "body",
"parameters": [
{
"type": "text",
"text": "hello"
}
]
}
]
}
}
}
]
}
{
"data": [
{
"template_data": {
"to": "19172537000",
"template": {
"name": "test_wisspp_4",
"language": {
"code": "en"
},
"components": [
{
"type": "header",
"parameters": [
{
"type": "image",
"image": {
"link": "https://picsum.photos/200"
}
}
]
}
]
}
},
"object_data": {
"createChildObject": true,
"SubStreamId": 0,
"StatusId": 1,
"ManagerId": 78121,
"Content": {},
"User": {
"UniqueId": "01234567",
"LastName": "Doe",
"FirstName": "John",
"Phone1": "97253720000",
"Email": "John.Doe@gmail.com",
"Remarks": "some remark for user"
}
}
}
]
}
{
"data": [
{
"template_data": {
"to": "19172537000",
"template": {
"name": "image1",
"language": {
"code": "en"
},
"components": [
{
"type": "header",
"parameters": [
{
"type": "image",
"image": {
"id": "614927520593182"
}
}
]
},
{
"type": "body",
"parameters": [
{
"type": "text",
"text": "JPG"
}
]
}
]
}
},
"object_data": {
"createChildObject": true,
"SubStreamId": 0,
"StatusId": 13,
"ManagerId": 78121,
"Content": {},
"User": {
"UniqueId": "01234567",
"LastName": "Doe",
"FirstName": "John",
"Phone1": "97253720000",
"Email": "john.doe@gmail.com",
"Remarks": "some remark for user"
}
}
}
]
}
{
"data": [
{
"template_data": {
"to": "972537280999",
"template": {
"name": "doc1",
"language": {
"code": "en"
},
"components": [
{
"type": "header",
"parameters": [
{
"type": "document",
"document": {
"link": "https://denverzoo.org/wp-content/uploads/2018/09/African-lion.pdf",
"filename": "African-lion.pdf"
}
}
]
},
{
"type": "body",
"parameters": [
{
"type": "text",
"text": "hello"
}
]
}
]
}
}
}
]
}
{
"data": [
{
"template_data": {
"to": "972537280000",
"template": {
"name": "doc1",
"language": {
"code": "en"
},
"components": [
{
"type": "header",
"parameters": [
{
"type": "document",
"document": {
"link": "https://denverzoo.org/wp-content/uploads/2018/09/African-lion.pdf",
"filename": "African-lion.pdf"
}
}
]
},
{
"type": "body",
"parameters": [
{
"type": "text",
"text": "hello"
}
]
}
]
}
},
"object_data": {
"createChildObject": true,
"SubStreamId": 0,
"StatusId": 1,
"ManagerId": 78121,
"Content": {},
"User": {
"UniqueId": "01234567",
"LastName": "Doe",
"FirstName": "Ron",
"Phone1": "19172537000",
"Email": "john.doe@gmail.com",
"Remarks": "some remark for user"
}
}
}
]
}
{
"data": [
{
"template_data": {
"to": "972537280000",
"template": {
"name": "header_doc",
"language": {
"code": "en"
},
"components": [
{
"type": "header",
"parameters": [
{
"type": "document",
"document": {
"id": "550197337025434",
"filename": "file-sample_150kB.pdf"
}
}
]
},
{
"type": "body",
"parameters": [
{
"type": "text",
"text": "PDF"
}
]
}
]
}
},
"object_data": {
"createChildObject": true,
"SubStreamId": 0,
"StatusId": 13,
"ManagerId": 78121,
"Content": {},
"User": {
"UniqueId": "01234567",
"LastName": "Doe",
"FirstName": "John",
"Phone1": "97253720000",
"Email": "John.Doe@gmail.com",
"Remarks": "Just checking"
}
}
}
]
}
{
"data": [
{
"template_data": {
"to": "19172537000",
"template": {
"name": "header_video",
"language": {
"code": "en"
},
"components": [
{
"type": "header",
"parameters": [
{
"type": "video",
"video": {
"link": "http://techslides.com/demos/sample-videos/small.mp4"
}
}
]
},
{
"type": "body",
"parameters": [
{
"type": "text",
"text": "hello"
}
]
}
]
}
}
}
]
}
{
"data": [
{
"template_data": {
"to": "19172537000",
"template": {
"name": "header_video",
"language": {
"code": "en"
},
"components": [
{
"type": "header",
"parameters": [
{
"type": "video",
"video": {
"link": "http://techslides.com/demos/sample-videos/small.mp4"
}
}
]
},
{
"type": "body",
"parameters": [
{
"type": "text",
"text": "hello"
}
]
}
]
}
},
"object_data": {
"createChildObject": true,
"SubStreamId": 0,
"StatusId": 1,
"ManagerId": 78121,
"Content": {},
"User": {
"UniqueId": "01234567",
"LastName": "Doe",
"FirstName": "Ron",
"Phone1": "972537280000",
"Email": "Ron.Doe@gmail.com",
"Remarks": "Sending video files is great"
}
}
}
]
}
{
"data": [
{
"template_data": {
"to": "972537280000",
"template": {
"name": "header_video",
"language": {
"code": "en"
},
"components": [
{
"type": "header",
"parameters": [
{
"type": "video",
"video": {
"id": "27f8b007-7750-418e-9852-b4f8b7f95b9f"
}
}
]
},
{
"type": "body",
"parameters": [
{
"type": "text",
"text": "Video_20221023_111733_014.mp4"
}
]
}
]
}
},
"object_data": {
"createChildObject": true,
"SubStreamId": 0,
"StatusId": 13,
"ManagerId": 78121,
"Content": {},
"User": {
"UniqueId": "01234567",
"LastName": "Lin",
"FirstName": "Robert",
"Phone1": "972537280000",
"Email": "Lin.R34@gmail.com",
"Remarks": "Deal of the day"
}
}
}
]
}
{
"data": [
{
"template_data": {
"to": "972537280000",
"template": {
"name": "Call_a_phone_num_btn",
"language": {
"code": "en"
},
"components": []
}
}
}
]
}
{
"data": [
{
"template_data": {
"to": "972537280000",
"template": {
"name": "Call_a_phone_num_btn",
"language": {
"code": "en"
},
"components": []
}
},
"object_data": {
"createChildObject": true,
"SubStreamId": 0,
"StatusId": 1,
"ManagerId": 78121,
"Content": {},
"User": {
"UniqueId": "01234567",
"LastName": "Doe",
"FirstName": "John",
"Phone1": "9725372800000",
"Email": "John.Doe@gmail.com",
"Remarks": "Contatcts buttons are great"
}
}
}
]
}
{
"data": [
{
"template_data": {
"to": "972537280000",
"template": {
"name": "Call_and_Visit_a_Website_btns",
"language": {
"code": "en"
},
"components": []
}
}
}
]
}
{
"data": [
{
"template_data": {
"to": "972537280000",
"template": {
"name": "Call_and_Visit_a_Website_btns",
"language": {
"code": "en"
},
"components": []
}
},
"object_data": {
"createChildObject": true,
"SubStreamId": 0,
"StatusId": 1,
"ManagerId": 78121,
"Content": {},
"User": {
"UniqueId": "01234567",
"LastName": "Doe",
"FirstName": "John",
"Phone1": "9725372800000",
"Email": "John.Doe@gmail.com",
"Remarks": "Contatcts buttons are great"
}
}
}
]
}
{
"data": [
{
"template_data": {
"to": "972537280000",
"template": {
"name": "static_url",
"language": {
"code": "en"
},
"components": [
{
"type": "body",
"parameters": [
{
"type": "text",
"text": "Name"
}
]
}
]
}
}
}
]
}
{
"data": [
{
"template_data": {
"to": "19172537000",
"template": {
"name": "static_url",
"language": {
"code": "en"
},
"components": [
{
"type": "body",
"parameters": [
{
"type": "text",
"text": "Name"
}
]
}
]
},
"object_data": {
"createChildObject": true,
"SubStreamId": 0,
"StatusId": 1,
"ManagerId": 78121,
"Content": {},
"User": {
"UniqueId": "01234567",
"LastName": "Fox",
"FirstName": "Johnny",
"Phone1": "9725372800000",
"Email": "john.fox53@gmail.com",
"Remarks": "Static URL is great"
}
}
}
}
]
}
{
"data": [
{
"template_data": {
"to": "972537280000",
"template": {
"name": "dynamic_url",
"language": {
"code": "en"
},
"components": [
{
"type": "button",
"sub_type": "url",
"index": 0,
"parameters": [
{
"type": "text",
"text": "api"
}
]
},
{
"type": "body",
"parameters": [
{
"type": "text",
"text": "name"
}
]
}
]
}
}
}
]
}
{
"data": [
{
"template_data": {
"to": "19172537000",
"template": {
"name": "url_dyn",
"language": {
"code": "en"
},
"components": [
{
"type": "button",
"sub_type": "url",
"index": 0,
"parameters": [
{
"type": "text",
"text": "api"
}
]
},
{
"type": "body",
"parameters": [
{
"type": "text",
"text": "name"
}
]
}
]
},
"object_data": {
"createChildObject": true,
"SubStreamId": 0,
"StatusId": 1,
"ManagerId": 78121,
"Content": {},
"User": {
"UniqueId": "01234567",
"LastName": "Fox",
"FirstName": "Johnny",
"Phone1": "9725372800000",
"Email": "john.fox53@gmail.com",
"Remarks": "Dynamic URL is great"
}
}
}
}
]
}
{
"data": [
{
"template_data": {
"to": "972537280000",
"template": {
"name": "3 buttons",
"language": {
"code": "en"
},
"components": [
{
"type": "body",
"parameters": [
{
"type": "text",
"text": "name"
}
]
}
]
}
}
}
]
}
{
"data": [
{
"template_data": {
"to": "972537280000",
"template": {
"name": "3 buttons",
"language": {
"code": "en"
},
"components": [
{
"type": "body",
"parameters": [
{
"type": "text",
"text": "name"
}
]
}
]
},
"object_data": {
"createChildObject": true,
"SubStreamId": 0,
"StatusId": 1,
"ManagerId": 78121,
"Content": {},
"User": {
"UniqueId": "01234567",
"LastName": "Doe",
"FirstName": "John",
"Phone1": "9725372800000",
"Email": "John.Doe@gmail.com",
"Remarks": "Quick Reply with 3 Buttons is great"
}
}
}
}
]
}
{
"data": [
{
"template_data": {
"to": "972537280000",
"template": {
"name": "auth_template",
"language": {
"code": "en"
},
"components": [
{
"type": "button",
"sub_type": "url",
"index": 0,
"parameters": [
{
"type": "text",
"text": "name"
}
]
},
{
"type": "body",
"parameters": [
{
"type": "text",
"text": "name"
}
]
}
]
}
}
}
]
}
{
"data": [
{
"template_data": {
"to": "972537280000",
"template": {
"name": "auth_template",
"language": {
"code": "en"
},
"components": [
{
"type": "button",
"sub_type": "url",
"index": 0,
"parameters": [
{
"type": "text",
"text": "COPY"
}
]
},
{
"type": "body",
"parameters": [
{
"type": "text",
"text": "455455"
}
]
}
]
}
},
"object_data": {
"createChildObject": true,
"SubStreamId": 0,
"StatusId": 1,
"ManagerId": 387123,
"Content": {},
"User": {
"UniqueId": "01234567",
"LastName": "Fox",
"FirstName": "David",
"Phone1": "9725372800000",
"Email": "david.fox53@gmail.com",
"Remarks": "Looking for a new device"
}
}
}
]
}
(Optional) Enter a Unix timestamp code for the desired scheduled date. Leaving it empty will send the template immediately.
The recipient's phone number in international format
Template configuration
Name of the approved WhatsApp template
Specifies the language of the template
Language code used by Meta. For example 'en_us'
Components may include the body, header, footer, and buttons of the template
The type of component. In this example 'body'
Represents a single parameter for the placeholder
The type of parameter. WhatsApp supports "text", "image", “video”, and "document" parameters.
the text entered in the parameter for example "John"
Components may include the body, header, footer, and buttons of the template
The type of component. In this example 'header'
Represents a single parameter for the placeholder
The type of parameter (e.g. image). WhatsApp supports "text", "image", “video”, and "document" parameters.
Instead of the link, enter media id provided by META when using the Whatsapp_uploadMedia API (e.g. 1628862997611773)
Represents a single parameter for the placeholder
The type of parameter. WhatsApp supports "text", "image", “video”, and "document" parameters.
Represents a single parameter for the placeholder
The type of parameter. WhatsApp supports "text", "image", “video”, and "document" parameters.
The URL of the PDF attachment (e.g. https://denverzoo.org/wp-content/uploads/2018/09/African-lion.pdf).
The file's name (e.g. African-lion.pdf)
The channel's ID
The subchannel's ID. When there are no subchannels, value is 0
Status of conversation - see Enums
ID of the agent
Content of the message
Unique identifier of the customer such as Social Security number or national ID, or a unique ID generated by the organization
Phone number including country code
Operation successful
Recipient number
Object ID. This is a commbox generated number (optional)
Provider returned failure
Recipient number
Object ID. This is a commbox generated number (optional)
Recipient number
Provider returned failure
Recipient number
Unauthorized - The supplied credentials, if any, are not sufficient to access the resource
Not found - The requested resource is not found
Too Many Requests - Too many requests have been made in a short period of time (Throttling)
Server Error - The server could not return the representation due to an internal server error
Not Implemented - The requested operation is not supported