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", //Mandatory. Channel used to send the message i.e., WhatsApp in this case.
"appid": "{{WAAppid}}", //Mandatory. Contains the applicationid
"destination": [
{
"waid": [
"{{waid}}" //Mandatory. WhatsApp ID or phone number for the person you want to send a message to.
]
}
],
"channels": {
"OTT-Messaging": {
"wa": {
"type": "video", //Mandatory. Specify the media type of WhatsApp message. Supported types are image, audio, document, video or sticker.
"video": {
"url": "<your-media-url>", //Mandatory. 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": "<VIDEO/MP4>" //Mandatory. Specify mime type of media for e.g. image/png, video/mp4
},
"identity_key_hash": "<identity-key-hash-value>" //Optional. Pass this value to validate the identity of your customer.
}
}
},
"correlationid": "", //Optional. 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": "", //Optional. Data that you have configured to receive on the notify Url. This is configured as a part of the request.
"notifyurl": "" //Optional. 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.
}
{
"deliverychannel": "whatsapp", //Mandatory. Channel used to send the message i.e., WhatsApp in this case.
"appid": "{{WAAppid}}", //Mandatory. Contains the applicationid
"destination": [
{
"waid": [
"{{waid}}" //Mandatory. WhatsApp ID or phone number for the person you want to send a message to.
]
}
],
"channels": {
"OTT-Messaging": {
"wa": {
"type": "audio", //Mandatory. Specify the media type of WhatsApp message. Supported types are image, audio, document, video or sticker.
"audio": {
"url": "<your-media-url>", //Mandatory. 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": "audio/aac" //Mandatory. Specify mime type of media for e.g. image/png, video/mp4, audio/aac
},
"identity_key_hash": "<identity-key-hash-value>" //Optional. Pass this value to validate the identity of your customer.
}
}
},
"correlationid": "", //Optional. 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": "", //Optional. Data that you have configured to receive on the notify Url. This is configured as a part of the request.
"notifyurl": "" //Optional. 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.
}
{
"deliverychannel": "whatsapp", //Mandatory. Channel used to send the message i.e., WhatsApp in this case.
"appid": "{{WAAppid}}", //Mandatory. Contains the applicationid
"destination": [
{
"waid": [
"{{waid}}" //Mandatory. WhatsApp ID or phone number for the person you want to send a message to.
]
}
],
"channels": {
"OTT-Messaging": {
"wa": {
"type": "document", //Mandatory. Specify the media type of WhatsApp message. Supported types are image, audio, document, video or sticker.
"document": {
"url": "<your-media-url>", //Mandatory. 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": "Document test", //Optional
"mimeType": "application/pdf" //Mandatory. Specify mime type of media for e.g. image/jpg, image/png, image/webp, video/mp4, audio/aac, application/pdf
},
"identity_key_hash": "<identity-key-hash-value>" //Optional. Pass this value to validate the identity of your customer.
}
}
},
"correlationid": "", //Optional. 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": "", //Optional. Data that you have configured to receive on the notify Url. This is configured as a part of the request.
"notifyurl": "" //Optional. 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.
}
{
"deliverychannel": "whatsapp", //Mandatory. Channel used to send the message i.e., WhatsApp in this case.
"appid": "{{WAAppid}}", //Mandatory. Contains the applicationid
"destination": [
{
"waid": [
"{{waid}}" //Mandatory. WhatsApp ID or phone number for the person you want to send a message to.
]
}
],
"conversationid": "",
"channels": {
"OTT-Messaging": {
"wa": {
"type": "sticker", //Mandatory. Specify the media type of WhatsApp message. Supported types are image, audio, document, video or sticker.
"sticker": {
"url": "<your-media-url>", //Mandatory. 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": "image/WEBP" //Mandatory. Specify mime type of media for e.g. image/jpg, image/png, image/webp, video/mp4, audio/aac
},
"identity_key_hash": "<identity-key-hash-value>" //Optional. Pass this value to validate the identity of your customer.
}
}
},
"correlationid": "", //Optional. 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": "", //Optional. Data that you have configured to receive on the notify Url. This is configured as a part of the request.
"notifyurl": "" //Optional. 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.
}
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