Help Desk
  • Getting Started
    • 🙌Welcome to Whapi.Cloud
    • 💰Pricing
    • ☕Partners
    • 🚀Getting started
    • 👨‍💻API Docs
      • Developer hubs
      • Swagger environment
      • Postman collection
  • Sending
    • Introduction
    • Send text message
      • Whatsapp API send message PHP
      • Whatsapp API send message Python
      • Whatsapp API send message Node JS
      • Whatsapp API send message С#
      • Whatsapp API send message Java
      • API integration with VB6
      • Whatsapp API send message GO (Golang)
    • Send video, audio, image, document
      • How to send file from your local computer using the API
    • Send Group message
    • Send post to WhatsApp Channel
    • Send message with Buttons
    • Send Emoji
    • Overview of other methods for sending
      • Send Voice message
      • How to generate a waveform for a voice message
      • Send contact (vCard)
      • Send message reactions
  • Receiving
    • Introduction
    • Webhooks
      • Our webhooks (Tracked events)
      • Where to Find the Webhook URL?
      • Set the webhook link to the channel
      • Detailed webhook settings
      • How to check the webhook?
      • Incoming webhooks format
        • Incoming message
        • Sent message
        • Chats
          • How to Track Chat Labels via Webhook
        • Groups
        • Communities
        • Contacts
        • Account and device status
        • Other
          • Calls
          • Presences
          • Labels
          • Views of stories (statuses)
          • Story (status) from your contacts
      • Receive messages
        • Receive WhatsApp messages using PHP
        • Receive WhatsApp messages using Node js
        • Receive WhatsApp messages using Python
    • HTTP API
      • How to retrieve files
      • Retrieve a Specific User's Chat History
      • Get a full-size picture in the response
      • Get order items
      • Get a profile picture of a chat or user
    • File expiration period
  • Groups
    • Send Group message
      • Mentioning all participants in a WhatsApp group
    • Get list of group members
    • Add new member to Group
  • What Is lid in WhatsApp Groups?
  • Channels
    • Send post to WhatsApp Channel
    • Get messages from Channels
    • Get votes from polls in the Channel
  • Communities
    • Introduction
    • Create a community
    • Add a member to a community
    • Send announcement
    • Get info on community participants
    • Add a group / Exclude a group from the community
  • Account
    • Setting "Auto Download"
    • Customizable Webhook Headers
    • How to find out the IP channel
    • How to Delete a Channel
    • Add Business Info to Invoice
  • Source code
    • WhatsApp ChatBot
      • WhatsApp Python Bot
      • WhatsApp PHP Bot
      • WhatsApp Node JS Bot
      • WhatsApp Java Bot
    • WhatsApp API Google Sheets
    • WhatsApp Phone Number Checker
    • Request Distributor (Balancer)
  • FAQ
    • Does WhatsApp API work with the phone turned off?
    • Chat ID. What is it and how to get it?
    • Why do I see status "pending" after sending message?
    • How to send a paragraph (line break)
    • Inactive Links in WhatsApp Messages
    • WhatsApp Text Formatting
    • Checking if the number has Whatsapp
    • Specifics of sending messages to numbers of different countries
    • Current status of Buttons on WhatsApp
    • Why aren't participants being added to the group?
  • Hints
    • Android Emulators
    • Virtual Numbers for WhatsApp
    • How to use polls as buttons?
    • How to check who blocked you in Whatsapp?
    • Setting up a WhatsApp proxy
  • Integrations
    • Make.com
      • Ready-Made Scenarios
        • WhatsApp & Whisper API: Voice-to-Text Integration
        • Automated WhatsApp Group Message Forwarding in Make.com
      • Request Scenario Setup
    • Pabbly Connect
    • Google Contacts
    • DialogFlow
    • n8n
  • Tools
    • WhatsApp Number Checker
    • Automatic warm-up module
    • WhatsApp Activity Safety Meter
    • Residential Proxies from Whapi.Cloud
  • Troubleshooting
    • Couldn't Link Device – WhatsApp QR Code or Pairing Code Fails
    • Channel status “SYNC_ERROR”
    • Not getting a READ status on webhook
    • 429 (Too Many Requests) - Soft Ban
    • “Waiting for this message. This may take a while” – WhatsApp Message Error
    • Missing push notifications after connecting to API
  • Blocking
    • How to not get Banned?
    • How to do mailings without the risk of being blocked?
    • If My Number Is Banned, Can It Be Restored?
    • Unlocking Your WhatsApp Number
    • Connecting a New WhatsApp Number After a Ban: Steps and Recommendations
    • Warming Up New Phone Numbers for WhatsApp API
  • Partner Documentation
    • Introduction
    • Partner Dashboard Overview
    • Partner Program Guidelines
      • Workflow: Step-by-Step
      • Billing for Partners
      • Allocating Days to Customer Channels: Best Practices & Guide
      • Interface for channel management
    • Partner Documentation
      • Channel creation
      • Changing channel mode
      • Channel extension
      • Channel deletion
      • Getting the list of channels
      • Notices of end of days on balance
