WTS Chat icon

WTS Chat

Get data from Wts API

Overview

The node integrates with the WTS Chat API to send files as messages to contacts via various communication channels. Specifically, the "Send File To Contact" 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 customers or contacts through chat platforms.

Practical examples include:

  • Sending product brochures or manuals automatically after a customer inquiry.
  • Delivering invoices or receipts as PDF files via chat.
  • Sharing images or videos for marketing campaigns or support purposes.

Properties

Name Meaning
Chatbot Name or ID Select or specify the chatbot to associate with the message (optional).
Department Name or ID Select or specify the department responsible for sending the message (optional).
User Name or ID Select or specify the user within the chosen department who sends the message (optional; depends on Department selection).
From Name or ID The channel (e.g., WhatsApp, Instagram) from which the message will be sent. Must be selected.
To The recipient's phone number or username to whom the file will be sent.
Url URL of the file to send. If provided, the file will be sent from this URL instead of uploading a file.
Input Field File Name The name of the input field containing the base64-encoded file data to upload and send. 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 upon receiving a response from the contact (optional).
Hidden Session Whether the session should be hidden (optional).
Force Start Session Whether to force start a new session when sending the message (optional).

Output

The node outputs JSON data representing the response from the WTS Chat API after attempting to send the file message. The structure typically includes details about the sent message such as message ID, status, timestamps, and any metadata returned by the API.

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

No binary output is produced by this node; all outputs are JSON objects describing the message send result.

Dependencies

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

Troubleshooting

  • Missing Required Fields: Errors occur if mandatory fields like "From" (channel), "To" (recipient), and either "Url" or "Input Field File Name" are not provided. Ensure these are filled.
  • File Not Found in Input: If specifying a file input field but no binary data exists under that name, the node throws an error. Verify the binary property name matches exactly and that the previous node provides the file.
  • Invalid Channel or Recipient: Selecting an undefined channel or leaving the recipient empty causes errors. Confirm valid selections.
  • API Authentication Failures: Ensure the API key credential is valid and has permissions to send messages and upload files.
  • Synchronous Sending Issues: When enabling synchronous sending, network delays or API timeouts may cause longer execution times or failures.
  • Bot Activation: Enabling the bot requires proper chatbot setup; otherwise, responses might not trigger as expected.

Links and References


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

Discussion