Actions4
Overview
This node integrates with the Chatforma API to manage and interact with chatbot-related data and messaging. It supports actions such as retrieving information about bots, forms, lists, users, dialogs, and dialog messages; sending various types of messages through bots; and managing user membership in bot segments (lists).
Common scenarios where this node is useful include:
- Fetching bot configurations or user lists for analysis or automation.
- Sending targeted messages to users or user segments within a bot.
- Adding or removing users from specific bot segments to control message targeting.
- Retrieving dialog histories or messages for customer support or auditing.
Practical examples:
- Automatically send a welcome message to new users added to a bot segment.
- Retrieve all active bots and their associated forms to synchronize with another system.
- Dispatch a promotional message to a selected user segment.
- Fetch dialog messages for a particular user to analyze conversation history.
Properties
| Name | Meaning |
|---|---|
| Действие (action) | The action to perform: Получить (get), Отправить (send), Добавить (add), Удалить (delete) |
| Объект (params) | When action is "get", specifies what to retrieve: Боты (bots), Формы (forms), Списки (lists), Пользователи (users), Диалоги (dialogs), Сообщения диалогов (dialogs_messages) |
| Бот Id (list_bot_id) | Bot ID used when adding or deleting users from segments |
| ID списка (list_list_id) | Segment (list) ID used when adding or deleting users |
| ID пользователя (list_user_id) | User BotUserId used when adding or deleting users |
| Операция (operation) | When action is "send", specifies the type of message operation: Текстовая рассылка списку (segment_dispatch), Текстовая рассылка пользователю (dispatch), Сообщение в диалог пользователю (message_to_dialog), Сообщение пользователю (message) |
| Бот Id (bot_id) | Bot ID used for sending messages |
| Бот ID (get_bot_id) | Bot ID used when getting forms, lists, dialogs, dialog messages, or users |
| ID пользователя (get_user_id) | User ID used when getting dialog messages |
| Спиcок пользователей (list_id) | Segment (list) ID used when sending segment dispatch messages |
| ID пользователя (user_id) | BotUserId of the user when sending messages |
| Текст сообщения (content) | Text content of the message to send |
| ID сообщения (message_id) | Message ID used when sending a specific message |
Output
The node outputs JSON data corresponding to the response from the Chatforma API for the requested action. The structure varies depending on the action and parameters:
- For "get" actions, it returns arrays or objects representing bots, forms, lists, users, dialogs, or dialog messages.
- For "send" actions, it returns confirmation or status of the message dispatch.
- For "add" and "delete" actions, it returns the result of adding or removing a user from a segment.
No binary data output is produced by this node.
Dependencies
- Requires an API key credential for authenticating requests to the Chatforma API.
- Uses the Axios HTTP client library to make REST API calls.
- Needs network access to
https://api.pro.chatforma.com.
Troubleshooting
- Missing Credentials: If no API credentials are provided, the node throws an error indicating missing credentials. Ensure that a valid API key credential is configured.
- Invalid IDs: Providing incorrect bot IDs, user IDs, segment IDs, or message IDs may cause API errors or empty responses. Verify IDs before use.
- API Errors: Network issues or invalid API keys can cause request failures. Check API key validity and network connectivity.
- Parameter Mismatches: Selecting incompatible combinations of action, params, and operation properties may lead to unexpected behavior or errors. Follow the property display options carefully.
Links and References
- Chatforma API Documentation (assumed URL based on API base)
- Axios HTTP Client
- n8n Documentation on Creating Nodes
