Green API Get Image icon

Green API Get Image

Download and process WhatsApp image messages via Green API

Green API Get Image

AI-generated

Overview

This node downloads and processes WhatsApp image messages using the Green API. It supports multiple input sources for the image data, including message ID with chat ID, direct download URL, or data from a previous node. The node fetches the image, applies optional filters such as format and file size limits, and outputs the image as binary data along with metadata. This is useful for workflows that need to retrieve and handle images sent via WhatsApp, for example, archiving images, processing them further, or integrating with other systems.

Use Case Examples

  1. Downloading an image from a WhatsApp message by providing the message ID and chat ID.
  2. Downloading an image directly from a provided URL.
  3. Processing images obtained from a previous node's output, applying filters like format and size, and saving them with custom filenames.

Properties

Name Meaning
Input Source Source of the image message data, can be message ID, direct download URL, or previous node output.
Message ID WhatsApp message ID containing the image, required if input source is message ID.
Chat ID WhatsApp Chat ID where the message was sent, required if input source is message ID.
Download URL Direct download URL for the image, required if input source is download URL.
Message ID Field Field name containing the message ID in previous node data, used if input source is previous node.
Chat ID Field Field name containing the chat ID in previous node data, used if input source is previous node.
Download URL Field Field name containing the download URL in previous node data, used if input source is previous node.
Binary Property Name Name of the binary property to store the image file.
Options Additional options for processing the image, including metadata inclusion, custom filename, image format filter, and max file size.

Output

JSON

  • success - Indicates if the image download and processing was successful.
  • fileName - The filename of the downloaded image.
  • fileSize - Size of the downloaded image file in bytes.
  • mimeType - MIME type of the image file.
  • imageType - Human-readable image format type.
  • caption - Caption of the image if available.
  • metadata - Metadata about the image including message ID, chat ID, download URL, file size, MIME type, caption, and download timestamp.
  • originalData - Original JSON data from the previous node if input source is previous node.

Dependencies

  • Green API credentials (instance ID and API token)

Troubleshooting

  • Error if neither download URL nor message ID with chat ID is provided.
  • Error if the file size exceeds the specified max file size limit.
  • Error if no file URL is found for the given message ID.
  • Ensure correct field names are provided when using previous node data as input source.
  • Check API credentials and network connectivity for successful image download.

Discussion