WTS Chat icon

WTS Chat

Get data from Wts API

Overview

The node implements integration with the WTS Chat API, focusing on chatbot messaging capabilities under the "Chatbot" resource and specifically the "Send Chatbot" operation. It allows sending chatbot messages to a specified recipient via a chosen bot and channel, optionally managing session behavior and metadata.

This node is beneficial in scenarios where automated chatbot interactions are needed within messaging platforms supported by WTS Chat. For example, it can be used to initiate or continue conversations with customers, send notifications, or trigger chatbot workflows based on external events.

Practical examples:

  • Sending a chatbot message to a customer’s Instagram number through a specific bot and channel.
  • Starting a new chatbot session forcibly or skipping sending if another bot is currently running or if a conversation is already in progress.
  • Attaching custom metadata to sessions or contacts for enhanced context during chatbot interactions.

Properties

Name Meaning
Session ID Identifier of the chat session to associate the message with (optional).
Bots Name or ID Select a bot from the list or specify its ID to send the chatbot message through.
From Name or ID Select the channel (e.g., Instagram account) from which the message will be sent.
To The recipient's phone number or username to whom the chatbot message will be sent.
Force Start Session Boolean flag to force starting a new session even if one exists.
Skip If Bot In Execution Boolean flag indicating that if another chatbot is currently running, this message should not be sent.
Skip If In Progress Boolean flag indicating that if a conversation is ongoing, the chatbot message should not be sent.
Session Metadata Key-value pairs to add custom metadata to the session associated with the chatbot message. Multiple entries allowed.
Contacts Metadata Key-value pairs to add custom metadata to the contact associated with the chatbot message. Multiple entries allowed.

Output

The node outputs an array containing a single item with a json field representing the response from the WTS Chat API after attempting to send the chatbot message. This JSON typically includes details about the sent message, status, and any relevant identifiers returned by the API.

If the operation fails, the node throws an error with descriptive messages.

No binary data output is produced by this operation.

Dependencies

  • Requires an API key credential for authenticating with the WTS Chat API.
  • The node depends on the WTS Chat service endpoints accessible at https://api.wts.chat.
  • Proper configuration of bots and channels in the WTS Chat platform is necessary.
  • The user must have valid bot IDs and channel IDs available, which can be loaded dynamically in the node UI.

Troubleshooting

  • Missing Bot or Channel: Errors occur if the bot or channel is not selected or set to "Undefined". Ensure these fields are properly filled.
  • Empty Recipient Number: The "To" field must be provided; otherwise, the node throws an error prompting to fill it.
  • Session ID Issues: If a session ID is required but missing, the node will throw an error.
  • Skipping Conditions: If skipIfBotInExecution or skipIfInProgress flags are set, the message may not be sent if conditions are met. Verify these flags according to your workflow needs.
  • API Errors: Any API-related errors are wrapped and thrown as node errors with messages from the WTS Chat API. Check API key validity and network connectivity.
  • Metadata Format: Metadata keys and values must be strings; invalid formats might cause unexpected behavior.

Links and References


This summary is based solely on static analysis of the provided source code and property definitions.

Discussion