Media
Download Image
POST
/api/v1/chat/downloadimageDownload 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.
| Name | Type | Required | Description |
|---|---|---|---|
| Url | string | Yes | The media url from the Message event. |
| DirectPath | string | No | The direct path from the Message event. |
| MediaKey | string | Yes | The media key from the Message event. |
| Mimetype | string | Yes | The file type from the Message event, e.g. image/jpeg. |
| FileEncSHA256 | string | No | The encrypted file hash from the Message event. |
| FileSHA256 | string | Yes | The file hash from the Message event. |
| FileLength | number | Yes | 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
}