Green API Get Image

Download and process WhatsApp images via Green API

Overview

This node interacts with the Green API to handle WhatsApp image messages. It supports three main operations: obtaining the download URL for an image, downloading the image file itself, and retrieving image metadata without downloading the file. This node is useful for workflows that need to process or archive images sent via WhatsApp, such as customer support automation, media management, or content analysis.

Use Case Examples

  1. Get the download URL of an image sent in a WhatsApp chat to share or process it externally.
  2. Download an image from a WhatsApp chat and save it as binary data for further processing or storage.
  3. Retrieve metadata about an image message, including MIME type and caption, without downloading the actual image file.

Properties

Name Meaning
Chat ID The WhatsApp chat identifier where the image was sent, required to locate the message.
Message ID The unique identifier of the image message to download or get information about.
Include Caption Whether to include the image caption in the response, if available.

Output

Binary

When downloading the image, the node can output the image file as binary data under a configurable property name.

JSON

  • downloadUrl - The URL to download the image file from Green API.
  • mimeType - The MIME type of the image, e.g., image/jpeg.
  • fileName - The name of the image file, defaulting to a generated name if not provided.
  • fileSize - The size of the downloaded image file in bytes (only for downloaded images).
  • chatId - The chat ID where the image was sent.
  • messageId - The ID of the image message.
  • downloaded - Boolean indicating if the image was downloaded (true for download operation).
  • isImage - Boolean indicating the data represents an image.
  • caption - Optional caption text included with the image, if requested and available.

Dependencies

  • Requires credentials for Green API including instance ID and API token for authentication.

Troubleshooting

  • Common issues include missing or invalid chat ID or message ID, resulting in errors from the API.
  • If the download URL is not returned by the API, the node throws an error indicating no download URL was received.
  • Network or authentication errors may occur if the Green API credentials are incorrect or the API service is unavailable.
  • To resolve errors, verify the chat ID and message ID are correct, ensure valid Green API credentials, and check network connectivity.

Links

  • Green API Documentation - Official documentation for Green API, including endpoints for downloading WhatsApp media.

Discussion