Z-API WhatsApp icon

Z-API WhatsApp

Custom operations

Overview

This node enables sending a carousel message via WhatsApp using the Z-API service. A carousel message consists of multiple cards, each with text, an optional image, and optional buttons that users can interact with. This is useful for presenting multiple options or products in a visually appealing way within a chat.

Common scenarios include:

  • E-commerce bots showcasing product catalogs.
  • Customer support bots offering multiple quick-reply options.
  • Marketing campaigns displaying various promotions or services.

For example, a business could send a carousel with cards representing different product categories, each card having buttons to view more details or contact sales.

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 authentication headers.
Phone The recipient's phone number or group ID where the carousel message will be sent.
Message The main text message accompanying the carousel.
Carousel Cards Multiple carousel cards, each containing:
- Card Text Text content displayed on the individual carousel card.
- Image URL Optional URL of an image shown on the carousel card.
- Buttons Optional buttons on the card; each button has:
    Button ID Unique identifier for the button.
    Button Label Text displayed on the button.
    Button Type Type of button: Reply, URL, or Call.
    URL (For URL type) The link opened when the button is clicked.
    Phone (For Call type) The phone number called when the button is clicked.

Output

The node outputs a JSON array where each element corresponds to the response from the Z-API after sending the carousel message. The structure typically includes status information about the message delivery.

No binary data output is produced by this operation.

Dependencies

  • Requires access to the Z-API WhatsApp service.
  • Needs three credentials configured in n8n: the instance ID, token, and client token for authentication.
  • The node makes HTTP POST requests to the Z-API endpoints with appropriate headers.

Troubleshooting

  • Invalid Credentials: If the instance ID, token, or client token are incorrect or expired, the API will reject requests. Verify and update these credentials.
  • Malformed Carousel Data: Ensure each carousel card has required fields like text and unique button IDs. Missing required fields may cause errors.
  • Network Issues: Connectivity problems can cause request failures. Check network access to api.z-api.io.
  • Unsupported Operations: Using operations other than "send-carousel" with the "messages" resource in this context will throw an error.
  • Error Messages: The node throws errors if the operation is unsupported or if the API returns an error. Review the error message for clues and verify input parameters.

Links and References

Discussion