url query parameter.Authorization header.Note Pass the exact media URL received in the incoming webhook payload.
Theurlquery parameter must be URL-encoded when making the request.
{phoneNumberId} with the WhatsApp Phone Number ID associated with your SendZen account.<SENDZEN_API_KEY> with your SendZen API key.url with the exact media URL received in the webhook.--data-urlencode option automatically URL-encodes the media URL before adding it to the request query string.--output downloaded_media option saves the returned binary response to a local file instead of printing it to the terminal.Content-Type matches the type of media being downloaded. For example:| Media | Content-Type |
|---|---|
| JPEG image | image/jpeg |
| PNG image | image/png |
| MP4 video | video/mp4 |
| PDF document | application/pdf |
| Audio | Appropriate audio MIME type |
Important This endpoint does not return a JSON response on success. The response body contains the actual file bytes.
phoneNumberId.| Status Code | Description |
|---|---|
400 Bad Request | Invalid phoneNumberId or malformed media URL. |
401 Unauthorized | Missing or invalid SendZen API key. |
404 Not Found | WABA account or media file could not be found. |
500 Internal Server Error | An unexpected error occurred while processing the request. |
curl --location 'https://api.sendzen.io/v1/1075755758965317/media?url=https%3A%2F%2Flookaside.fbsbx.com%2Fwhatsapp_business%2Fattachments%2F%3Fmid%3D45346...' \
--header 'Authorization: Bearer <token>'