Working with media files

This command lets you get a media file from any message. If a message has media, its “hasMedia” field is set to true, and to fetch the media you must provide the full message id in the format false_79999999999@c.us_17AC61BFA5A561B7EE42F98810EDFFC4.

To request media, send a POST request to:

https://whatsgate.org/api/v1/get-messagemedia

The request body must contain:

{
  "WhatsappID": "YOUR_WHATSAPP_ID",
  "MessageID": "false_79999999999@c.us_17AC61BFA5A561B7EE42F98810EDFFC4"
}
  • WhatsappID - WhatsApp identifier in the system
  • MessageID - message identifier

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.

If the message is not found, or if it has no media, an error is returned.