MegaAPI icon

MegaAPI

Interact with MegaAPI WhatsApp service

Overview

This node operation sends an interactive list message to a specified WhatsApp contact using the MegaAPI WhatsApp service. The list message allows users to select one or multiple options from organized sections, making it ideal for scenarios such as presenting payment methods, product categories, or menu choices directly within WhatsApp conversations.

Practical examples include:

  • Sending a payment options list where users can choose between PIX or credit card.
  • Presenting a menu of services or products with detailed descriptions.
  • Allowing users to select multiple preferences or items in a single interaction.

Properties

Name Meaning
To (Contact) The WhatsApp contact to send the list message to. Must be in the format phone_number@s.whatsapp.net (e.g., 551199999999@s.whatsapp.net).
Button Text The text displayed on the list button that users tap to open the list options.
Text The main textual content of the list message shown above the list sections.
Title The title of the list message, typically a short heading displayed prominently.
Description A description text appearing below the title, providing additional context or instructions.
Sections (JSON) A JSON array defining the sections and rows of the list. Each section has a title and contains multiple rows, each with a title, description, and unique row ID. This structure organizes selectable options presented to the user.
List Type Defines the selection behavior:
- Single Select (0): User can select only one option.
- Multi Select (1): User can select multiple options.

Output

The node outputs a JSON object representing the response from the MegaAPI WhatsApp service after sending the list message. This typically includes confirmation details such as message IDs or status indicators confirming successful delivery.

If the operation fails, the output may contain an error message describing the issue.

No binary data is produced by this operation.

Dependencies

  • Requires an active MegaAPI WhatsApp service connection configured with appropriate API credentials (an API key/token and host URL).
  • The node uses HTTP requests authenticated via bearer token to communicate with the MegaAPI backend.
  • Proper configuration of credentials in n8n is necessary for successful execution.

Troubleshooting

  • Invalid Contact Format: Ensure the "To (Contact)" property follows the exact format phone_number@s.whatsapp.net. Missing or malformed contacts will cause errors.
  • Malformed Sections JSON: The "Sections (JSON)" must be valid JSON with correct structure (sections array containing objects with titles and rows). Invalid JSON or missing required fields will result in request failures.
  • API Authentication Errors: If the API token or host is incorrect or expired, the node will fail to send messages. Verify credential correctness and validity.
  • Unknown Operation or Resource Errors: These indicate misconfiguration of the node parameters; ensure "Resource" is set to "Message" and "Operation" to "Send List Message".
  • Network Issues: Connectivity problems to the MegaAPI service will cause timeouts or errors; check network access and service availability.

Links and References

Discussion