ZuckZapGo AI icon

ZuckZapGo AI

Send WhatsApp messages using ZuckZapGo - optimized for AI workflows

Overview

The "Send Document" operation of the ZuckZapGo AI node enables sending document files (such as PDF, DOCX, XLSX, etc.) via WhatsApp using the ZuckZapGo API. This operation supports multiple input methods for the document content, including binary data from a previous node, base64-encoded strings, or direct URLs to the document file. Users can specify custom filenames and optional captions for the documents.

This node is beneficial in scenarios where automated workflows need to share files with WhatsApp contacts, groups, newsletters, or LIDs. For example, businesses can automatically send invoices, contracts, reports, or brochures directly to customers or team members through WhatsApp, enhancing communication efficiency.

Properties

Name Meaning
Recipient Phone number, Group ID (@g.us), Newsletter ID (@newsletter), or LID (@lid) to which the document will be sent.
Document Source Method to provide the document:
- Binary Data: Use binary data from a previous node.
- Base64: Provide a base64 encoded document string.
- URL: Provide a direct URL to the document file.
Binary Property (If Document Source is Binary) The name of the binary property containing the document data in the input item.
Base64 Document (If Document Source is Base64) The base64 encoded document string, including the data URL prefix (e.g., data:application/pdf;base64,...).
Document URL (If Document Source is URL) The URL pointing to the document file to be sent.
File Name The filename to assign to the document when sending (e.g., document.pdf). Required for proper identification of the file on the recipient's side.
Caption Optional caption text to accompany the document message.
Additional Options Collection of optional parameters:
- Message ID: Custom message identifier (auto-generated if omitted).
- Presence Simulation: Simulate typing indicator for specified milliseconds.
- Message Duration: Set disappearing message duration.
- Context Information: Reply, forward, mention options.
- View Once: Not applicable for documents but available for other media types.
- Link Preview: Not applicable for documents.
(Other options apply to different operations.)

Output

The node outputs a JSON object representing the response from the ZuckZapGo API after attempting to send the document. The structure typically includes:

  • data: Contains details about the sent message, such as message ID, status, timestamps, and any metadata returned by the API.
  • _aiOptimized (optional): Indicates if the response was truncated or optimized for AI processing.
  • _truncated (optional): Provides information about truncation if the response was shortened.

If the operation fails, the output JSON will contain an error field describing the issue.

No binary data is output for this operation.

Dependencies

  • Requires an active connection to the ZuckZapGo API service.
  • Requires an API authentication credential configured in n8n (an API key or token).
  • The node uses internal helper functions to prepare media data and make HTTP requests to the API.
  • Network access to URLs provided for documents (if using URL source) must be available.

Troubleshooting

  • Binary Property Not Found: If the document source is set to binary but the specified binary property does not exist in the input data, the node will throw an error like Binary property "propertyName" not found. Ensure the binary data exists and the property name matches exactly.
  • Invalid Document URL: Providing an invalid or inaccessible URL may cause the API request to fail. Verify that the URL is correct and publicly accessible.
  • Missing Required Fields: The fileName and document content (via binary, base64, or URL) are required. Omitting these will result in errors.
  • API Authentication Errors: If the API credentials are missing or invalid, the node will fail to authenticate with the ZuckZapGo service.
  • Message Sending Failures: Errors returned from the API (e.g., invalid recipient format, unsupported document type) will be included in the output error field. Review the error message for corrective action.

Links and References

  • ZuckZapGo GitHub Repository – Official documentation and source code for the ZuckZapGo API.
  • WhatsApp Business API documentation (for general understanding of message types and formats).

Discussion