This command is deprecated and will be removed over time.
Use the get-messagemedia method
Working with media files (deprecated)
This command lets you retrieve a media file attached to a received message. If a message contains media, the message field “hasMedia” is set to true, and the “mediaKey” field contains the media identifier used by this command.
Request command
To request media, send a POST request to:
https://whatsgate.org/api/v1/get-media
Request body object
The request body must contain:
{
"WhatsappID": "YOUR_WHATSAPP_ID",
"mediaKey": "TuM9wXQZBmERUCzwnIZe80GwZ5lPDIDsNE+vewnAxho="
}
- WhatsappID - WhatsApp identifier in the system
- mediaKey - media file identifier
Response object
Successful response object
{
"result": "OK",
"media": {
"mimetype": "image/jpeg",
"filename" : "image.jpg",
"data": "<base64_encoded_data>"
}
}
In the response, the “media” field contains a media file object