orvachat

Media

Download Image

POST/api/v1/chat/downloadimage

Download and decrypt a received image. Use the media fields from the Message event. Returns base64 data.

Parameters

  • UrlstringRequired

    The media url from the Message event.

  • DirectPathstringOptional

    The direct path from the Message event.

  • MediaKeystringRequired

    The media key from the Message event.

  • MimetypestringRequired

    The file type from the Message event, e.g. image/jpeg.

  • FileEncSHA256stringOptional

    The encrypted file hash from the Message event.

  • FileSHA256stringRequired

    The file hash from the Message event.

  • FileLengthnumberRequired

    The file size in bytes from the Message event.

Code Examples

cURL
curl -X POST "https://orvachat.com/api/v1/chat/downloadimage" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "Url": "https://mmg.whatsapp.net/d/f/…enc",
  "Mimetype": "image/jpeg",
  "FileSHA256": "…",
  "FileLength": 2039,
  "MediaKey": "…",
  "FileEncSHA256": "…"
}'

Response Example

200 OK
{
  "code": 200,
  "data": {
    "Data": "data:image/jpeg;base64,iVBORw0KGgoA5CYII...=",
    "Mimetype": "image/jpeg"
  },
  "success": true
}