WTS Chat icon

WTS Chat

Get data from Wts API

Overview

This node operation "Get All Messages" under the "Message" resource retrieves all messages associated with a specific session from the WTS Chat API. It is useful for scenarios where you want to fetch conversation history or message logs within a particular chat session.

Typical use cases include:

  • Extracting all messages from a customer support chat session for analysis or record-keeping.
  • Monitoring ongoing conversations by fetching recent messages in real-time.
  • Integrating chat data into other systems such as CRMs or analytics platforms.

For example, you can use this node to pull all messages from a session identified by its Session ID, optionally filtering by creation or update timestamps, and control pagination to handle large volumes of messages efficiently.

Properties

Name Meaning
Session ID The identifier of the chat session whose messages you want to retrieve.
CreatedAt.After Filter to include only messages created after this date/time (format: YYYY-MM-DD hh:mm).
CreatedAt.Before Filter to include only messages created before this date/time (format: YYYY-MM-DD hh:mm).
UpdatedAt.After Filter to include only messages updated after this date/time (format: YYYY-MM-DD hh:mm).
UpdatedAt.Before Filter to include only messages updated before this date/time (format: YYYY-MM-DD hh:mm).
Auto Pagination Boolean flag to enable automatic pagination, fetching multiple pages of results automatically.
Max Pages When auto pagination is enabled, this limits the maximum number of pages to retrieve (1-100).
Page Number When auto pagination is disabled, specifies which page number of results to retrieve.
Page Size When auto pagination is disabled, specifies how many items per page to retrieve (1-100).
Order By Field name to sort the results by (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 typically contains details such as message content, sender information, timestamps, status, and any metadata associated with the message.

If the node supports binary data output (not explicitly shown here for this operation), it would represent files or media attached to messages. However, for "Get All Messages," the output is primarily structured JSON data representing message records.

Dependencies

  • Requires an active connection to the WTS Chat API via an API key credential configured in n8n.
  • The node depends on the WTS Chat service endpoints to fetch message data.
  • Proper permissions and valid session IDs are necessary to access message data.

Troubleshooting

  • SessionID is empty: If the Session ID property is not provided or empty, the node will throw an error indicating that the SessionID must be filled in. Ensure you provide a valid session identifier.
  • API errors: Network issues, invalid API keys, or permission problems may cause API request failures. Check your API credentials and network connectivity.
  • Pagination issues: If using auto pagination, setting an excessively high max pages value may lead to long execution times or rate limiting. Adjust accordingly.
  • Date format errors: Date/time filters must follow the specified format (YYYY-MM-DD hh:mm). Incorrect formats may cause filtering to fail or return no results.

Links and References

Discussion