WhatsApp Media Message

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/ObjectParameters with in the ObjectMandatoryDescription
deliverychannelChannel used to send the message i.e., WhatsApp in this case.
appidContains the applicationid
destinationUnique user id for the recipient of the message on WhatsApp.
waidYesWhatsApp ID or phone number for the person you want to send a message to.
correlationidThe 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.
callbackDataData that you have configured to receive on the notify Url. This is configured as a part of the request.
notifyurlConfigure 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.
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.

Additional details for the various media message types:

Video

Parameter/ObjectParameters with in the ObjectMandatoryDescription
channels
OTT-MessagingJSON object for social channel message configuration
waYesWhatsApp ID or phone number for the person you want to send a message to.
type(Video)video
videoThe media object containing a video
urlDirect 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.
mimeTypeSupported mime types. For more information, refer here.

Audio

Parameter/ObjectParameters with in the ObjectMandatoryDescription
channels
OTT-MessagingJSON object for social channel message configuration
waYesWhatsApp ID or phone number for the person you want to send a message to.
type (Audio)audio
audioThe media object containing audio.
Supported audio formats are aac, mp4, mpeg, amr and ogg (only opus codecs, base ogg is not supported)
urlDirect 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.
mimeTypeSupported mime types. For more information, refer here.

Document

Parameter/ObjectParameters with in the ObjectMandatoryDescription
channels
OTT-MessagingJSON object for social channel message configuration
waYesWhatsApp ID or phone number for the person you want to send a message to.
type (document)document
documentThe media object containing a document.
Supported document formats are PDF, DOC(X), PPT(X), The media object containing a videoXLS(X).
urlDirect 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.
filenamefilename of the document
mimeTypeSupported mime types. For more information, refer here.

Sticker

Parameter/ObjectParameters with in the ObjectMandatoryDescription
conversationid
channels
OTT-MessagingJSON object for social channel message configuration
waYesWhatsApp ID or phone number for the person you want to send a message to.
type(sticker)sticker.
stickerThe media object containing a sticker.
urlDirect 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.
mimeTypeSupported 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

Language
URL
Click Try It! to start a request and see the response here!