Actions21
- Message Actions
- Group Actions
- Chat Actions
- Contact Actions
Overview
The "Upload File" operation of the Green API node allows users to upload a file from their local system to the Green API cloud storage associated with WhatsApp messaging. This is useful when you want to send media files (images, documents, videos, etc.) via WhatsApp by first uploading them to the cloud, enabling subsequent sharing or referencing in messages.
Common scenarios include:
- Uploading images or documents to be sent later in WhatsApp chats.
- Preparing files for reuse across multiple messages or workflows.
- Managing media assets centrally before distribution.
Example: You have a marketing image on your computer that you want to share with multiple WhatsApp contacts. First, you upload the file using this operation, then use the returned file ID or URL to send it efficiently.
Properties
| Name | Meaning |
|---|---|
| File Path | The full path to the file on your local system that you want to upload. |
Output
The node outputs a JSON array where each item corresponds to the response from the Green API after attempting to upload the file. The JSON typically contains metadata about the uploaded file such as its identifier or URL in the cloud storage.
If the input data includes binary data under the key data, the node uses that binary content for the upload instead of reading from the file path.
No binary output is produced by this operation; the output is purely JSON describing the upload result.
Dependencies
- Requires an active Green API account with valid credentials including an instance ID and API token.
- Needs access to the local filesystem to read the file specified by the "File Path".
- Uses HTTP POST requests to the Green API endpoint for uploading files.
- Node must be configured with the appropriate API authentication credentials.
Troubleshooting
- Failed to read file: If the file path is incorrect or inaccessible, the node will throw an error indicating failure to read the file. Ensure the path is correct and accessible by n8n.
- Failed to upload file: Network issues, invalid credentials, or API errors can cause upload failures. Check your API credentials and network connectivity.
- Using binary data: If you provide binary data in the input under the key
data, ensure it is properly formatted base64 content with a filename; otherwise, the node falls back to reading from the file path. - Misconfiguration: Using this operation while the node is set to trigger mode will cause an error. Make sure the node mode is set to "Action".
Links and References
- Green API Documentation – Official API docs for details on file uploads and other WhatsApp actions.
- WhatsApp Business API Media Messages – General info on sending media via WhatsApp APIs.
This summary focuses exclusively on the "Message" resource and "Upload File" operation as requested.