Powered by GitBook
On this page
  • 1. Automatically extract the original image or file into a link
  • 2. Retrieve Original Image/File via Get Media Endpoint

Was this helpful?

  1. Receiving
  2. HTTP API

Get a full-size picture in the response

How to get a media file via a link

When working with our API to receive messages containing images, you might notice that initially, only the preview information of the image is included in the response. This guide will help you understand how to retrieve the original, full-size images using two different methods.

Receiving Image Preview in the Response

When an image message is received, the initial response and callback include only the preview data. Here’s an example of such a response:

{
      "id": "yRz1.VbdOFCdSWFGDPEYDg-gNEIDpL.CQ",
      "from_me": false,
      "type": "image",
      "chat_id": "919984351847@s.whatsapp.net",
      "timestamp": 1719323789,
      "source": "mobile",
      "image": {
        ,
        "mime_type": "image/jpeg",
        "file_size": 25950,
        "sha256": "IKc25C+1fi7Q5+k4Pejd4+t+022TLlu94wkFQv0X5+Y=",
        "caption": "Hello world",
        "width": 356,
        "height": 366,
        "preview": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEABsbGxscGx4hIR4qLSgtKj04MzM4PV1CR0JHQl2NWGdYWGdYjX2Xe3N7l33gsJycsOD/2c7Z//////////////8BGxsbGxwbHiEhHiotKC0qPTgzMzg9XUJHQkdCXY1YZ1hYZ1iNfZd7c3uXfeCwnJyw4P/Zztn////////////////CABEIAEgARQMBIgACEQEDEQH/xAAvAAADAQEBAAAAAAAAAAAAAAAAAwQFAgEBAQEBAQEAAAAAAAAAAAAAAAABAgME/9oADAMBAAIQAxAAAABnnNEqh8BR4SlT5PV0SYJp7OUn80JpZ+aeKWKVG4elKOBzf1naUwJpgqFGhK76wsTmuTQz4sfXmp118isnIU9qejRAFaIZ8iHhPQlIXqr0JrsC5//EACcQAAICAQMCBgMBAAAAAAAAAAECAAMRBBIhMVITFCIjUXEyQXIk/9oACAEBAAE/APDqC5LGYp7mntdzTNPe0zV3NM1d7TNXc0qvSroTDeX6QODQSRE0tZUHJh0teDyYteQxz+4EQDGyXKVORwDEoBUEsYaUQEkmVHiY/wAxg1tqjEGuthu2qCByTPNvDe1mcjpBrXAxieass9OJSuRFG6kfctrBdFwOZYtK7QFE8EWbyOgMXT7kJl1K0gH5EVqc85gID8N+5RwsrxsXPdLWUOhhUbx9TTqVFuR1PErGA2ZrhkJGqCkwjDKZQ2Vin2l+d01FNrkFSMS6y6vaSw+JQGNQLGNnBxNVbl1GYRliR2x81lZpz6YnKJ/UtXdWyynT7mG45hqR0EAC8TVUpsZwPVNLnBzNWPWk0/4RDsVP6hOTLNtQb5MocihIWBaak+0ZU+wMZe6v4eDKOFhO5dpifgPqX0eMwMBeupUCdIbH7ZY7OpUrxF06/EOkA52wHYSAJ//EABoRAAMBAQEBAAAAAAAAAAAAAAABESEQIEH/2gAIAQIBAT8A00033eJ51/BE3rKVlKf/xAAjEQABAwMEAgMAAAAAAAAAAAABAAIDERMhBBAxQRIgMmFy/9oACAEDAQE/AMLCwse7pGtcGk5KmkcwN8RUqKYSj7CHB21mCx3ajNx1zoCgVotlD2cH5DfWCtv9LTgWWqioFRf/2Q=="
      },
      "from": "919984351847",
      "from_name": "Jonathan"
    },

1. Automatically extract the original image or file into a link

Enable "Auto Download" Setting

