Actions17
Overview
This node integrates with the Z-API WhatsApp service to send various types of WhatsApp messages programmatically. Specifically, the Send Text With Buttons operation allows users to send a text message accompanied by interactive buttons to a specified phone number or group ID. This is useful for creating engaging conversations where recipients can quickly respond by clicking buttons instead of typing.
Common scenarios include:
- Customer support bots offering quick reply options.
- Marketing campaigns prompting users to select product categories or services.
- Surveys or polls where users choose from predefined answers.
For example, sending a message like "Which product are you interested in?" with buttons labeled "Washing Machine", "Refrigerator", and "Microwave" lets users respond easily by tapping a button.
Properties
| Name | Meaning |
|---|---|
| Instance | Your Z-API instance ID used to identify your WhatsApp session on the Z-API platform. |
| 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 group ID to which the message will be sent. |
| Message | The text content of the message that will appear above the buttons. |
| Buttons | A collection of interactive buttons to include with the message. Each button has: |
| - Button ID: Unique identifier for the button (string). | |
| - Button Label: Text displayed on the button (string). |
Output
The node outputs a JSON array containing the response from the Z-API service for each input item processed. The structure of each response depends on the Z-API API but generally includes status information about the message delivery.
Example output JSON snippet:
[
{
"status": "success",
"messageId": "abc123",
"phone": "601154272790"
}
]
No binary data is produced by this operation.
Dependencies
- Requires an active Z-API WhatsApp instance with valid credentials: instance ID, token, and client token.
- The node makes HTTP POST requests to the Z-API endpoints.
- Proper network connectivity to
https://api.z-api.iois necessary. - 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 requests. Verify and update credentials as needed.
- Incorrect Phone Number Format: Ensure the phone number includes country code without symbols or spaces (e.g., "601154272790").
- Empty or Malformed Buttons: Each button must have a unique ID and label. Missing these fields may cause API errors.
- API Rate Limits: Sending too many messages in a short time may trigger rate limiting by Z-API.
- Network Issues: Connectivity problems will cause request failures; check firewall and internet access.
- Unsupported Operation Error: If the operation name is misspelled or not supported, the node throws an error indicating the operation is unsupported.
To resolve errors, carefully review the error message returned by the node and verify all input parameters and credentials.
Links and References
- Z-API Official Documentation
- WhatsApp Business API Overview
- n8n HTTP Request Node Documentation (for understanding underlying HTTP calls)