Actions76
- Message Actions
- Chat Actions
- Contact Actions
- Group Actions
- Create
- List
- Get
- Delete
- Join
- Get Join Info
- Leave
- Get Picture
- Set Picture
- Delete Picture
- Update Subject
- Update Description
- Get Security Info Admin Only
- Set Security Info Admin Only
- Get Security Messages Admin Only
- Set Security Messages Admin Only
- Get Participants
- Add Participant
- Remove Participant
- Promote Admin
- Demote Admin
- Status Actions
- Channel Actions
- Poll Actions
- Profile Actions
- LID Actions
- File Actions
Message → Send File
AI-generatedOverview
This node enables sending files as messages through WhatsApp using the Wappfy API. It supports sending documents or any file type to individual or group chats by specifying the chat ID and the file content. The file can be provided either as a URL or as Base64-encoded data, along with its MIME type and optional caption.
Common scenarios where this node is beneficial include:
- Automating the distribution of invoices, contracts, or reports as PDF files to clients.
- Sharing images, videos, or other media files in customer support workflows.
- Sending promotional materials or brochures to WhatsApp groups or broadcast lists.
Example: Automatically send a PDF invoice stored on a web server to a customer's WhatsApp chat by providing the chat ID and the file URL.
Properties
| Name | Meaning |
|---|---|
| Chat ID | Identifier of the target chat (e.g., 123456789@c.us for direct chat, 123456789@g.us for groups). |
| Media Source | Source format of the file to send: either URL or Base64. |
| File URL | URL of the file to send (required if Media Source is URL). |
| Base64 Data | Base64 encoded string of the file content (required if Media Source is Base64). |
| File Name | Name of the file including extension (used when Media Source is Base64; default is "file"). |
| MIME Type | MIME type of the file (e.g., application/pdf, image/jpeg, video/mp4). |
| Caption | Optional text caption to accompany the file message. |
Output
The node outputs JSON data representing the response from the Wappfy API after attempting to send the file message. This typically includes details about the sent message such as message ID, status, timestamps, or error information if the operation failed.
If multiple input items are processed, the output is an array of JSON objects corresponding to each item.
The node does not output binary data directly; it only returns JSON metadata about the sent file message.
Dependencies
Requires a valid Wappfy API credential with:
- Base URL of the Wappfy API instance.
- Instance name identifier.
- An API key for authentication.
The node makes HTTP POST requests to the Wappfy API endpoints to send files.
Proper network access to the file URLs (if using URL as media source) must be ensured.
Troubleshooting
Missing or invalid credentials: Ensure that the Wappfy API credentials are correctly configured with a valid API key, base URL, and instance name.
Invalid Chat ID: The chat ID must be correctly formatted and correspond to an existing WhatsApp chat. Errors may occur if the chat ID is incorrect or the bot is not part of the group.
Incorrect MIME type: Providing an incorrect MIME type may cause the file to be rejected or displayed improperly. Verify the MIME type matches the file content.
File URL inaccessible: If using a URL as the media source, ensure the URL is publicly accessible and returns the file without authentication.
Base64 data issues: When using Base64 data, ensure the encoding is correct and complete. Truncated or malformed Base64 strings will cause errors.
API errors: The node throws errors received from the Wappfy API. Check the error message for details and verify parameters accordingly.
Links and References
- Wappfy API Documentation (for detailed API usage and supported operations)
- WhatsApp Chat ID Format (explains chat ID formats)
- MIME Types Reference