MegaAPI icon

MegaAPI

Interact with MegaAPI WhatsApp service

Chatwoot → Process Webhook to Chatwoot

AI-generated

Overview

This node operation processes a WhatsApp webhook payload from MegaAPI and automatically creates or updates messages in Chatwoot. It is useful for integrating WhatsApp messaging with Chatwoot, enabling seamless message synchronization and management between the two platforms. For example, when a new WhatsApp message is received via MegaAPI webhook, this node can create a corresponding message in Chatwoot, optionally creating contacts and conversations if they do not exist.

Use Case Examples

  1. Automatically sync incoming WhatsApp messages to Chatwoot for unified customer support.
  2. Create or find Chatwoot conversations based on WhatsApp webhook data to maintain conversation continuity.
  3. Download media from WhatsApp messages and upload them to Chatwoot to prevent URL expiration.

Properties

Name Meaning
WhatsApp Payload The WhatsApp webhook payload from MegaAPI, must be valid JSON and typically mapped from the webhook body.
Account ID Chatwoot Account ID to specify which Chatwoot account to process messages for.
Inbox ID Chatwoot Inbox ID to specify the inbox where messages should be processed.
Conversation ID Optional Chatwoot Conversation ID. If provided, messages are sent directly to this conversation; otherwise, a conversation is created or found automatically.
Processing Options Options to control processing behavior such as creating contacts, creating conversations, downloading media, and enabling detailed logs.

Output

JSON

  • messageId - ID of the message created or processed in Chatwoot.
  • conversationId - ID of the conversation in Chatwoot where the message was sent or found.
  • contactId - ID of the contact in Chatwoot associated with the message.
  • status - Status of the message processing operation (e.g., success, error).
  • error - Error message if the processing failed.

Dependencies

  • Requires credentials for MegaAPI and Chatwoot API access to authenticate and perform operations.

Troubleshooting

  • Ensure the WhatsApp payload is valid JSON and correctly mapped from the webhook body to avoid parsing errors.
  • Verify that the Chatwoot Account ID and Inbox ID are correct and accessible with the provided credentials.
  • If media download is enabled, ensure the MegaAPI media URLs are accessible and the Chatwoot instance supports media uploads.
  • Enable logs option can help diagnose issues by providing detailed debug information in the node execution logs.

Links

  • Chatwoot API Documentation - Official API documentation for Chatwoot to understand message, contact, and conversation management.
  • MegaAPI Documentation - Documentation for MegaAPI WhatsApp service, including webhook payload structure and media handling.

Discussion