WaAPI icon

WaAPI

Interact with WaAPI API

Actions83

Overview

The node provides an operation to synchronize chat history from a messaging platform using the WaAPI API. Specifically, the "Sync Chat History" operation fetches and updates the chat messages for a given chat identified by its unique chat ID. This is useful for scenarios where you want to keep your local data or workflow in sync with the latest messages from a particular chat, such as archiving conversations, analyzing chat content, or triggering workflows based on new messages.

Practical examples include:

  • Automatically backing up chat histories for compliance or record-keeping.
  • Monitoring specific chats for keywords or events to trigger alerts or actions.
  • Integrating chat data into CRM or support systems for enhanced customer interaction tracking.

Properties

Name Meaning
Id Instance ID (a required numeric identifier for the instance).
Chat Id The unique identifier of the chat to sync. Format: <countrycode_short><usernumber>@c.us for individual chats or @g.us for groups. Example: 50664083362@c.us.

Output

The node outputs JSON data representing the synchronized chat history for the specified chat ID. This typically includes message details such as timestamps, sender information, message content, and possibly metadata related to the chat session.

If binary data is involved (e.g., media files in chat), it would be handled separately, but this node primarily focuses on JSON chat message data.

Dependencies

  • Requires an API key credential for authenticating with the WaAPI service.
  • The node communicates with the WaAPI REST API endpoint at https://waapi.app/api/v1.
  • Proper configuration of the API key credential within n8n is necessary for successful requests.

Troubleshooting

  • Common issues:
    • Invalid or missing API key credential will cause authentication failures.
    • Incorrect chat ID format may result in errors or empty responses.
    • Network connectivity problems can prevent access to the WaAPI service.
  • Error messages:
    • Authentication errors usually indicate invalid credentials; verify and update the API key.
    • "Chat not found" or similar errors suggest the chat ID does not exist or is inaccessible; double-check the chat ID format.
    • Timeout or connection errors require checking network settings and API availability.

Links and References

Discussion