WhatsApp API

Understand various WhatsApp message types supported by Webex Connect and access API Payloads for sending these messages to your customers.

📘

Please note:

  • WhatsApp channel is supported via Webex Connect Messaging API v1. The endpoint for it is: [https://{YourRegion}.webexconnect.io/resources/v1/messaging].

    Please modify YourRegion in the URL to reflect your tenant’s region. See Know your endpoint page.

  • Please note that proactive outbound messaging on WhatsApp requires Template Registration and Approval using the Templates Module within Webex Connect.

  • While the payload samples for various message types are covered below, you can use our Try It feature (click on the Message Type name to get routed to it) to send some test messages. You would be required to provide the WhatsApp asset details, service key, template content, etc. from your account to use this. This apart you can use our Postman Collection for trying variations that are not covered through the Try It feature.

Types of WhatsApp Messages Supported

Here's a list of WhatsApp message types supported by Webex Connect with payload samples. Click the hyperlinks below to see the API documentation for each of the message types.

Used for responding to an incoming customer message, or follow-up messages within the 24-hour reply window as per WhatsApp's messaging guidelines.

{
   "appid": "<appid>",
   "deliverychannel": "whatsapp",
     "channels": {
      "OTT-Messaging": {
         "wa": {
             "type": "text",
            "preview_url":"true",
             
            "text" :{
                "body" : "<message-body>"
            },  
           	"identity_key_hash":"<identity-key-hash-value>"//Optional. Pass this value to validate the identity of your customer.
         }
		}
	},
   "destination": [
      {
         "waid": [
            "<waid>"
         ]
      }
   ]
}
ParameterMandatoryDescription
textYesContains the body field that you can use to pass the message content. The message can contain URLs and text formatting tags.
typeYesSpecifies that message type. E.g., text.
preview_urlNoOptions: false (default), true

To include a URL preview, set preview_url to true and make sure the URL begins with http:// or https://. If multiple URLs are in the body text string, only the first URL will be rendered. Follow the guidelines mentioned in this page to make sure the URL preview is rendered by WhatsApp.
identity_key_hashNoPass this value to validate the identity of your customer. More details on Identity Key Hash feature are documented here.

Used for responding to an incoming customer message, or follow-up messages within the 24-hour reply window as per WhatsApp's messaging guidelines. Use this option when you want to send a response message with image, document, audio, video, or sticker.

The audio, document, image, video and sticker objects

{
    "appid": "<appid>",
    "deliverychannel": "whatsapp",
    "channels": {
        "OTT-Messaging": {
            "wa": {
                "type": "audio",
                "audio": {
                    "url": "<your-media-url>",
                    "mimeType": "<audio/m4a>"
                },  
           	"identity_key_hash":"<identity-key-hash-value>"//Optional. Pass this value to validate the identity of your customer.
            }
        }
    },
    "destination": [
        {
            "waid": [
                "<waid>"
            ]
        }
    ]
}
{
    "appid": "<appid>",
    "deliverychannel": "whatsapp",
    "channels": {
        "OTT-Messaging": {
            "wa": {
                    "type": "document",
                    "document": {
                        "url": "<your-media-url>",
                        "mimeType": "<your-mime-type>",
                        "filename": "<filename of the document>"
                    }
                }
            }
        },
        "destination": [
            {
                "waid": [
                    "<waid>"
                ]
            }
        ]
    }
{
   "appid": "<appid>",
   "deliverychannel": "whatsapp",
   "channels": {
      "OTT-Messaging": {
         "wa": {
             "type": "image",
            "image" :{
                "url" : "<your-image-url>",
                 "caption" : "<jPEG Check>",                 
                "mimeType" : "<image/JPEG>"
            }    
         }
      }
   },
   "destination": [
      {
         "waid": [
            "{{waid}}"
         ]
      }
   ]
}
{
   "appid": "<appid>",
    "notifyurl":"https://requestinspector.com/inspect/01dqex3yafr847kxmdk2dj7h22",
   "deliverychannel": "whatsapp",
   "channels": {
      "OTT-Messaging": {
         "wa": {
             "type": "video",
             "video": {
                "url" : "<your-media-url>",
                "caption" : "<jPEG Check>",
                "mimeType" : "<VIDEO/MP4>        
            }
            
         }
      }
   },
   "destination": [
      {
         "waid": [
            "<waid>"
         ]
      }
   ]
}
{
    "appid": "<appid>",
    "deliverychannel": "whatsapp",
    "channels": {
        "OTT-Messaging": {
            "wa": {
                "type": "sticker",
                "sticker": {
                    "url": "<your-sticker-url>",
                    "mimeType": "<image/WEBP>"
                }
            }
        }
    },
    "destination": [
        {
            "waid": [
                "<waid>"
            ]
        }
    ]
}
ParameterMandatoryDescription
typeYes, when type is image, audio, document or stickerimage, audio, document, video or sticker. Refer below table to know more about each of these types.
captionNoDescribes the specified image, video, or document media. Do not use with audio or sticker media.
urlyesDirect URL pointing to the media file. The URL should end with specified file-format.

You can use our Media manager under Tools to upload a file and get a public URL.
mimeTypeyesSupported mime types. Find more details here
identity_key_hashNoPass this value to validate the identity of your customer. More details on Identity Key Hash feature are documented here.

Additional details for the various media message types:

ParameterMandatoryDescriptionMaximum Size
audioYes, when "type": "audio".The media object containing audio.
Supported audio formats are AAC, MP4, MPEG, AMR,
OGG; codecs=opus
Note: The base ogg type is not supported.
OPUS is deprecated.
16 MB
documentYes, when "type": "document".The media object containing a document.
Supported document formats are TXT, PDF, XLS, DOC, PPT, XLS(X), DOC(X) and PPT(X), The media object containing a XLS(X) file
100 MB
imageYes, when "type": "image".The media object containing an image.
Supported image formats are JPEG and PNG
5 MB
videoYes, when "type": "video"The media object containing a video. Supported formats are 3GPP and MP4
Notes:
Only H.264 video codec and AAC audio codec is supported.
WhatsApp support videos with a single audio stream or no audio stream.
16 MB
stickerYes, when "type":"sticker"The media object containing a sticker. Supported format WEBPStatic stickers: 100KB

Animated stickers: 500KB

👍

WhatsApp Media Best Practices

  • While uploading the media and setting the mime-type make sure you are following the guidelines mentioned in this documentation.
  • The publicly accessible URL used while configuring the message must end in the same file format set under the 'File MIME type'. It should not have any geo-restriction and should be accessible from a server located within USA premises.
  • Supported incoming media message mime-types are identical to outbound message media mime-types in Send node and Messaging API. The mime-type of the incoming media message can be captured as part of the following:
    • Start node and Receive node output variable i.e., "whatsApp.mimetype",
    • Outbound webhooks, Debug logs and Export logs with JSON path "attachments.mime_type"
  • WebP is a modern image format that provides superior lossless compression and creates smaller and richer images that makes web faster. The source libraries to use for converting an image to WebP file-format are available here. You can also use various third-party converters publicly available to convert images to WebP file-format.

Share location as a message on WhatsApp to your customers. This message type can be sent within 24 hour window after a customer-initiated message.

{
    "deliverychannel": "whatsapp", //Channel used to send the message i.e., whatsapp in this case.
    "appid": "{{WAAppid}}", //Contains the applicationid
    "destination": [
        {
            "waid": [
                "{{waid}}" //WhatsApp ID or phone number for the person you want to send a message to.
            ]
        }
    ],
    "channels": {
        "OTT-Messaging": {
            "wa": {
                "type": "location", //Specifies the message type. The value needs to be 'location' for sending location messages.
                "location": {
                    "longitude": 0.0, //Longitude of the location
                    "latitude": 0.0, //Latitude of the location
                    "name": "", //Name of the location
                    "address": "" //Address of the location. Only displayed if name is present.
                },  
           	"identity_key_hash":"<identity-key-hash-value>"//Optional. Pass this value to validate the identity of your customer.
            }
        }
    },
    "correlationid": "", //The correlationid is a unique identifier that you can attach to every request as a reference a particular transaction or event. This is configured as a part of the request.
    "callbackData": "", //Data that you have configured to receive on the notify Url. This is configured as a part of the request.
    "notifyurl": "" //Configure a URL to get notifications on delivery reports for a WhatsApp message. This field accepts only a valid URL or a variable. If an invalid URL is passed in API request or via a variable, then such request will not be considered eligible for retries.
}

Parameters

ParameterMandatoryDescription
typeYesSpecifies the message type. The value needs to be 'location' for sending location messages.
longitudeYesLongitude of the location
latitudeYesLatitude of the location
nameNoName of the location
addressNoAddress of the location. Only displayed if name is present.
identity_key_hashNoPass this value to validate the identity of your customer. More details on Identity Key Hash feature are documented here.

Share contacts on WhatsApp to your customers. This message type can be sent within 24 hour window after a customer initiated message

{
    "deliverychannel": "whatsapp", //Channel used to send the message i.e., WhatsApp in this case.
    "appid": "{{WAAppid}}", //Contains the applicationid
    "destination": [
        {
            "waid": [
                "{{waid}}" //WhatsApp ID or phone number for the person you want to send a message to.
            ]
        }
    ],

    "channels": {
        "OTT-Messaging": {
            "wa": {  
           	    "identity_key_hash":"<identity-key-hash-value>", //Optional. Pass this value to validate the identity of your customer.
                "type": "contacts", //Specify the message type
                "contacts": [
                    {
                        "addresses": [
                            {
                                "city": "", //City name
                                "country": "", //Full country name
                                "country_code": "", //Two-letter country abbreviation
                                "state": "", //State abbreviation
                                "street": "", //Street number and name
                                "type": "", //Standard Values: HOME, WORK
                                "zip": "" //ZIP code
                            }
                        ],
                        "birthday": "", //YYYY-MM-DD formatted string
                        "emails": [
                            {
                                "email": "", //Email address
                                "type": "" //Standard Values: HOME, WORK
                            }
                        ],
                        "name": {
                            "first_name": "", //First name
                            "formatted_name": "", //Full name as it normally appears. At least one of the optional parameters needs to be included along with the formatted_name parameter.
                            "last_name": "" //Last name
                        },
                        "org": {
                            "company": "", //Name of the contact's company
                            "department": "", //Name of the contact's department
                            "title": "" //Contact's business title
                        },
                        "phones": [
                            {
                                "phone": "", //Contact phone number
                                "type": "" //Standard Values: CELL, MAIN, IPHONE, HOME, WORK
                            }
                        ],
                        "urls": [
                            {
                                "url": "", //URL
                                "type": "" //Standard Values: HOME, WORK
                            }
                        ]
                    }
                ]
            }
        }
    },
    "correlationid": "", //The correlationid is a unique identifier that you can attach to every request as a reference a particular transaction or event. This is configured as a part of the request.
    "callbackData": "", //Data that you have configured to receive on the notify Url. This is configured as a part of the request.
    "notifyurl": "" //Configure a URL to get notifications on delivery reports for a WhatsApp message. This field accepts only a valid URL or a variable. If an invalid URL is passed in API request or via a variable, then such request will not be considered eligible for retries.
}
Parameter / ObjectParameters within an objectDescriptionMandatory
typeSpecifies the message type. The value needs to be 'location' for sending location messages.Yes
addressesFull contact address(es)No
streetStreet number and nameNo
cityCity nameNo
stateState abbreviationNo
zipZIP codeNo
countryFull country nameNo
country_codeTwo-letter country abbreviation
typeStandard Values: HOME, WORKNo
birthdayYYYY-MM-DD formatted stringNo
emailsContact email address(es)No
emailEmail addressNo
typeStandard Values: HOME, WORKNo
nameFull contact nameNo
formatted_nameFull name as it normally appearsYes, At least one of the optional parameters needs to be included along with the formatted_name parameter.
first_nameFirst nameOptional*
last_nameLast nameOptional*
middle_nameMiddle nameOptional*
suffixName suffixOptional*
prefixName prefixOptional*
orgContact organization informationNo
companyName of the contact's companyNo
departmentName of the contact's departmentNo
titleContact's business titleNo
phonesContact phone number(s)No
phoneAutomatically populated with the wa_id value as a formatted phone number.No
typeStandard Values: CELL, MAIN, IPHONE, HOME, WORKNo
wa_idWhatsApp IDNo
urlsContact URL(s)No
urlURLNo
typeStandard Values: HOME, WORKNo
identity_key_hashPass this value to validate the identity of your customer. More details on Identity Key Hash feature are documented here.No

List Message includes a menu of up to 10 options. This type of message offers a simpler and more consistent way for users to make a selection when interacting with a business.

{
	"appid": "a_164378787967582270",
	"deliverychannel": "whatsapp",
	"channels": {
		"OTT-Messaging": {
			"wa": {      
      	"identity_key_hash":"<identity-key-hash-value>",//Optional. Pass this value to validate the identity of your customer.
				"type": "list",
				"list": {
					"header": {
						"type": "text",
						"text": "List header message content"
					},
					"body": {
						"text": "Body message content for list "
					},
					"footer": {
						"text": "Footer message content"
					},
					"action": {
						"button": "List button title",
						"sections": [{
								"title": "section-title1",
								"rows": [{
									"id": "unique-row-identifier1",
									"title": "row-title-content1",
									"description": "row-description-content1"
								}]
							},
							{
								"title": "section-titl1e2",
								"rows": [{
									"id": "unique-row-identifier2",
									"title": "row-title-content2",
									"description": "row-description-content2"
								}]
							}
						]
					}
				}
			}
		}
	},
	"destination": [{
		"waid": ["XXXXXXXXXX"]
	}]
}
Parameter / ObjectParameters within an objectMandatoryDescription
type
headerOptional
textContains the text for the header. Maximum of 60 characters is supported for text.
bodytextYesBody of the message. Maximum of 1024 characters is supported.
footertextOptionalContains the footer text message.
action
buttonYesA button field with your button’s content. Maximum of 20 characters is supported.
titleYesA title for the button
idYesA unique identification number for the button
descriptionYesContains the description for the action
identity_key_hashNoPass this value to validate the identity of your customer. More details on Identity Key Hash feature are documented here.

Reply Buttons Message includes up to 3 options —each option is a button. This type of message offers a quicker way for users to make a selection from a menu when interacting with a business. Reply buttons have the same user experience as interactive templates with buttons.

{
	"appid": " a_164378787967582270",
	"deliverychannel": "whatsapp",
	"channels": {
		"OTT-Messaging": {
			"wa": {
       	"identity_key_hash":"<identity-key-hash-value>",//Optional. Pass this value to validate the identity of your customer.
				"type": "reply",
				"reply": {
					"header": {
						"type": "image",
						"text": "Reply button your text",
						"document": {
							"url": "http://www.africau.edu/images/default/sample.pdf",
							"provider": {
								"name": "provider-name"
							},
							"filename": "some-file-name"
						},
						"video": {
							"url": "https://file-examples-com.github.io/uploads/2017/04/file_example_MP4_480_1_5MG.mp4",
							"provider": {
								"name": "provider-name"
							}
						},
						"image": {
							"url": "https://4.img-dpreview.com/files/p/E~TS590x0~articles/3925134721/0266554465.jpeg",
							"provider": {
								"name": "provider-name"
							}
						}
					},
					"body": {
						"text": "Body text mssage"
					},
					"footer": {
						"text": "Footer text message"
					},
					"action": {
						"buttons": [{
								"type": "reply",
								"reply": {
									"id": "ButtonId1",
									"title": "First Button"
								}
							},
							{
								"type": "reply",
								"reply": {
									"id": "ButtonId2",
									"title": "Secound Button"
								}
							},
							{
								"type": "reply",
								"reply": {
									"id": "ButtonId3",
									"title": "Third Button"
								}
							}
						]
					}
				}
			}
		}
	},
	"destination": [{
		"waid": ["XXXXXXXXXX"]
	}]
}
Parameter / ObjectParameters within an objectMandatoryDescription
type
replyYesSpecifies the message type.
header
textYesContains the text for the header. Maximum of 60 characters is supported for text.
imageYesContains the URL of the image
videoYesContains the URL of the video
documentYesContains the URL of the document
bodytextYesBody of the message. Maximum of 1024 characters is supported.
footertextOptionalContains the footer text message.
action
buttonYesA button field with your button’s content.
typeYes
idYesA unique identification number for the button
titleYesA title for the button
identity_key_hashNoPass this value to validate the identity of your customer. More details on Identity Key Hash feature are documented here.

Send business initiated messages using message templates beyond the 24 hour window to your customers. This message type includes text based templates without a header, footer or buttons.

❗️

HSM Message Deprecation Alert

WhatsApp has announced that they will be deprecating the HSM message type sometime in early 2022. We recommend you to use Template message type instead of HSM messages, and migrate any existing HSMs to Template Message type. Unlike HSM which was meant to be used only for text messages, Template message type can be used to configure template messages of multiple components including text.

ParameterMandatoryDescription
typeYes (for Message Templates)The type of message being sent
hsmYes (for Message Templates)The containing element for the message content — Indicates that the message is highly structured. Parameters contained within provide the structure.

The hsm object (To be Deprecated by WhatsApp by Early 2022)

{
	"appid": "{{appid}}",
	"deliverychannel": "whatsapp",
	"channels": {
		"OTT-Messaging": {
			"wa": {
      	"type": "hsm",
                "hsm": {
                    "namespace": "59ae27be_a774_420c_18ae_22040d30978f",
                    "element_name": "chaitanya",
                    "language": {
                        "code": "en",
                        "policy": "deterministic"
                    },
                    "localizable_params": [{
                        "default": "Chaitanya"
                    },
                    {
                        "default": "Marella"
                    }]
				}
			}
		}
	},
	"destination": [{
		"waid": ["{{waid}}"]
	}]
}

🚧

Some of the below values such as namespace, element_name, etc. are not available on imiconnect platform UI and need to be taken from WhatsApp Business Manager by reaching out to your regional support team. However, you wouldn't need it as we now recommend you to use Template message type instead of HSM.

Parameter / ObjectParameters within an objectMandatoryDescription
namespaceYesYesThe namespace that will be used.
element_nameYesYesThe element name that indicates which template to use within the namespace.
languageThe language parameter sets the language policy for a Message Template.
policyYesOptions:

_ deterministic — Deliver the Message Template in exactly the language and locale asked for.

_ fallback (Deprecated) — Deliver the Message Template in the language that matches the user's language/locale setting on the device. If one can't be found, deliver using the specified fallback language.
codeYesThe code of the language or locale to use — Accepts both language and language_locale formats (e.g., en and en_US).
localizable_paramsYesYesThis field is an array of values to apply to variables in the template
See the Localizable Parameters section for more information.

❗️

WhatsApp Language Policy Change

Please note that the fallback language policy has been deprecated and the deterministic language policy is now the default policy. Do not use 'fallback' language policy while sending HSMs as it may lead to message delivery failures.

  • Localizable Parameters

When sending a Message Template, the hsm object is required. To define Message Templates, you specify a namespace and an element_name pair that identify a template. Templates have parameters that will be dynamically incorporated into the message. For the example used in this document, the Message Template looks like this:

ParametersTypeMandatoryDescription
defaultStringYesDefault text if localization fails
currencycurrency objectNoIf the currency object is used, it contains required parameters currency_code and amount_1000.
date_timedate_time objectNoIf the date_time object is used, further definition of the date and time is required.

Send business initiated messages using message templates beyond the 24 hour window to your customers. A message template can be text-based, media-based, or interactive.Used for sending proactive messages (including text-only, text with media or other components such as Header, Footer, Images, Document, Video, Call-to-Action Buttons, and/or Quick Replies).

Used for send proactive messages (including text-only, text with media or other components such as Header, Footer, Images, Document, Video, Call-to-Action Buttons, and/or Quick Replies).

🚧

Template API usage

The template should be registered and approved from Tools -> Templates section within imiconnect platform, before it can be used to send notification messages. You can also use interactive message templates like Call-To-Action buttons or Quick Replies buttons.

The following includes Template API definition and various samples. The API structure is dynamic and varies based on the parameters defined in the template at the time of template creation.

{
    "appid": "a_157967534853754560",
    "deliverychannel": "whatsapp",
    "message": {
        "template": "5139722425xxxxx", //Configure Template Id. Template Id can be fetched from the Tools - Template listing page.//

        "parameters": {

            //Header Configuration - Configure either Text Header or Media Header i.e. Image Video or Document

            "image/video/document": {
                "link": "http://mattfarmer.net/projects/thickbox/images/plant4.jpg"
            }, //Configure Media header variable. Configure parameter key as image video or document for a image video or document type header
            //or

            "headerText": "This is a sample Header text", //Configure Text header variable. Configured parameter key <headerText> is the name of the variable specified during template creation
            //Body configuration - Configure from simple text variables or localisable variables i.e. Time or Currency.


            "movie": "joker", //Simple text variable. Configured parameter key <movie> is the name of the variable specified during template creation
            "venue": "hyderabad",
            "seat1": "balcony",
            "seat2": "first class",

            "time": {
                "type": "date_time",
                "fallback_value": "Feb 20th, 2023 8:45pm",
                "timestamp": "1782231500"
            }, //Localisable time variable. Configured parameter key <time> is the name of the variable specified during template creation

            "purchase_value": {
                "type": "currency",
                "currency_code": "USD",
                "amount_1000": "150000",
                "fallback_value": "EUR 300"
            }, //Localisable currency variable. Configured parameter key <purchase_value> is the name of the variable specified during template creation


            //Buttons Configuration. Configure either CTA button variable Quick Replies or OTP button.

            //Configure CTA button URL variable

            "ctaVariable": { //CTA button dynamic URL configuration. Configured parameter key <ctaVariable> is the name of the variable specified during template creation.
                "type": "url",
                "payload": "url_extension" //Specify Dynamic Extenstion of the URL
            }, 

            //Configure upto three quick reply buttons
            
            "quickReply": [
                {
                    "button_text": "Button 1", //Configure the value of the <buttontext> as the name of the button specified during template creation here.
                    "payload": "BUTTON 1 PAYLOAD" //Configure unique button payload. This will be returned back as part of Postback event in Webex Connect incoming components.
                },
                {
                    "button_text": "Button 2",
                    "payload": "BUTTON 2 PAYLOAD"
                },
                {
                    "button_text": "Button 3",
                    "payload": "BUTTON 3 PAYLOAD"
                }
            ],

           //Configure value of the OTP. This is applicable only in case of Authentication template.
    	  		   "otp": {
                 			 "type": "otp",
                 			 "value": "12xxxx"
                 }

        }
    },
    "channels": {
          "OTT-Messaging": {
            "wa": {
                "identity_key_hash": "njbYlYcxxxxx" //Optional. Pass this value to validate the identity of your customer.
            }
        }
    },
    "destination": [
        {
            "waid": [
                "9177xxxxxxxx"
            ]
        }
    ]
}
{
    "appid": "a_157967534853754560",
    "deliverychannel": "whatsapp",
    "message": {
        "template": "513972242591830",
        "parameters": {
            "text-header":"Your Header text",
            "name": "John Smith",
            "update":"Sample account update"
            }
        },
    "destination": [
        {
            "waid": [
                "9177xxxxxxxx"
            ]
        }
    ]
}
{
    "appid": "a_157967534853754560",
    "deliverychannel": "whatsapp",
    "message": {
        "template": "513972242591830",
        "parameters": {
            "image": {
                "link": "http://mattfarmer.net/projects/thickbox/images/plant4.jpg"             
            },
            "movie": "joker",
            "venue": "hyderabad",
            "seat1": "balcony",
            "seat2": "first class",
            "time": {
                "type": "date_time",
                "fallback_value": "Feb 20th, 2023 8:45pm",
                "timestamp": "1782231500"
            },
            "purchase_value": {
                "type": "currency",
                "currency_code": "USD",
                "amount_1000": "150000",
                "fallback_value": "EUR 300"
                }
            }
        },
    "destination": [
        {
            "waid": [
                "9177xxxxxxxx"
            ]
        }
    ]
}
{
    "appid": "a_157967534853754560",
    "deliverychannel": "whatsapp",
    "message": {
        "template": "513972242591830",
        "parameters": {
            "video": {
                "link": "http://mattfarmer.net/xxxxxx.mp4"             
              },
            "name": "John Smith",
            "about": "Sample Tutorial Video"
            }
        },
    "destination": [
        {
            "waid": [
                "9177xxxxxxxx"
            ]
        }
    ]
}
{
    "appid": "a_157967534853754560",
    "deliverychannel": "whatsapp",
    "message": {
        "template": "513972242591830",
        "parameters": {
            "document": {
                "link": "http://mattfarmer.net/projects/thickbox/images/plant4.jpg",
                "filename":"Sample Statement"            
            },
            "name": "John Smith",
            "ticketId": "act1890831",
            "time": {
                "type": "date_time",
                "fallback_value": "Feb 20th, 2020 8:45pm",
                "timestamp": "1582231500"
            },
            "purchase_value": {
                "type": "currency",
                "currency_code": "USD",
                "amount_1000": "150000",
                "fallback_value": "EUR 300"
                }
            }
        },
    "destination": [
        {
            "waid": [
                "9177xxxxxxxx"
            ]
        }
    ]
}
ParameterMandatoryDescription
appidYesRefers to WhatsApp asset id. You can obtain this from the Apps page on the platform.
templateYesRefers to template id. You can obtain this from Tools --> Templates section on the platform.
parametersYes *The block that contains the template parameters.
destinationYesThe mobile number on which the WhatsApp message will be sent

📘

Parameters Object Configuration

The parameters object should be configured depending on how the variables were configured at the time of template creation for a given template. Refer below to configure Header, Body and Button parameters.


Parameter nameDescriptionMandatory
identity_key_hashPass this value to validate the identity of your customer. More details on Identity Key Hash feature are documented here.No

Header Parameters Configuration - Configure either Text Header or Media Header i.e. Image Video or Document

Parameter nameDescriptionObject Configuration
image/video/documentConfigure Media header variable. Configure parameter key as image video or document for a image video or document type headerlink: The media URL of the image, video or document ending with the file format. This is a mandatory parameter. Refer to this page for more details about mime-type and media size
headerTextConfigure Text header variable. Configured parameter key should be the name of the variable specified during template creation.NA

Body Parameters configuration - Configure from simple text variables or localisable variables i.e. Time or Currency

Parameter nameDescriptionObject Configuration
movie/venue/seat1/seat2Simple text variable. Configured parameter key for e.g., should be the name of the variable specified during template creation. NA
timeLocalisable time variable. Configured parameter key Fallback_value: The fallback value that appears to the customer when the localization fails. This is a mandatory parameter.
Timestamp: UNIX epoch timestamp that is used to calculate the localized date and time. Go to epoch convertor for timestamp conversion.
purchase_valueLocalisable currency variable. Configured parameter key <purchase_value> should be the name of the variable specified during template creation. type: Parameter indicates the type as "currency".
currencycode: The currency code for e.g., USD, EUR, INR, etc.
amount1000: The actual amount multiplied by 1000.
fallback_value: The fallback value that appears to the customer when the localization fails.
Note: All parameters are mandatory

Buttons Parameter configuration - Configure a CTA button variable, Quick Replies or an OTP button.

Parameter nameDescriptionObject Configuration
ctaVariableCTA button dynamic URL configuration. Configured parameter key should be the name of the variable specified during template creation. type: Extension of the URL in case of CTA buttons. It cannot be the domain of the URL.
payload: Specify Dynamic Extension of the URL
Note: All parameters are mandatory
quickReplyConfigure upto three quick reply buttons. Specify parameter key as 'quickReply'. button_text: Configure the value of the as the name of the button specified during template creation here.
payload: Configure unique button payload. This will be returned back as part of Postback event in Webex Connect incoming components.
Note: All parameters are mandatory
otpConfigure value of the OTP. This is applicable only in case of Authentication template. Specify parameter key as 'otp'. type: specify type as ‘otp' under the otp object to pass the code value within the 'value field’.
value: Configure the OTP value without spaces with maximum character supported upto 15 characters.
Note: All parameters are mandatory
{
   "appid":"a_160730369477132030",
   "deliverychannel":"whatsapp",
   "message":{
      "template":"1024406451379326",
      "parameters":{
        
         "name": "John Smith",

         "URLvariable1":{
            "type":"url",
            "payload":"<<url_extension>>"
         }
      }
   },
   "destination":[
      {
         "waid":[
            "9199xxxxxxxx"
         ]
      }
   ]
}
{
   "appid":"a_161007122569873440",
   "deliverychannel":"whatsapp",
   "message":{
      "template":"244219340449xxx",
      "parameters":{
         "quickReply":[
            {
               "button_text":"Button 1",
               "payload":"<<button 1 payload>>"
            },
            {
               "button_text":"Button 2",
               "payload":"<<button 2 payload>>"
            },
            {
               "button_text":"Button 3",
               "payload":"<<button 3 payload>>"
            }
         ]
      }
   },
   "destination":[
      {
         "waid":[
            "9199xxxxxxxx"
         ]
      }
   ]
}

{
  "deliverychannel": "whatsapp",
  "message": {
    "template": "91853941324xxxx",
    "parameters": {
      "otp": {
        "type": "otp",
        "value": "12xxxx"
      }
    }
  },
  "appid": "a_16837973776898xxxx",
  "destination": [
    {
      "waid": [
        "91809612xxxx"
      ]
    }
  ]
}