Green API Get Image

Download and process WhatsApp images via Green API

Overview

This node interacts with the Green API to download and process WhatsApp images. It supports operations to get the image download URL, download the image file itself, or retrieve image metadata without downloading. It is useful for workflows that need to handle WhatsApp images, such as archiving images, processing them further, or extracting metadata for analysis.

Use Case Examples

  1. Downloading an image sent in a WhatsApp chat to save it as binary data for further processing or storage.
  2. Retrieving the download URL of an image to share or use it in another system without downloading the file immediately.
  3. Getting image metadata like MIME type and file name without downloading the image, useful for logging or conditional processing.

Properties

Name Meaning
Chat ID The WhatsApp chat ID where the image was sent, required to identify the source chat.
Message ID The ID of the specific image message to download or get information from.
Save as Binary Whether to save the downloaded image file as binary data in the output.
Binary Property Name The name of the binary property to store the image file if saving as binary is enabled.
Include Caption Whether to include the image caption in the response if available.

Output

Binary

Contains the image file data if 'Save as Binary' is true, stored under the specified binary property name.

JSON

  • downloadUrl - The URL from which the image can be downloaded.
  • mimeType - The MIME type of the image, e.g., image/jpeg.
  • fileName - The file name of the image, defaulting to a pattern 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 message ID of the image.
  • downloaded - Boolean indicating if the image was downloaded (true for download operation).
  • isImage - Boolean indicating the data represents an image.
  • caption - Optional caption text of the image if included.

Dependencies

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

Troubleshooting

  • Common issues include missing or invalid credentials causing authentication failures.
  • If no download URL is received, the node throws an error indicating the image cannot be downloaded.
  • Network issues or invalid chat/message IDs may cause request failures.
  • To resolve errors, verify credentials, chat ID, and message ID are correct and the Green API service is reachable.

Links

Discussion