Wappfy icon

Wappfy

Interact with WhatsApp through Wappfy API

Message → Send File

AI-generated

Overview

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

Discussion