MegaAPI icon

MegaAPI

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

Overview

The node provides integration with the MegaAPI WhatsApp service, enabling various operations such as sending messages, managing WhatsApp instances, configuring webhooks, and parsing incoming WhatsApp messages. Specifically, for the Parser resource with the Parse Message operation, the node parses and normalizes incoming WhatsApp message payloads received from a webhook. It can automatically handle media downloads embedded in the message.

This functionality is beneficial when you want to process raw WhatsApp webhook data into a structured format suitable for further automation or integration workflows. For example, you might use it to extract text content, sender information, timestamps, and media attachments from incoming WhatsApp messages to store them in a database, trigger notifications, or forward them to other systems.

Properties

Name Meaning
WhatsApp Payload The complete JSON payload of the WhatsApp message received from the webhook. This includes all message details such as sender info, message content, timestamp, and any media attachments.

Output

  • The output json field contains the parsed and normalized representation of the WhatsApp message.
  • It typically includes extracted fields like sender ID, message text, message type, timestamp, and possibly downloaded media metadata if the message contains media.
  • If the message includes media, the node may download and provide access to the media content (binary data), allowing subsequent nodes to process or store the media files.

Dependencies

  • Requires receiving the full WhatsApp message payload from a MegaAPI webhook or similar source.
  • No explicit external API keys or credentials are required for parsing itself, but the overall MegaAPI integration may require an API key credential configured in n8n.
  • The node depends on internal helper functions defined in the bundled operations module to perform parsing and media handling.

Troubleshooting

  • Common issues:

    • Providing incomplete or malformed WhatsApp payload JSON will cause parsing errors.
    • If media download fails, the output may lack expected media content.
    • Using the wrong resource or operation combination will throw an "Unknown resource" or "Unknown operation" error.
  • Error messages:

    • "Unknown parser operation: <operation>": Indicates that the specified operation under the Parser resource is not supported. Verify the operation name.
    • "Unknown resource: <resource>": The resource parameter is invalid or unsupported.
    • Errors related to JSON parsing usually mean the input payload is not valid JSON or missing required fields.
  • Resolution tips:

    • Ensure the WhatsApp payload JSON is complete and correctly formatted.
    • Confirm the node parameters specify Resource = "Parser" and Operation = "Parse Message".
    • Check network connectivity if media download is involved.
    • Enable "Continue On Fail" in the node settings to capture errors per item without stopping the workflow.

Links and References

Discussion