Actions10
Overview
This node allows sending various types of messages through a messaging API, focusing on the "Send Message" resource. Specifically, for the "Send Document" operation, it sends documents to a specified phone number. Users provide the document as a URL or base64 string along with metadata such as file extension, filename, and an optional caption.
Common scenarios include:
- Sending invoices, contracts, or reports as PDF or other document formats.
- Sharing manuals or guides directly within chat conversations.
- Automating document delivery in customer support or sales workflows.
Example: Automatically send a PDF contract to a client’s WhatsApp number after they complete a form.
Properties
| Name | Meaning |
|---|---|
| Phone | The recipient's phone number in international format (e.g., 5511999999999). |
| URL or Base64 | The document content provided either as a direct URL or a base64 encoded string. |
| Extension | The file extension/type of the document (e.g., pdf, docx). |
| Filename | The name of the document file to be sent (e.g., "Contract.pdf"). |
| Caption | Optional text message caption accompanying the document. |
| Additional Fields | Optional extra settings including: |
| - Delay Message | Number of seconds to wait before sending the message (1-15 seconds). |
| - Delay Typing | Number of seconds to show "Typing..." status before sending (0-15 seconds). |
| - Message ID to Reply | ID of a message to which this document message should reply. |
Output
The node outputs a JSON array where each item corresponds to the response from the messaging API for each input item processed. The exact structure depends on the API but generally includes confirmation details about the sent message.
If binary data is involved (not typical for this operation), it would represent media content sent or received, but here the focus is on JSON responses confirming document delivery.
Dependencies
- Requires an API key credential for authenticating with the messaging service.
- The node uses an HTTP POST request to send the document data to the API endpoint.
- No additional external dependencies beyond the configured API credentials.
Troubleshooting
- Invalid phone number format: Ensure the phone number is in international format without spaces or special characters.
- Missing required fields: The node requires
phone,urlOrBase64, andextensionfor sending documents; missing any will cause errors. - Unsupported file extension: Verify that the document extension is supported by the messaging platform.
- API authentication errors: Check that the API key credential is correctly configured and has necessary permissions.
- Delays not working as expected: Delays are limited between 0-15 seconds; values outside this range may cause errors or be ignored.
- Unknown operation error: If the operation parameter is incorrect or misspelled, the node throws an error indicating the operation is unknown.
Links and References
- Messaging API Documentation (generic placeholder link)
- n8n documentation on Creating Custom Nodes
- General best practices for sending media messages via APIs