Actions17
Overview
This node integrates with the Z-API WhatsApp service to send various types of WhatsApp messages programmatically. Specifically, the Send OTP Button operation allows sending a message containing an OTP (One-Time Password) code along with a clickable button that users can interact with, for example, to copy the OTP easily.
Common scenarios where this node is beneficial include:
- Automating two-factor authentication (2FA) by sending OTP codes via WhatsApp.
- Enhancing user experience by providing a convenient button to copy the OTP directly from the message.
- Sending secure verification codes in workflows requiring identity confirmation.
Practical example:
- A web application triggers this node to send an OTP code to a user's WhatsApp number during login or transaction verification. The user receives a message with the OTP and a "Copy OTP" button to quickly use the code.
Properties
| Name | Meaning |
|---|---|
| Instance | Your Z-API instance ID used to identify your WhatsApp API instance. |
| Token | Your Z-API token for authenticating API requests. |
| Client Token | Your Z-API client token for additional API authentication. |
| Phone | The recipient's phone number or group ID to which the OTP message will be sent. |
| Message | The text content of the message accompanying the OTP button. |
| OTP Code | The actual OTP code to be sent within the message. |
| Image URL | (Optional) URL of an image to include with the OTP button message. |
| Button Text | The label text displayed on the OTP button (e.g., "Copy OTP"). |
Output
The node outputs a JSON array where each element corresponds to the response from the Z-API service for each input item processed. The JSON structure typically contains details about the success or failure of the message sending request, including any metadata returned by the API.
If the operation succeeds, the output JSON confirms the message was sent; if it fails, error information is included.
This node does not output binary data.
Dependencies
- Requires access to the Z-API WhatsApp service.
- Needs three credentials configured in n8n: an instance ID, a token, and a client token for authenticating API requests.
- The node makes HTTP POST requests to the Z-API endpoints using these credentials.
- No other external dependencies are required.
Troubleshooting
Common issues:
- Invalid or expired tokens leading to authentication failures.
- Incorrect phone number format causing message delivery errors.
- Network connectivity problems preventing API calls.
- Missing required parameters such as instance ID or OTP code.
Error messages and resolutions:
"The operation "send-otp-button" is not supported for resource "messages"!":This indicates a misconfiguration or unsupported operation; ensure the Resource is set to "Message" and Operation to "Send OTP Button".- Authentication errors usually mention invalid tokens; verify that the instance, token, and client token are correct and active.
- API request failures may return HTTP status codes and messages; check the API documentation and logs for details.
- If the node throws errors but you want the workflow to continue, enable "Continue On Fail" in the node settings.
Links and References
- Z-API Official Documentation — For detailed API usage and authentication.
- WhatsApp Business API Overview — Background on WhatsApp messaging capabilities.
- n8n HTTP Request Node — Understanding how HTTP requests work in n8n nodes.