WTS Chat icon

WTS Chat

Get data from Wts API

Overview

The "Send Message Template" operation in the Session resource allows sending a predefined message template to a specific session within the WTS Chat system. This is useful for automating responses or sending structured messages that follow a consistent format, such as notifications, confirmations, or promotional content.

Typical use cases include:

  • Sending templated messages to customers during support sessions.
  • Automating follow-up messages with dynamic parameters.
  • Including media files (images, documents) in template messages by attaching them via URL or file upload.

For example, a customer support bot can send a "Thank you for contacting us" template with the customer's name dynamically inserted, or send a product brochure as a file attachment within the template message.

Properties

Name Meaning
Session ID The unique identifier of the session where the template message will be sent.
Templates Name or ID Select a message template from a list associated with the session, or specify a template ID using an expression.
Params A collection of key-value pairs representing parameters to replace placeholders in the selected template. Each parameter has:
- Name or ID: The parameter's name or ID.
- Value: The value to set for that parameter.
Url (Optional) URL of a file to attach to the template message if the template supports a file type.
Field File (Optional) The name of the input field containing a base64-encoded file to attach to the template message if the template supports a file type. Use dot notation for nested fields.

Output

The node outputs JSON data representing the response from the WTS Chat API after sending the template message. This typically includes details about the sent message, such as message ID, status, timestamps, and any metadata returned by the API.

If a file is attached, the node handles uploading the file first and then sends the template message referencing the uploaded file by its ID.

No binary output is produced by this operation.

Dependencies

  • Requires an active connection to the WTS Chat API with a valid API key credential configured in n8n.
  • The node depends on the WTS Chat service endpoints for retrieving templates associated with a session and sending template messages.
  • If sending files, the node uploads files to the WTS Chat service before sending the message.

Troubleshooting

  • Session ID is empty: The operation requires a valid session ID. Ensure the "Session ID" property is filled.
  • Choose a valid template: The template must be selected from the available options or specified correctly by ID. An invalid or missing template will cause an error.
  • File not found in input: When attaching a file from input, ensure the specified input field exists and contains binary data.
  • No data in input: If a file attachment is expected but no input data is provided, the node will throw an error.
  • API errors: Errors from the WTS Chat API are wrapped and thrown as node errors. Check the error message for details, such as authentication issues or invalid parameters.

Links and References

Discussion