WSAPI icon

WSAPI

Interact with WSAPI WhatsApp API

Overview

This node integrates with the WSAPI WhatsApp API to perform various operations related to WhatsApp chats. Specifically, the Get Chat operation retrieves detailed information about a specific WhatsApp chat by its identifier. This is useful for workflows that need to fetch chat metadata or status before performing further actions such as messaging, archiving, or analyzing chat data.

Common scenarios:

  • Fetching chat details to display in dashboards or reports.
  • Validating if a chat exists before sending messages.
  • Retrieving group or individual chat info for automation workflows.
  • Using cached results to optimize repeated requests for the same chat.

Example:
A workflow could use this node to get the details of a group chat by its ID, then decide whether to send a notification message based on the group's current status or participants.


Properties

Name Meaning
Chat ID The unique identifier of the WhatsApp chat. For individual contacts, it is the phone number followed by @s.whatsapp.net. For groups, it is the group ID followed by @g.us. Example: 1234567890@s.whatsapp.net (individual) or 120363123456789@g.us (group).
Cache Results Boolean option to enable caching of the chat retrieval result. When enabled, repeated requests with the same Chat ID will return cached data instead of making new API calls.
Cache TTL (sec) Time-to-live in seconds for the cache entry when caching is enabled. Defines how long the cached chat data remains valid before a fresh request is made. Minimum value is 1 second. Default is 300 seconds (5 minutes).

Output

The node outputs JSON data representing the chat details retrieved from the WhatsApp API. The structure typically includes metadata about the chat such as:

  • Chat ID
  • Chat name or subject (for groups)
  • Participants list (for groups)
  • Chat type (individual or group)
  • Status flags (e.g., archived, muted, pinned)
  • Last message timestamp or other relevant chat properties

If the node supports binary data output (not indicated explicitly here), it would represent media or attachments related to the chat, but for the Get Chat operation, the output is primarily JSON metadata.


Dependencies

  • Requires an active connection to the WSAPI WhatsApp API service.
  • Needs an API authentication token or API key credential configured in n8n to authorize requests.
  • The base URL for the API is taken from the node credentials configuration.
  • Optional caching mechanism depends on internal node logic and does not require external dependencies.

Troubleshooting

  • Invalid Chat ID format: Ensure the Chat ID follows the correct pattern (phone@s.whatsapp.net for individuals, groupID@g.us for groups). Incorrect formats will cause API errors.
  • Chat not found: If the chat ID does not exist or is inaccessible, the API may return an error or empty response.
  • Authentication errors: Verify that the API key or token is correctly set up and has permissions to access chat data.
  • Cache stale data: If caching is enabled, outdated chat information might be returned until the cache expires. Adjust the Cache TTL accordingly.
  • Network issues: Connectivity problems with the WSAPI endpoint can cause request failures; check network and API availability.

Links and References


Note: The above summary is based solely on static analysis of the provided source code and property definitions without runtime execution.

Discussion