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",
   "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/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!