Upload Media
To upload media, make a POST call to the /media and include the parameters listed below. All media files sent through this endpoint are encrypted and persist for 30 days, unless they are deleted earlier.
API_TOKEN Developers can authenticate their API calls with the API_TOKEN generated in App Dashboard > Phone Numbers > Detail > Api. Parameters
This is the main parameter used in upload media requests:
| Name | Description |
|---|---|
audio | Optional Path to the file stored in your local directory. For example: "/local/path/file.mp3" required if you have not added parameters to the request Size Limit: 10MB Supported options for audio are:
|
document | Optional Path to the file stored in your local directory. For example: "/local/path/file.txt" required if you have not added parameters to the request Size Limit: 10MB Supported options for document are:
|
image | Optional Path to the file stored in your local directory. For example: "/local/path/file.jpg" required if you have not added parameters to the request Size Limit: 5MB Supported options for images are:
|
sticker | Optional Path to the file stored in your local directory. For example: "/local/path/file.webp" required if you have not added parameters to the request Size Limit: 100KB Supported options for sticker are:
|
video | Optional Path to the file stored in your local directory. For example: "/local/path/file.mp4" required if you have not added parameters to the request Supported options for video are:
Size Limit: 10MB Notes:
|
Example
Sample request:
curl -X POST 'https://waofficial.botika.online/api/whatsapp/v1/media' \ -H 'Authorization: Bearer {{ API_TOKEN }}' \ -F 'image=@"/path/to/file"'
A successful response includes an object with an identifier for the profile:
{
"image": {
"id": "{{ MEDIA_ID }}"
}
}You can upload multiple media at once with parameters.
