WTS Chat icon

WTS Chat

Get data from Wts API

Overview

The node "WTS Chat" integrates with the WTS API to send templated messages to contacts via various messaging channels. Specifically, the Send Template To Contact operation allows users to send a predefined message template to a specified contact number. This is useful in scenarios where businesses want to automate sending consistent, branded messages such as notifications, alerts, or marketing content using templates approved on their messaging platform.

Practical examples include:

  • Sending appointment reminders using a template.
  • Delivering order status updates with dynamic parameters.
  • Broadcasting promotional offers with rich media attachments.

This operation supports adding parameters to customize the template dynamically and can optionally attach files either by URL or from binary input data.

Properties

Name Meaning
Chatbot Name or ID Select or specify the chatbot to use for sending the message.
Department Name or ID Select or specify the department associated with the message.
User Name or ID Select or specify the user within the chosen department who will be associated with the message.
From Name or ID The channel (e.g., phone number or messaging channel) from which the message is sent.
Templates Name or ID Choose the message template to send. Templates are loaded based on the selected channel.
Params Key-value pairs to fill in the template's dynamic parameters. Each parameter has a name (from the template's defined parameters) and a value to substitute.
To The recipient's phone number or identifier to which the message will be sent.
Url URL of a file to attach to the message template if the template supports file attachments.
Input Field File Name Name of the input field containing the base64 encoded file to attach. Supports dot notation for nested fields.
Send Synchronous Message Boolean flag indicating whether the message should be sent synchronously (wait for confirmation before proceeding).
Enable Bot Whether to activate the chatbot automatically upon receiving a response from the contact.
Hidden Session Whether the session should be hidden (not visible in the usual session list).
Force Start Session Whether to force the start of a new session when sending the message.

Output

The output JSON contains the response from the WTS API after sending the template message. It 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 includes the resulting file ID in the message body.

No binary data is output by this node; it only outputs JSON responses representing the result of the send operation.

Dependencies

  • Requires an API key credential for authenticating with the WTS API.
  • The node depends on the WTS API endpoints for sending messages, uploading files, and retrieving templates.
  • Proper configuration of channels, templates, and chatbots in the WTS platform is necessary.
  • If attaching files from input, the incoming data must contain valid binary data under the specified input field name.

Troubleshooting

  • Error: "Choose template"
    Occurs if no template is selected. Ensure you select a valid template before execution.

  • Error: "Fill in the From field"
    Happens if the sending channel is not specified. Select a valid channel.

  • Error: "Set an Instagram number or username for sending"
    The recipient number ("To") is missing. Provide a valid recipient identifier.

  • Error: "There is no data in the input" or "There is no file with that name that comes from input"
    When sending a file from binary input, ensure the input data contains the file under the specified field name.

  • Invalid API Key or Authentication Errors
    Verify that the API key credential is correctly configured and has sufficient permissions.

  • Parameter Mismatch
    If template parameters do not match those expected by the template, the message may fail. Double-check parameter names and values.

Links and References

  • n8n Expressions Documentation — For specifying dynamic expressions in properties.
  • WTS API Documentation (refer to your WTS platform docs) — For detailed API capabilities related to templates, messaging, and file uploads.

This summary covers the static analysis of the execute() method logic for the "Send Template To Contact" operation of the WTS Chat node.

Discussion