File download
Last update: 6 hours ago by Irais Aguirre
Integration summary
- Endpoint:
GET https://{{url}}/whatsapp-bsp-api-endpoint-ws/services/v1/media/{{from}}/{{id}}- Token: messaging token, in the
Authorization: Bearer {{wa-msg-api-token}}header (how to generate it)- Response: the file bytes, with their
Content-TypeandContent-Disposition. On error, a JSON{"code": ..., "detail": "..."}.
The file download service lets you download images, documents, videos, audio files, and voice messages sent by your customers.
Download file
Request
| URL | https://{{url}}/whatsapp-bsp-api-endpoint-ws/services/v1/media/{{from}}/{{id}} |
| Method | GET |
| Response | Binary file (with the file's Content-Type). On error, a JSON {code, detail}. |
Headers
| Name | Description | Type | Requirements |
|---|---|---|---|
| Authorization | Messaging token in the format Bearer {token} (with one space). See Generate authentication token. | String | Required |
Parameters
Fields for Download file:
| Name | Description | Type | Requirements |
|---|---|---|---|
| from | Path parameter. Phone number (with country code) that sent the message. | String | Required. |
| id | Path parameter. File ID. This value is sent to you in the Webhook notification. | String | Required |
Example
Complete Download file example (HTTP request and JSON body):
curl 'https://{{url}}/whatsapp-bsp-api-endpoint-ws/services/v1/media/{{from}}/{{id}}' \-H 'Authorization: Bearer {{wa-msg-api-token}}'
