WTS Chat icon

WTS Chat

Get data from Wts API

Overview

This node interacts with the WTS Chat API to manage chat messages within sessions. Specifically, the "Get All Messages" operation under the "Message" resource retrieves all messages associated with a given chat session. This is useful for scenarios where you want to fetch conversation history or analyze message exchanges in a particular session.

Practical examples include:

  • Retrieving all messages from a customer support chat session to analyze customer interactions.
  • Exporting chat logs for auditing or record-keeping.
  • Integrating chat history into CRM or analytics platforms.

Properties

Name Meaning
Session ID The unique identifier of the chat session whose messages you want to retrieve.
CreatedAt.After Filter messages created after this date/time (format: YYYY-MM-DD hh:mm, timezone-aware).
CreatedAt.Before Filter messages created before this date/time (format: YYYY-MM-DD hh:mm, timezone-aware).
UpdatedAt.After Filter messages updated after this date/time (format: YYYY-MM-DD hh:mm, timezone-aware).
UpdatedAt.Before Filter messages updated before this date/time (format: YYYY-MM-DD hh:mm, timezone-aware).
Auto Pagination Whether to automatically paginate through multiple pages of results, aggregating all items.
Max Pages Maximum number of pages to retrieve when auto pagination is enabled (1 to 100).
Page Number The specific page number to retrieve when auto pagination is disabled.
Page Size Number of messages per page when auto pagination is disabled (1 to 100).
Order By Field name by which to sort the messages (e.g., creation date).
Order Direction Direction of sorting: Ascending or Descending.

Output

The output is an array of JSON objects, each representing a message retrieved from the specified session. Each message object contains details such as message content, sender information, timestamps, and status.

If binary data (such as files) are part of messages, the node handles them accordingly, but the primary output field json contains structured message data.

Dependencies

  • Requires an active connection to the WTS Chat API via an API key credential.
  • The node expects the API key to be configured in n8n credentials for authentication.
  • No additional external dependencies beyond the WTS Chat API.

Troubleshooting

  • SessionID is empty: If the "Session ID" property is not provided or left blank, the node will throw an error indicating that the SessionID must be filled in.
  • API errors: Any issues communicating with the WTS Chat API (e.g., invalid API key, network issues) will result in errors wrapped as NodeApiError with descriptive messages.
  • Pagination settings: Misconfiguration of pagination properties (e.g., setting page size outside allowed range) may cause unexpected behavior or errors.
  • Date filters format: Ensure date/time filters follow the required format (YYYY-MM-DD hh:mm) and consider time zone implications to avoid filtering issues.

Links and References

Discussion