MegaAPI icon

MegaAPI

Interact with MegaAPI WhatsApp service - send messages, manage instance, configure webhooks

Overview

This node allows configuring a webhook URL for the MegaAPI WhatsApp service to receive event notifications. Specifically, the Webhook - Configure operation sets up the URL where MegaAPI will send events and selects which types of events to receive. This is useful for integrating WhatsApp event streams into n8n workflows, enabling automation based on incoming messages or connection status changes.

Common scenarios include:

  • Receiving real-time WhatsApp message events to trigger further processing or notifications.
  • Monitoring connection events to track the status of the WhatsApp instance.
  • Capturing all events for comprehensive logging or analytics.

Example: You can configure this node with your n8n webhook URL and select "Message" events to automatically process incoming WhatsApp messages in your workflow.

Properties

Name Meaning
Webhook URL The URL where MegaAPI will send webhook events (e.g., https://your-n8n.com/webhook/abc-def-ghi). This should be an endpoint exposed by your n8n instance to receive incoming HTTP requests.
Events Types of events to receive via the webhook. Options are:
• All — Receive all event types.
• Message — Receive only message-related events.
• Connection — Receive connection status events.

Output

The node outputs JSON data representing the result of the webhook configuration request to MegaAPI. This typically includes confirmation that the webhook was successfully registered along with details of the configured events.

No binary data output is involved in this operation.

Dependencies

  • Requires a publicly accessible webhook URL where MegaAPI can send HTTP POST requests.
  • Depends on MegaAPI WhatsApp service being available and accessible.
  • No explicit API key or credential is shown in the provided code snippet for this operation, but generally, such integrations require authentication credentials configured in n8n.

Troubleshooting

  • Invalid Webhook URL: Ensure the webhook URL is correctly formatted and publicly reachable by MegaAPI. Use HTTPS URLs to avoid security issues.
  • Event Selection Issues: Selecting no events or invalid event types may cause the webhook not to trigger. Always select at least one valid event type.
  • Network Connectivity: If MegaAPI cannot reach the webhook URL due to firewall or network restrictions, events will not be delivered.
  • Error Messages: The node may throw errors like "Unknown webhook operation" if the operation name is incorrect or missing. Verify the operation parameter is set to "configure".
  • Webhook Payload Handling: This node configures the webhook but does not process incoming webhook payloads. Make sure to connect it properly to a Webhook node in n8n to handle incoming events.

Links and References


Note: This summary is based solely on static analysis of the provided source code and property definitions.

Discussion