By enabling the "Auto Download" setting in your channel settings, you can receive a link to the original image or file directly in the response. This link will be accessible for 30 days as we store these files in the cloud. To enable this setting, please follow the instructions provided here: Setting "Auto Download"

Example Response with Auto Download Enabled

{
      "id": "YLO7_qNlFMsjIEZ1m7Lmxg-gFcIDpL.CQ",
      "from_me": false,
      "type": "image",
      "chat_id": "919984351847@s.whatsapp.net",
      "timestamp": 1719324086,
      "source": "mobile",
      "image": {
        "id": "jpeg-60b3bbfea3652046759bb14cb232e6c6-8057080e92fe09",
        "mime_type": "image/jpeg",
        "file_size": 41490,
        "sha256": "NYegMy3NmhxO4oKgi7qlMy/8p9zqcGU4Gtgu3l8bTAg=",
        
        "caption": "Hello",
        "width": 1050,
        "height": 700,
        "preview": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEABsbGxscGx4hIR4qLSgtKj04MzM4PV1CR0JHQl2NWGdYWGdYjX2Xe3N7l33gsJycsOD/2c7Z//////////////8BGxsbGxwbHiEhHiotKC0qPTgzMzg9XUJHQkdCXY1YZ1hYZ1iNfZd7c3uXfeCwnJyw4P/Zztn////////////////CABEIACwAQgMBIgACEQEDEQH/xAAwAAACAwEBAAAAAAAAAAAAAAADBQACBAEGAQADAQEAAAAAAAAAAAAAAAAAAgMBBP/aAAwDAQACEAMQAAAAYhaeV5el3szm1ezgTE+9H6GddktFlxG0DVlTsHXlow8uyqGxd6WwRjJOmqO7BzZrbLVQFwLcFDdcWQb/xAAlEAACAgECBQUBAAAAAAAAAAABAgADEQQSBRAhMVETFCJBQmH/2gAIAQEAAT8AGirAyXMFemazYLjuMq0S0tkMYTyJwCY+oZ2bJ6ZnD1yWabYV3KQZqgdLfkfRlF4vqVxz1BxS8YPX37Th/SkGZj2bO4nEwuoQMgO4ThpvoJV0O2JYW/JhJmtsYIABPk5G4YErFgACg4mLvBhs8whX+WIrHJENmPMLuf0YNPbYAd8GjbyDFXaBiZaFyRPUtAwD0i22eRFvP3C5PYw/0wWMPueuwnuliEkcgOXbtFYmGMZvM//EABsRAAIDAQEBAAAAAAAAAAAAAAARAQIhURIT/9oACAECAQE/AIpXghE0UiIvo3qEXr6PnHZIwZo5NP/EAB0RAAICAgMBAAAAAAAAAAAAAAABAhESIRMiUWL/2gAIAQMBAT8AU5NPsxv0THK4stmFIZbITo5flEtjRoSRjE//2Q=="
      },
      "from": "919984351847",
      "from_name": "Jonathan"
    }

An additional link parameter appears, which stores a link to the original file.

2. Retrieve Original Image/File via Get Media Endpoint

When your webhook receives an incoming message that includes a file, you'll see a field such as document.id, image.id, or video.id. This is the Media ID — a unique identifier of the file stored temporarily on the WhatsApp server.

Remember that you can get information about the message not only from the webhook, but also by executing the HTTP request “Get message”.

Let's see what this Media ID looks like using the example of an incoming message webhook:

"image": {
        ,

Example of Using the Get Media Endpoint

First, make a GET request to the endpoint with the media ID received in the initial response:

Endpoint: GET /media/{media-id}

In the case of our example, the media id is jpeg-60b3bbfea3652046759bb14cb232e6c6-8057080e92fe09

curl --request GET \
     --url https://gate.whapi.cloud/media/jpeg-60b3bbfea3652046759bb14cb232e6c6-8057080e92fe09 \
     --header 'accept: application/pdf' \
     --header 'authorization: Bearer iwpVwcco2bBdvShV4sbzBNB1BDCXPmcs'

Important Notes: The response body contains the actual file, not just a URL!

What does this mean? It means that services such as Readme.io and other visual test shells will not allow you to save the file when you make a request.

Use Postman or your IDE to save the file from the response body.


PreviousRetrieve a Specific User's Chat HistoryNextGet order items

Last updated 18 days ago

Was this helpful?

If you need any help, our support team is always available via live chat on any dashboard page or via email at .

care@whapi.cloud