WTS Chat icon

WTS Chat

Get data from Wts API

Overview

The node integrates with the WTS Chat API to send files as messages within chat conversations. Specifically, the "Send File" operation under the "Message" resource allows users to send a file either by uploading it directly or by providing a URL to the file. This is useful in scenarios where automated workflows need to share documents, images, or other media files with contacts via supported messaging channels.

Practical examples include:

  • Sending invoices or receipts automatically to customers after a purchase.
  • Sharing product images or brochures in customer support chats.
  • Delivering reports or logs to team members through chat channels.

Properties

Name Meaning
Bots Name or ID Select a bot from the list or specify its ID to associate the message with a particular chatbot (optional).
Departments Name or ID Choose a department from the list or specify its ID to route the message through a specific department (optional).
User Name or ID Select a user within the chosen department to send the message on behalf of that user (optional; updates dynamically based on selected department).
From Name or ID Select the channel (e.g., Instagram, WhatsApp) from which the message will be sent. This is required.
To The recipient's phone number or username to whom the file message will be sent. Required field.
Url URL of the file to send. If provided, the file will be sent by referencing this URL instead of uploading a file.
Field File The name of the input field containing the base64-encoded file data to upload and send. Use 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 Boolean flag to activate the chatbot upon receiving a response from the contact after sending the file.
Hidden Session Boolean flag to mark the session as hidden when sending the message.
Force Start Session Boolean flag to force the start of a new session if none exists when sending the message.

Output

The output JSON contains the response from the WTS Chat API after attempting to send the file message. It typically includes details such as message ID, status, timestamps, and metadata about the sent file message.

If a file was uploaded from binary data, the node first uploads the file to the service and then sends the message referencing the uploaded file ID.

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

Dependencies

  • Requires an active connection to the WTS Chat API using an API key credential.
  • The node depends on the WTS Chat API endpoints for file upload and message sending.
  • Input binary data must be provided correctly if sending a file from workflow input.
  • Proper configuration of channels, bots, departments, and users in the WTS system is necessary for successful message delivery.

Troubleshooting

  • Missing required fields: Errors occur if mandatory fields like "From" (channel), "To" (recipient), or file information are missing. Ensure these are filled.
  • File not found in input: If specifying a file field but no binary data is present under that field, an error is thrown. Verify the input data contains the expected binary property.
  • Invalid channel or bot selection: Selecting "Undefined" or not choosing a valid channel/bot causes errors. Always select valid options.
  • API errors: Network issues or invalid API keys will cause request failures. Check credentials and network connectivity.
  • Empty file URL and file field: At least one of URL or file upload must be provided; otherwise, the node throws an error.
  • Synchronous message sending: If enabled, the node waits for confirmation; if the API is slow or unresponsive, this may delay execution.

Links and References

Discussion