Actions148
- Chats Actions
- Chat Contacts Actions
- Chat Messages Actions
- Chat Files Actions
- Files Actions
- Team Actions
- Labels Actions
- Departments Actions
- Quick replies Actions
- Queue Actions
- WhatsApp session Actions
- WhatsApp profile Actions
- Business catalog Actions
- Campaigns Actions
- Meeting Links Actions
- User Status Actions
- Webhooks Actions
- Other Actions
- Send messages Actions
- Outbound Messages Actions
- WhatsApp Numbers Actions
- Groups Actions
- Channels Actions
Overview
This node enables uploading files to the SparkBot WhatsApp API under the "Files" resource with the "Upload File" operation. It supports uploading files by specifying a URL, allowing users to send media content such as images, voice messages, or other file types to WhatsApp contacts or groups via the API.
Common scenarios include:
- Automating the sending of media files hosted on external servers.
- Uploading files with custom metadata like filename, expiration time, and access permissions.
- Tagging files for easier management and retrieval within the WhatsApp business environment.
Practical example:
- A marketing automation workflow that uploads promotional images from a URL to WhatsApp campaigns.
- Sending voice message files stored on a cloud server directly to customers through WhatsApp.
Properties
| Name | Meaning |
|---|---|
| Upload Method | Method to upload the file. Options: β’ From URL β Upload file by providing its URL. β’ From URL (Without Binary Data Support) β Upload file by URL but without full binary data support in this version. |
| File URL | The URL of the file to be uploaded. Required when using either upload method. |
| File Options | Collection of optional settings for the uploaded file: β’ Filename β Custom name for the uploaded file. β’ Reference β Identifier reference for the file. β’ Format β Display format of the file; options: GIF, Voice Message, Native. β’ Expiration β How long before the file expires; options range from 10 minutes up to 2 years. β’ Permission β Access level for the file; options: Public, Read-only, Private. β’ Tags β List of tags to categorize or label the file. |
Output
The node outputs JSON data representing the response from the SparkBot API after uploading the file. This typically includes details about the uploaded file such as its ID, URL, metadata (filename, format, expiration, permission), and any references or tags assigned.
If binary data is involved (depending on upload method), the node may handle or return binary content related to the file upload, but the current implementation notes limited binary support for one upload method.
Dependencies
- Requires an API key credential for authenticating with the SparkBot WhatsApp API.
- Network access to the provided file URLs for downloading/uploading files.
- Proper configuration of the SparkBot API credentials within n8n.
Troubleshooting
- File URL unreachable or invalid: Ensure the URL is accessible and points directly to a valid file.
- Permission errors: Verify that the API key has sufficient rights to upload files and set the requested permissions.
- Unsupported file formats or sizes: Check the API documentation for supported file types and size limits.
- Expiration value issues: Use only the predefined expiration options; invalid values may cause errors.
- Binary data limitations: When using the "From URL (Without Binary Data Support)" method, some features might not work fully; consider switching to the full "From URL" method if binary support is needed.
Common error messages will generally relate to network issues, authentication failures, or invalid parameters. Reviewing the error message details and verifying input properties usually resolves these.
Links and References
- SparkBot WhatsApp API Documentation (example placeholder, replace with actual link if available)
- n8n Documentation on Creating Custom Nodes
- General info on WhatsApp Business API Media Uploads