Overview
This node, named "CHACHAT Chat File Node," is designed to send file messages via a Chat API. It allows users to specify a phone number, a file URL, and the MIME type of the file to be sent. The node constructs a message payload with these details and sends it to the Chat API endpoint for delivering files.
Common scenarios where this node is beneficial include:
- Automating sending documents or media files to users through a chat platform.
- Integrating file sharing capabilities into workflows that require notifying or updating users via chat.
- Sending reports, invoices, or any file-based information directly to a user's phone number.
For example, a business could use this node to automatically send PDF invoices to customers after a purchase, or a support system might send troubleshooting guides as files to users requesting help.
Properties
| Name | Meaning |
|---|---|
| Phone Number | The recipient's phone number for the Chat API message. |
| File URL | The URL pointing to the file to be sent in the message. |
| MIME Type | The MIME type of the file being sent (e.g., application/pdf, image/png). |
Output
The node outputs JSON data representing the response from the Chat API after attempting to send the file message. This typically includes confirmation details or error information returned by the API.
The output structure contains at least one field:
json: The full JSON response from the Chat API request to send the file message.
No binary data output is produced by this node.
Dependencies
- Requires an active connection to the Chat API service, authenticated via an API key credential.
- The node uses the Axios HTTP client library to make POST requests to the Chat API.
- The Chat API base URL and token must be configured in the node credentials.
- Network access to the specified file URL must be available so the Chat API can retrieve the file.
Troubleshooting
- Invalid Phone Number: If the phone number format is incorrect or not supported by the Chat API, the request may fail. Ensure the phone number matches the expected format.
- File URL Accessibility: The file URL must be publicly accessible or accessible by the Chat API service; otherwise, the file cannot be retrieved, causing errors.
- Incorrect MIME Type: Providing an incorrect MIME type might cause the file to be handled improperly or rejected.
- API Authentication Errors: Missing or invalid API keys will result in authentication failures. Verify that the API key credential is correctly set up.
- Network Issues: Connectivity problems between n8n, the Chat API, or the file hosting server can cause timeouts or failed requests.
- Error Handling: If the node encounters an error during execution and "Continue On Fail" is disabled, it will throw an error stopping the workflow. Enabling "Continue On Fail" allows the workflow to proceed despite individual item errors.
Links and References
- Axios HTTP Client Documentation
- Refer to your Chat API provider's official documentation for detailed information on message formats, authentication, and error codes.