WTS Chat icon

WTS Chat

Get data from Wts API

Overview

This node integrates with the WTS Chat API to send text messages to contacts via various messaging channels. It allows sending plain text messages directly to a specified contact number, optionally using a chatbot, department, or user context. The node supports synchronous message sending and session management options such as hiding the session or forcing session start.

Typical use cases include:

  • Automating customer support replies by sending text messages to customers.
  • Sending notifications or alerts to specific phone numbers.
  • Integrating chatbots that respond automatically after sending a message.
  • Managing message sessions with options to hide or force start sessions.

Example: Sending a promotional text message to a customer's phone number through a selected channel and optionally enabling a chatbot for follow-up interaction.

Properties

Name Meaning
Text The text content of the message to send.
Chatbot Name or ID Select or specify the chatbot to associate with the message. Optionally enables chatbot interaction upon receiving a response.
Department Name or ID Select or specify the department context under which the message is sent.
User Name or ID Select or specify a user within the chosen department to send the message as.
From Name or ID Select or specify the channel (e.g., WhatsApp, Instagram) from which the message will be sent.
To The recipient's phone number or username to which the message will be sent.
Send Synchronous Message Boolean flag indicating whether the message should be sent synchronously (wait for confirmation before proceeding).
Enable Bot Boolean flag to activate the chatbot automatically when a response is received from the contact.
Hidden Session Boolean flag to mark the session as hidden, possibly affecting visibility in the system.
Force Start Session Boolean flag to force the creation of a new session if one does not already exist for this conversation.

Output

The node outputs JSON data representing the result of the send text message operation. This typically includes details about the sent message such as message ID, status, timestamps, and any metadata returned by the WTS Chat API.

If the message is sent successfully, the output JSON contains the message object returned by the API.

No binary data output is produced by this operation.

Dependencies

  • Requires an API key credential for authenticating with the WTS Chat API.
  • The node uses the base URL https://api.wts.chat for API requests.
  • Proper configuration of channels, departments, users, and chatbots in the WTS system is necessary for correct operation.
  • The node depends on helper methods to load options dynamically for bots, departments, users, and channels.

Troubleshooting

  • Error: "Choose channel"
    Occurs if the "From" channel is not selected or set to undefined. Ensure you select a valid channel before executing.

  • Error: "Set an Instagram number or username for sending"
    Happens if the "To" field is empty. Provide a valid recipient number or username.

  • Error: "Write a text to send"
    Triggered when the text message content is empty or only whitespace. Enter a non-empty message.

  • API errors wrapped as NodeApiError
    These indicate issues returned from the WTS Chat API, such as invalid parameters, authentication failures, or server errors. Check the error message for details and verify credentials and input parameters.

  • Rate limiting or timeout issues
    If sending many messages in a loop, the node waits 3 seconds between executions to avoid hitting rate limits. Adjust your workflow accordingly.

Links and References


This summary covers the "Send Text To Contact" operation of the "Message" resource based on static analysis of the provided source code and property definitions.

Discussion