WTS Chat icon

WTS Chat

Get data from Wts API

Overview

The "Get Session By ID" operation of the WTS Chat n8n node retrieves detailed information about a specific chat session from the WTS API, using its unique Session ID. This is useful for automating workflows that require fetching session details for reporting, auditing, customer support follow-ups, or integrating session data with other systems.

Practical scenarios:

  • Fetching session details to display in dashboards.
  • Retrieving session metadata for analytics or compliance.
  • Using session data as input for further automation steps (e.g., sending follow-up messages).

Properties

Display Name Type Description
Session ID String The unique identifier of the session you want to retrieve. Required.
Include Details Multi-Options Optional. Select which additional details to include in the response. Options are:
- AgentDetails
- ChannelDetails
- ChannelTypeDetails
- ClassificationDetails
- ContactDetails
- DepartmentsDetails
- Undefined

Output

  • The output is a single item with a json field containing the session details as returned by the WTS API.
  • The structure of the JSON depends on the session and the selected "Include Details" options, but typically includes:
    • Basic session information (ID, status, timestamps, etc.)
    • Optionally, nested objects/arrays for agent, channel, contact, department, and classification details if requested via "Include Details".

Example output structure:

{
  "id": "session_12345",
  "status": "active",
  "createdAt": "2024-06-01T12:00:00Z",
  "agent": { /* present if AgentDetails included */ },
  "channel": { /* present if ChannelDetails included */ },
  "contact": { /* present if ContactDetails included */ },
  // ...other fields depending on Include Details selection
}
  • No binary data is produced by this operation.

Dependencies

  • External Service: Requires access to the WTS API.
  • API Key: You must configure valid WTS API credentials (wtsApi) in n8n.
  • n8n Configuration: Ensure the node has access to the internet and the correct credentials are set up.

Troubleshooting

Common issues:

  • Missing or empty Session ID:
    • Error: "SessionID is empty!"
      Resolution: Make sure to provide a valid Session ID in the input.
  • Invalid API Key or missing credentials:
    • Error: Authentication errors from the WTS API.
      Resolution: Check your WTS API credentials in n8n.
  • Session not found:
    • Error message from the WTS API indicating the session does not exist.
      Resolution: Verify the Session ID is correct and exists in your WTS system.
  • Include Details option has no effect:
    • If the selected detail is not available for the session, the corresponding field may be missing in the output.

Links and References

Discussion