logo
enes

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-Type and Content-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

URLhttps://{{url}}/whatsapp-bsp-api-endpoint-ws/services/v1/media/{{from}}/{{id}}
MethodGET
ResponseBinary file (with the file's Content-Type). On error, a JSON {code, detail}.

Headers

NameDescriptionTypeRequirements
AuthorizationMessaging token in the format Bearer {token} (with one space). See Generate authentication token.StringRequired

Parameters

Fields for Download file:

NameDescriptionTypeRequirements
fromPath parameter. Phone number (with country code) that sent the message.StringRequired.
idPath parameter. File ID. This value is sent to you in the Webhook notification.StringRequired

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}}'
Previous
Read and typing indicators
Next — WhatsApp
C-Commerce