WTS Chat icon

WTS Chat

Get data from Wts API

Overview

The "Send File In Session" operation of the WTS Chat node allows users to send a file message within an existing chat session by specifying the session ID. The file can be sent either by providing a URL or by uploading a binary file from the input data. This operation supports synchronous sending, meaning it can wait for confirmation that the message was sent before continuing.

This node is useful in scenarios where you want to automate sending files (images, documents, etc.) directly into a chat session, such as customer support conversations or automated messaging workflows. For example, a support bot could send a PDF manual or an image screenshot to a user during a live chat session.

Properties

Name Meaning
Session ID The unique identifier of the chat session where the file will be sent.
Url A URL pointing to the file to send. If provided, the file will be sent via this URL.
Input Field File Name The name of the input field containing the binary file data (base64 encoded) to send.
Send Synchronous Message Boolean flag indicating whether the message should be sent synchronously (wait for confirmation).

Output

The output of this operation is a JSON object representing the response from the API after sending the file message in the session. It typically contains details about the sent message, such as message ID, status, timestamps, and any metadata returned by the service.

If a binary file is sent, the node uploads the file first and then sends the message referencing the uploaded file's ID. The binary data itself is not passed forward but used internally for upload.

Dependencies

  • Requires an active API key credential for authenticating with the WTS Chat API.
  • The node depends on the WTS Chat API endpoints for file upload and message sending.
  • Input binary data must be correctly provided in the workflow for file uploads.
  • Proper configuration of session IDs and channel information is necessary.

Troubleshooting

  • Session ID empty: The node throws an error if the Session ID is missing or empty. Ensure the session ID parameter is filled.
  • File or URL missing: At least one of the file input or URL must be provided. If both are missing, an error is thrown.
  • No binary data in input: When sending a file from input, the node expects binary data under the specified input field name. Errors occur if the binary data is missing or incorrectly named.
  • Invalid file name: The input field name must match exactly the binary property name in the input data; otherwise, the node cannot find the file.
  • API errors: Any issues with authentication, invalid session, or network problems will result in API errors wrapped and reported by the node.

To resolve these:

  • Double-check all required parameters.
  • Verify the input binary data exists and matches the specified field name.
  • Confirm the API key is valid and has permissions.
  • Check network connectivity and API endpoint availability.

Links and References


This summary focuses specifically on the "Send File In Session" operation of the "Session" resource based on the provided source code and properties.

Discussion