Video messages display a thumbnail preview of a video image with an optional caption. When the WhatsApp user taps the preview, it loads the video and displays it to the user.
Use the POST /<WHATSAPP_BUSINESS_PHONE_NUMBER_ID>/messages endpoint to send a video message to a WhatsApp user.
POST /<WHATSAPP_BUSINESS_PHONE_NUMBER_ID>/messages
{ "messaging_product": "whatsapp", "recipient_type": "individual", "to": "{{wa-user-phone-number}}", "type": "video", "video": { "id" : "<MEDIA_ID>", /* Only if using uploaded media */ "link": "<MEDIA_URL>", /* Only if linking to your media */ "caption": "<VIDEO_CAPTION_TEXT>" } }
Placeholder | Description | Example Value |
---|---|---|
String | Optional. Video caption text. Maximum 1024 characters. |
|
String | Required if using an uploaded media asset (recommended). Uploaded media asset ID. |
|
String | Required if linking to your media asset (not recommended) URL of video asset on your public server. For better performance, we recommend that you upload your media asset instead. |
|
String | Required. WhatsApp user phone number. |
|
Video Type | Extension | MIME Type | Max Size |
---|---|---|---|
3GPP | .3gp | video/3gp | 16 MB |
MP4 Video | .mp4 | video/mp4 | 16 MB |
Example request to send a video message with a caption to a WhatsApp user.
curl 'https://graph.facebook.com/v21.0
/106540352242922/messages' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer EAAJB...' \
-d '{
"messaging_product": "whatsapp",
"recipient_type": "individual",
"to": "+16505551234",
"type": "video",
"video": {
"id" : "1166846181421424",
"caption": "A succulent eclipse!"
}
}'
{ "messaging_product": "whatsapp", "contacts": [ { "input": "+16505551234", "wa_id": "16505551234" } ], "messages": [ { "id": "wamid.HBgLMTY0NjcwNDM1OTUVAgARGBI1RjQyNUE3NEYxMzAzMzQ5MkEA" } ] }