Send video, audio, image, document
Endpoint for easy send media-file as message
Last updated
Was this helpful?
Endpoint for easy send media-file as message
Last updated
Was this helpful?
You can work with different types of files and it makes no difference what extension the document has. WhatsApp limits the sizes of files and its politics constantly changes and because of that we always recommend that you verify directly on WhatsAppโs website. In this you can find everything that you need to know about formatting and file sizing.
Your file must be provided in the required media
parameter. There are four supported ways to do this:
Upload from file โ Send the actual file content directly (e.g., using multipart/form-data
). Read more here: How to send file from your local computer using the API;
Upload from URL โ Provide a direct public URL to the file;
Upload as Base64 โ Convert the file to Base64 and send it with a data:
prefix;
Use media ID โ Reuse a previously uploaded file by referencing its media_id
. The file will be uploaded to the cloud and stored there for 30 days. Read more about it here: File expiration period;
Each method works with all media message endpoints โ choose the one that best fits your workflow.
If you have a direct link to an image that is posted somewhere on the internet. It is important that it is the file that is accessible via the direct link.
In which case you will need to have a method in your application to convert the image to Base64. To make sure the conversion is successful, copy the generated base64 and paste it into your browser's address bar, if it is a valid image the browser will be able to display it, if the browser can't, check your method :)
You can also manually recode the file and specify the result in your application. To do this, you can use our handy tool to encode any file into Base64 format:
Want to send a file from your local computer using the API?
Learn how to properly attach and send media using multipart/form-data
โ with ready-to-use examples in Python, PHP, Node.js, and cURL.
Read the full guide โ How to send file from your local computer using the API
Via MediaID, in this case after automatically uploading the file to the cloud, you will get a media ID that you can use in the future. Read more: File expiration period
You can Send a ppt audio recording to the phone number or group, But WhatsApp is sensitive to this extension, you need to be in OGG format and the codecs should be the opus. Our API has an automatic video and audio converter for the necessary codecs compatible with WhatsApp. For more information, you can check out this .