WTS Chat icon

WTS Chat

Get data from Wts API

Overview

The node "WTS Chat" integrates with the Helena API to manage chat-related resources such as contacts, messages, sessions, and panels. Specifically for the Message resource and the Send Message File operation, this node sends a file message to a specified recipient via a selected communication channel.

This operation is useful in scenarios where you want to automate sending files (e.g., images, documents, PDFs) through chat channels supported by Helena's platform. For example, a customer support workflow could automatically send product manuals or invoices as file attachments to customers during a conversation.

Properties

Name Meaning
Session ID The identifier of the chat session to which the message belongs (optional).
From Name or ID The channel from which the message will be sent. You can select from a list of available channels or specify an ID via expression.
To The phone number or recipient identifier to whom the file message will be sent.
Url The URL of the file to be sent. Must be a valid HTTP/HTTPS URL.
Bots Name or ID Optionally specify a bot to be used when sending the message. Can be chosen from a list or specified by ID via expression.
Departments Name or ID Optionally specify the department associated with the message. Can be chosen from a list or specified by ID via expression.
User Name or ID Optionally specify a user within the department who is responsible for the message. This list updates based on the selected department.
Enable Bot Boolean flag indicating whether the chatbot should be activated upon receiving a response from the contact.
Hidden Session Boolean flag indicating whether the session should be hidden.
Force Start Session Boolean flag indicating whether to force start a new session if one does not exist.

Output

The output of the node is a JSON object representing the response from the Helena API after sending the file message. This typically includes details about the sent message such as message ID, status, timestamps, and metadata related to the message delivery.

The node does not output binary data; it only returns JSON-formatted information about the message sent.

Example output structure (simplified):

{
  "id": "message-id",
  "from": "channel-id",
  "to": "recipient-number",
  "body": {
    "fileUrl": "https://example.com/file.pdf"
  },
  "status": "sent",
  "timestamp": "2024-06-01T12:00:00Z",
  ...
}

Dependencies

  • Requires an API key credential for authentication with the Helena API.
  • The base URL for API requests is https://api-test.helena.run.
  • Uses the Axios HTTP client internally to make REST API calls.
  • The node depends on dynamic loading of options for channels, bots, departments, and users via helper methods that query the Helena API.

Troubleshooting

  • Invalid URL error: The Url property must be a valid HTTP or HTTPS URL. If the URL is malformed, the request will fail. Ensure the URL matches the regex pattern for URLs.
  • Authentication errors: If the API key is missing or invalid, the node will fail to authenticate. Verify that the API key credential is correctly configured.
  • Missing required fields: The From Name or ID, To, and Url properties are essential. Omitting these may cause the API call to fail.
  • Session-related flags: Using Force Start Session or Hidden Session incorrectly might lead to unexpected session behavior. Use these flags according to your chat flow requirements.
  • API rate limits or network issues: As with any external API integration, transient network errors or rate limiting may cause failures. Implement retry logic or error handling in your workflow as needed.

Links and References


This summary focuses on the Message resource and the Send Message File operation as requested, extracting relevant input properties, output format, dependencies, and potential troubleshooting tips based on static analysis of the provided source code and property definitions.

Discussion