Links

Media

Use the media node to upload, retrieve, or delete media.
To send media such as images, documents, audio or video you must first Upload the Media and then Send it.
When a media message is sent, the media is stored on the WhatsApp servers for 14 days. We also store media on our servers for 14 days. If a user makes a request to download the media after 14 days, they will be notified that the media is unavailable.
It is a good practice for partners and clients to store any media in their own servers and delete them from our servers immediately after.

Constraints

  • If you use the media upload process rather than linking to a media URL, the file must be uploaded to the media volume. Once the upload is complete, you can send a message using the media ID.
  • The application processes the media that is uploaded before it's sent to the server. While the maximum file size for media that can be uploaded to the media node is 64MB, there are post-processing limits for the various media types outlined in the Post-Processing Media Size table.
  • Media storage is handled by 360dialog. If the media volume gets full, message sending will start to fail.
  • There is no support for:
    • Sending media by byte streams.
    • Sending messages with animated stickers.

Endpoints

post
https://waba.360dialog.io
/v1/media
Upload Media
Content-Type: image/jpeg or other appropriate media type your-binary-media-data
get
https://waba.360dialog.io
/v1/media/{media_id}
Get Media
post
https://waba.360dialog.io
/v1/messages
Send Media
{
"recipient_type": "individual",
"to": "wa_id",
"type": "image",
"image": {
"id": "media_id",
"caption": "your-image-caption"
}
}
OR
{
"recipient_type": "individual",
"to": "wa_id",
"type": "video",
"video": {
"id": "media_id",
"caption": "your-video-caption"
}
}
delete
https://waba.360dialog.io
/v1/media/{media-id}
Delete media

Supported Content-Types

Media
Supported Content-Types
audio
audio/aac, audio/mp4, audio/amr, audio/mpeg, audio/ogg; codecs=opus Note: The base audio/ogg type is not supported.
document
Any valid MIME-type.
image
image/jpeg, image/png
sticker
image/webp
video
video/mp4, video/3gpp
Notes:
Only H.264 video codec and AAC audio codec is supported. Only videos with a single audio stream are supported.
Official WhatsApp API Documentation: https://developers.facebook.com/docs/whatsapp/api/media/