Actions17
Overview
This node integrates with the Z-API WhatsApp service to send various types of WhatsApp messages programmatically. Specifically, for the Message - Send Document operation, it allows users to send a document file (such as PDF, DOCX, etc.) to a specified phone number or group via WhatsApp.
Common scenarios where this node is beneficial include:
- Automating the distribution of invoices, contracts, or reports directly through WhatsApp.
- Sending user manuals or brochures to customers on demand.
- Sharing official documents in customer support workflows.
For example, a business could automatically send a PDF invoice to a customer’s WhatsApp after a purchase is completed.
Properties
| Name | Meaning |
|---|---|
| Instance | Your Z-API instance ID used to identify your WhatsApp API session. |
| Token | Your Z-API token for authenticating API requests. |
| Client Token | Your Z-API client token for additional authentication security. |
| Phone | The recipient's phone number or WhatsApp group ID where the document will be sent. |
| Document URL | The publicly accessible URL of the document file to send (e.g., a PDF hosted online). |
| File Name | The display name for the document file as it will appear in WhatsApp. |
| Extension | The file extension/type of the document (e.g., pdf, docx). |
Output
The node outputs a JSON object representing the response from the Z-API WhatsApp service after attempting to send the document. This typically includes status information about the message delivery, any error messages if applicable, and metadata returned by the API.
No binary data output is produced by this operation since the document is sent via a URL reference rather than uploading raw binary content.
Dependencies
- Requires an active Z-API WhatsApp account with valid credentials: instance ID, token, and client token.
- The document must be accessible via a public URL.
- The node makes HTTP POST requests to the Z-API endpoints.
- No additional environment variables are required beyond the provided credentials.
Troubleshooting
- Invalid Credentials: If the instance ID, token, or client token are incorrect or expired, the API will reject the request. Verify and update credentials accordingly.
- Document URL Issues: The document URL must be publicly accessible without authentication. Private or inaccessible URLs will cause failures.
- Unsupported File Extension: Ensure the file extension matches the actual document type and is supported by WhatsApp.
- Phone Number Format: The phone number or group ID must be correctly formatted according to WhatsApp requirements; otherwise, the message will not be delivered.
- API Errors: Network issues or API rate limits may cause errors. Check the error messages returned in the output JSON for guidance.
Links and References
- Z-API WhatsApp Documentation (for detailed API usage and credential setup)
- WhatsApp Business API Overview (general info on WhatsApp messaging capabilities)