WTS Chat icon

WTS Chat

Get data from Wts API

Overview

The Send Chatbot operation in the WTS Chat node allows sending a chatbot message through a specified channel to a target number, optionally within a session context. It supports controlling whether to start a new session forcibly, and conditions to skip sending if another bot is running or if a conversation is already in progress. Additionally, it enables attaching metadata to both the session and the contact involved.

This operation is useful for automating chatbot interactions in messaging platforms where sessions and channels are managed, such as customer support bots or marketing chatbots. For example, you can send a chatbot message to a user on WhatsApp or Instagram via a specific channel, while managing session states and enriching the interaction with metadata.

Properties

Name Meaning
Chatbot Name or ID Select the chatbot to send from a list or specify an ID via expression. "Undefined" means no chatbot will be sent.
From Name or ID The channel (e.g., WhatsApp, Instagram) from which the chatbot message will be sent. Choose from a list or specify an ID via expression.
To The recipient's phone number or identifier to which the chatbot message will be sent.
Session ID Optional session identifier to associate the chatbot message with an existing session.
Force Start Session Boolean flag to force starting a new session if one does not exist.
Skip If Bot In Execution Boolean flag indicating that if another chatbot is currently running, this chatbot message will not be sent.
Skip If In Progress Boolean flag indicating that if a conversation is ongoing, the chatbot message will not be sent.
Session Metadata Key-value pairs of metadata to attach to the session when sending the chatbot message. Multiple entries allowed.
Contacts Metadata Key-value pairs of metadata to attach to the contact when sending the chatbot message. Multiple entries allowed.

Output

The output is a JSON object representing the response from the chatbot message send API call. This typically includes details about the sent message, such as message ID, status, timestamps, and any relevant metadata returned by the service.

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 WTS Chat service endpoints to send chatbot messages.
  • Proper configuration of channels and chatbots in the WTS platform is necessary.
  • The node expects valid session IDs, channel IDs, and chatbot keys as input parameters.

Troubleshooting

  • Missing or invalid channel: If the "From" channel is not selected or set to "Undefined," the node throws an error asking to fill in the "From" field.
  • Missing recipient number: If the "To" number is empty, the node throws an error indicating the need to specify a number to send the message to.
  • API errors: Any issues from the WTS API (e.g., authentication failure, invalid parameters) will result in an error wrapped as a NodeApiError with the original message.
  • Metadata format: Ensure that session and contact metadata are provided as key-value pairs; incorrect formatting may cause unexpected behavior.
  • Skipping conditions: If "Skip If Bot In Execution" or "Skip If In Progress" flags are enabled, the chatbot message might not be sent if those conditions are met, which could lead to confusion if not expected.

Links and References

Discussion