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.
The media hosting is managed by Meta for numbers in the Cloud API. Please refer to Meta's Official Documentation for clarification on their regulations.
All media files sent through this endpoint are encrypted and persist for 30 days, unless they are deleted earlier.
It is a good practice for partners and clients to store any media in their own servers and delete them from Meta's servers immediately after.
- 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 maximum supported file size for media messages on Cloud API is 100MB. In the event the customer sends a file that is greater than 100MB, you will receive a webhook with an error.
post
https://waba-v2.360dialog.io
/media
Upload Media
Content-Type: image/jpeg or other appropriate media type
your-binary-media-data

get
https://waba-v2.360dialog.io
/media/{media_id}
Get Media
post
https://waba-v2.360dialog.io
/messages
Send Media
Example
The samples below shows a media message with different objects such as
URL
and Media ID
. A valid request body would look like this:Sending media messages using Image URL:
{
"messaging_product": "whatsapp",
"recipient_type": "individual",
"to": "PHONE-NUMBER",
"type": "image",
"image": {
"link" : "https://IMAGE_URL"
}
}
Sending media messages using Media ID:
{
"messaging_product": "whatsapp",
"recipient_type": "individual",
"to": "PHONE-NUMBER",
"type": "image",
"image": {
"id" : "MEDIA-OBJECT-ID"
}
}
In the case of an unsuccessful response, a callback is sent to your Webhook URL even though the response will yield a message ID similar to a successful message send.
delete
https://waba-v2.360dialog.io
/media/{media-id}
Delete media
Last modified 4d ago