Actions4
Overview
This node integrates with the Chatforma API to perform various actions related to bots, users, dialogs, messages, forms, and lists within the Chatforma platform. It supports retrieving data (e.g., lists of bots, forms, users), sending messages or dispatches to users or segments, and managing user membership in lists (adding or deleting users).
Common scenarios where this node is useful include:
- Automating communication by sending messages or broadcasts to specific users or user segments.
- Fetching information about bots, dialogs, or users for reporting or further processing.
- Managing user subscriptions to different segments or lists dynamically.
- Integrating Chatforma chatbot interactions into broader workflows.
Practical examples:
- Sending a targeted message to a user dialog when a certain event occurs.
- Retrieving all active bots to display or process their data.
- Adding a user to a marketing segment list after they complete a form.
- Deleting a user from a segment list upon unsubscription.
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 a user from a list |
| ID списка (list_list_id) | List ID used when adding or deleting a user from a list |
| ID пользователя (list_user_id) | User BotUserId used when adding or deleting a user from a list |
| Объект (operation) | When action is "send", specifies the type of message operation: |
| - Текстовая рассылка списку (segment_dispatch): send message to a selected user segment | |
| - Текстовая рассылка пользователю (dispatch): send message to a selected user | |
| - Сообщение в диалог пользователю (message_to_dialog): send message to a user's dialog | |
| - Сообщение пользователю (message): approve a message in bot for a user | |
| Бот 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 |
| ID пользователя (user_id) | User BotUserId used when sending messages or dispatching |
| Текст сообщения (content) | Text content of the message to be sent |
| ID сообщения (message_id) | Message ID used when approving a message for a user |
| ID списка (list_id) | List ID used when sending a segment dispatch |
Output
The node outputs a JSON array containing the response data returned by the Chatforma API for the performed action. The structure of the output depends on the action and parameters:
- For "get" actions, it returns lists of bots, forms, users, dialogs, or messages as provided by the API.
- 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 list.
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 error: If no API key credential is provided, the node will throw an error. Ensure that valid API authentication credentials are configured.
- Invalid IDs or parameters: Providing incorrect bot IDs, user IDs, list IDs, or message IDs may cause API errors. Verify these values before running the node.
- API request failures: Network issues or invalid API keys can cause request failures. Check connectivity and credential validity.
- Unsupported parameter combinations: Some properties only apply to specific actions or operations; ensure correct combinations are selected to avoid unexpected errors.
Links and References
- Chatforma API Documentation (assumed URL based on API base)
- Axios HTTP Client
- n8n documentation on Creating Custom Nodes
