Green API icon

Green API

Send WhatsApp messages via Green API

Message → Send File By Upload

AI-generated

Overview

This node operation sends a file to a specified WhatsApp chat by uploading the file from the user's system. It supports adding an optional caption to the file. This is useful for scenarios where users want to share local files directly through WhatsApp, such as images, documents, or other media files, with an optional descriptive caption.

Use Case Examples

  1. Sending a photo from a local drive to a WhatsApp contact with a caption describing the image.
  2. Uploading and sending a PDF document to a group chat with an optional note.

Properties

Name Meaning
File Path Path to the file on the user's system to be uploaded and sent.
Caption Optional caption text to accompany the file being sent.

Output

JSON

  • idMessage - ID of the sent message returned by the API
  • status - Status of the file sending operation
  • chatId - ID of the chat where the file was sent
  • timestamp - Timestamp of when the file was sent

Dependencies

  • Requires an API key credential for Green API (instance ID and API token) to authenticate requests.

Troubleshooting

  • Common issues include file read errors if the file path is incorrect or inaccessible, resulting in a 'Failed to read file' error.
  • API request failures due to invalid credentials or network issues, resulting in errors like 'Failed to send file by upload'.
  • Ensure the file path is correct and accessible by the n8n instance.
  • Check that the API credentials (instance ID and token) are valid and have the necessary permissions.

Links

Discussion