Guidance on WhatsApp Media Messages
With the Twilio API for WhatsApp, you can send images, video, text, and PDF files to create rich contextual conversations with your WhatsApp Users. This guide covers guidelines to follow when sending and receiving media messages through WhatsApp to ensure a smooth experience with your customers.
Media Content Types
To send a WhatsApp media message, you must specify the MediaUrl
parameter when making a request to the Twilio API for WhatsApp. Twilio checks the content-type
header at the provided MediaUrl
to validate the content type of the media file. If the content-type
header does not match that of the media file, Twilio rejects the request.
Message Size Limits
When you send an outbound WhatsApp message, the total message size must be under the maximum size limit for the channel. An API request with media or a collection of media larger than the size limit will fail with an error.
For a WhatsApp message, the maximum size limit is 16MB.
Filenames and Captions
Currently, Twilio does not support setting a filename or caption for documents that are send as media messages over WhatsApp.
サポートされるMIMEタイプ
The Twilio API for WhatsApp supports sending and receiving images, audio, PDF files, and video. The following formats are currently supported:
- Images: JPG, JPEG, PNG
- Audio: MP3, OGG*, AMR
- Documents: PDF
- Video: MP4*
* Please note the following:
- WhatsApp currently does not support MP4 files without audio.
- WhatsApp outbound OGG is only supported when the ogg file uses the opus codec, which are files with the
.opus
extension.
ヘルプが必要ですか?
We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd by visiting Twilio's Stack Overflow Collective or browsing the Twilio tag on Stack Overflow.