Actions38
- Chatbot Actions
- Contact Actions
- Message Actions
- Panel Actions
- Sequence Actions
- Session Actions
Overview
The "Get All Sessions" operation of the Session resource in this node retrieves a list of chat sessions from the WTS Chat API. It allows filtering sessions by various criteria such as tags, user, department, contact, channels, status, and date ranges related to activity, creation, update, and session end times. The operation supports pagination and sorting options, enabling users to fetch sessions efficiently according to their needs.
This node is beneficial for scenarios where you want to analyze or process multiple chat sessions, monitor ongoing conversations, or generate reports based on session metadata. For example, a customer support team could use it to retrieve all active sessions assigned to a particular department or user, filter sessions by specific tags, or get sessions that ended within a certain timeframe.
Properties
| Name | Meaning |
|---|---|
| Tag Names or IDs | Filter sessions by one or more tag names or IDs. You can select from a list or specify IDs using expressions. |
| User Name or ID | Filter sessions by a specific user name or ID. Choose from a list or specify an ID using expressions. |
| Departments Name or ID | Filter sessions by a specific department name or ID. Choose from a list or specify an ID using expressions. |
| Contact ID | Filter sessions by a specific contact ID. Enter the contact ID as a string. |
| Channel Names or IDs | Filter sessions by one or more channel names or IDs. Choose from a list or specify IDs using expressions. |
| ActiveAt.After | Filter sessions with an active time after the specified date/time (format: YYYY-MM-DD hh:mm). |
| ActiveAt.Before | Filter sessions with an active time before the specified date/time (format: YYYY-MM-DD hh:mm). |
| EndAt.After | Filter sessions with an end time after the specified date/time (format: YYYY-MM-DD hh:mm). |
| EndAt.Before | Filter sessions with an end time before the specified date/time (format: YYYY-MM-DD hh:mm). |
| LastInteractionAt.After | Filter sessions with last interaction time after the specified date/time (format: YYYY-MM-DD hh:mm). |
| LastInteractionAt.Before | Filter sessions with last interaction time before the specified date/time (format: YYYY-MM-DD hh:mm). |
| Status Session | Filter sessions by one or more statuses. Options include: Completed, Hidden, In Progress, Pending, Started. |
| Include Details | Specify which additional details to include in the response. Options include AgentDetails, ChannelDetails, ChannelTypeDetails, ClassificationDetails, ContactDetails, DepartmentsDetails, Undefined. |
| CreatedAt.After | Filter sessions created after the specified date/time (format: YYYY-MM-DD hh:mm). |
| CreatedAt.Before | Filter sessions created before the specified date/time (format: YYYY-MM-DD hh:mm). |
| UpdatedAt.After | Filter sessions updated after the specified date/time (format: YYYY-MM-DD hh:mm). |
| UpdatedAt.Before | Filter sessions updated before the specified date/time (format: YYYY-MM-DD hh:mm). |
| Auto Pagination | Enable automatic pagination to fetch multiple pages of results automatically. |
| Max Pages | When auto pagination is enabled, set the maximum number of pages to retrieve (1-100). |
| Page Number | When auto pagination is disabled, specify the page number to retrieve. |
| Page Size | When auto pagination is disabled, specify the number of items per page (1-100). |
| Order By | Field name to sort the results by. |
| Order Direction | Direction of sorting: Ascending or Descending. |
Output
The output is an array of JSON objects representing the retrieved sessions. Each object contains session data as returned by the WTS Chat API, including fields such as session identifiers, status, timestamps, associated tags, users, departments, contacts, channels, and optionally detailed nested information depending on the "Include Details" property.
If binary data were involved, it would be summarized here; however, this operation deals only with JSON session data.
Dependencies
- Requires an API key credential for authenticating with the WTS Chat API.
- The node uses the base URL
https://api.wts.chatfor API requests. - No other external dependencies are required.
- Proper configuration of the API key credential in n8n is necessary.
Troubleshooting
- Empty or missing SessionID: Some operations require a valid session ID. Ensure the "SessionID" field is filled when needed.
- Invalid filter values: Using invalid or unsupported filter values (e.g., incorrect date formats) may cause errors. Use the specified date format
YYYY-MM-DD hh:mm. - API authentication errors: If the API key is missing or invalid, the node will throw authentication errors. Verify the API key credential setup.
- Pagination issues: When auto pagination is enabled, setting an excessively high max pages value may lead to long execution times or rate limiting.
- No sessions found: If filters are too restrictive, the result may be empty. Try broadening filter criteria.
- Network or API errors: General network issues or API downtime will cause errors. Check connectivity and API status.
Common error messages:
"SessionID is empty!": Fill in the SessionID parameter."Choose user"or"UserID is empty!": Select or provide a valid user ID."Fill in the field session": Provide a session ID for operations requiring it.
Links and References
- WTS Chat API Documentation (general reference for API endpoints and parameters)
- n8n Expressions Documentation (for using expressions in property fields)