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. Note: The following is an example of sending a image media message. Examples of other media types can be found below. Note: Modify YourRegion in the URL to the right to reflect your tenant’s region. See Know your endpoint page.
Other Media Types
The audio, document, video and sticker objects
{
"deliverychannel":"whatsapp",
"appid":"<WAAppid>",
"destination":[
{
"waid":[
"<waid>"
]
}
],
"channels": {
"OTT-Messaging": {
"wa": {
"type": "video",
"video": {
"url" : "<your-media-url>",
"mimeType" : "<VIDEO/MP4>"
}
}
}
},
"correlationid": "",
"callbackData": "",
"notifyurl": ""
}
{
"deliverychannel":"whatsapp",
"appid":"<WAAppid>",
"destination":[
{
"waid":[
"<waid>"
]
}
],
"channels":{
"OTT-Messaging":{
"wa":{
"type":"audio",
"audio":{
"url":"http://techslides.com/demos/samples/sample.aac",
"mimeType":"audio/aac"
}
}
}
},
"correlationid": "",
"callbackData": "",
"notifyurl": ""
}
{
"deliverychannel":"whatsapp",
"appid":"<WAAppid>",
"destination":[
{
"waid":[
"<waid>"
]
}
],
"channels":{
"OTT-Messaging":{
"wa":{
"type":"document",
"document":{
"url":"http://www.africau.edu/images/default/sample.pdf",
"filename":"Document test",
"mimeType":"application/pdf"
}
}
}
},
"correlationid": "",
"callbackData": "",
"notifyurl": ""
}
{
"deliverychannel":"whatsapp",
"appid":"<WAAppid>",
"destination":[
{
"waid":[
"<waid>"
]
}
],
"conversationid": "",
"channels": {
"OTT-Messaging": {
"wa": {
"type": "sticker",
"sticker": {
"url": "https://stgrtmedia.s3.amazonaws.com/a_156990713579365000/e5eb7336-d7bd-4e1f-91f5-3057d78e99d3.webp",
"mimeType": "image/WEBP"
}
}
}
},
"correlationid": "",
"callbackData": "",
"notifyurl": ""
}
Common Parameters for Other Media Types
Parameter/Object | Parameters with in the Object | Mandatory | Description |
---|---|---|---|
deliverychannel | Channel used to send the message i.e., WhatsApp in this case. | ||
appid | Contains the applicationid | ||
destination | Unique user id for the recipient of the message on WhatsApp. | ||
waid | Yes | WhatsApp ID or phone number for the person you want to send a message to. | |
correlationid | The corrrelationid 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. | ||
type | Yes, when type is image, audio, document or sticker | image, audio, document, video or sticker. Refer below table to know more about each of these types. | |
caption | No | Describes the specified image, video, or document media. Do not use with audio or sticker media. | |
url | yes | Direct 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. | |
mimeType | yes | Supported mime types. |
Additional details for the various media message types:
Video
Parameter/Object | Parameters with in the Object | Mandatory | Description |
---|---|---|---|
channels | |||
OTT-Messaging | JSON object for social channel message configuration | ||
wa | Yes | WhatsApp ID or phone number for the person you want to send a message to. | |
type(Video) | video | ||
video | The media object containing a video | ||
url | Direct 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. | ||
mimeType | Supported mime types. For more information, refer here. |
Audio
Parameter/Object | Parameters with in the Object | Mandatory | Description |
---|---|---|---|
channels | |||
OTT-Messaging | JSON object for social channel message configuration | ||
wa | Yes | WhatsApp ID or phone number for the person you want to send a message to. | |
type (Audio) | audio | ||
audio | The media object containing audio. Supported audio formats are aac, mp4, mpeg, amr and ogg (only opus codecs, base ogg is not supported) | ||
url | Direct 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. | ||
mimeType | Supported mime types. For more information, refer here. |
Document
Parameter/Object | Parameters with in the Object | Mandatory | Description |
---|---|---|---|
channels | |||
OTT-Messaging | JSON object for social channel message configuration | ||
wa | Yes | WhatsApp ID or phone number for the person you want to send a message to. | |
type (document) | document | ||
document | The media object containing a document. Supported document formats are PDF, DOC(X), PPT(X), The media object containing a videoXLS(X). | ||
url | Direct 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. | ||
filename | filename of the document | ||
mimeType | Supported mime types. For more information, refer here. |
Sticker
Parameter/Object | Parameters with in the Object | Mandatory | Description |
---|---|---|---|
conversationid | |||
channels | |||
OTT-Messaging | JSON object for social channel message configuration | ||
wa | Yes | WhatsApp ID or phone number for the person you want to send a message to. | |
type(sticker) | sticker. | ||
sticker | The media object containing a sticker. | ||
url | Direct 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. | ||
mimeType | Supported mime types. For more information, refer here. |
Error Codes
Refer to the below page https://developers.imiconnect.io/reference/channel-specific-status-codes-1#whatsapp