Green API Get Document

Download and process WhatsApp documents via Green API

Overview

This node interacts with the Green API to handle WhatsApp document messages. It supports two main operations: retrieving the download URL for a document sent in a WhatsApp chat, and downloading the actual document file. This node is useful for workflows that need to access or process documents shared via WhatsApp, such as archiving files, further processing document content, or integrating WhatsApp documents into other systems.

Use Case Examples

  1. Get the download URL of a document sent in a specific WhatsApp chat by providing the chat ID and message ID.
  2. Download the document file from WhatsApp and optionally save it as binary data within the workflow for further use or storage.

Properties

Name Meaning
Chat ID The WhatsApp chat identifier where the document was sent. It is required to specify the chat context for the document.
Message ID The unique identifier of the WhatsApp message containing the document to be downloaded or whose URL is to be retrieved.

Output

Binary

When downloading the document, the node can output the file as binary data under a configurable binary property name, allowing the file to be used directly in subsequent workflow steps.

JSON

  • downloadUrl - The URL from which the document can be downloaded.
  • mimeType - The MIME type of the document, indicating its file format.
  • fileName - The name of the document file.
  • fileSize - The size of the downloaded document file in bytes (only present when the document is downloaded).
  • chatId - The chat ID where the document was sent.
  • messageId - The message ID of the document message.
  • downloaded - Boolean flag indicating if the document was successfully downloaded (only present when downloading).
  • error - Error message if the operation failed (only present if continue on fail is enabled and an error occurred).

Dependencies

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

Troubleshooting

  • If no download URL is received for a document during the download operation, the node throws an error indicating the missing URL. Ensure the chat ID and message ID are correct and the document exists.
  • Errors related to API requests may occur if the Green API credentials are invalid or expired. Verify the credentials and their permissions.
  • Network issues or incorrect API endpoint URLs can cause request failures. Check network connectivity and API endpoint correctness.

Discussion