Z-API WhatsApp icon

Z-API WhatsApp

Custom operations

Overview

This node integrates with the Z-API WhatsApp service to send various types of WhatsApp messages and perform related chat actions. Specifically, the Send OTP Button operation allows sending a WhatsApp message containing an OTP (One-Time Password) code along with a button that users can tap to copy or interact with the OTP easily.

Common scenarios for this node include:

  • Automating OTP delivery for user authentication or verification workflows.
  • Sending secure login codes via WhatsApp with a convenient button for quick copying.
  • Enhancing user experience by embedding interactive buttons in WhatsApp messages.

For example, you could use this node to send a message like "Your verification code is 123456" with a button labeled "Copy OTP" that users can tap to quickly copy 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 where the OTP message will be sent.
Message The text message content to send alongside the OTP button.
OTP Code The actual OTP code value to send in 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 the API response confirming the success or failure of the OTP button message sending.

If the operation succeeds, the output JSON usually includes details such as message IDs, status, or confirmation data returned by the Z-API endpoint.

This node does not output binary data.

Dependencies

  • Requires access to the Z-API WhatsApp service.
  • Needs three credentials: an instance ID, a token, and a client token for authenticating API requests.
  • The node makes HTTP POST requests to Z-API endpoints using these credentials.
  • 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 accordingly.
  • Incorrect Phone Number Format: Ensure the phone number is in the correct international format without extra characters.
  • Missing Required Fields: All required properties (Instance, Token, Client Token, Phone, Message, OTP Code, Button Text) must be provided; otherwise, the request will fail.
  • API Rate Limits or Quotas: Excessive requests may lead to throttling by Z-API. Monitor usage limits.
  • Network Issues: Connectivity problems can cause request failures. Check network access to https://api.z-api.io.
  • Error Messages: The node throws errors if the operation is unsupported or parameters are missing. Review error messages for guidance.

Links and References

Discussion