Actions4
Overview
This node integrates with the Chatforma API to perform various actions related to bots, forms, user lists, dialogs, and messages. It supports retrieving data (e.g., fetching bots, forms, users), sending messages or dispatches to users or segments, and managing user membership in lists by adding or deleting users.
Common scenarios include:
- Fetching bot configurations or user dialogs for analysis or automation.
- Sending targeted messages to individual users, dialog participants, or user segments.
- Managing user subscriptions in segmented lists for marketing or communication purposes.
Practical examples:
- Automatically send a welcome message to a new user added to a bot's segment.
- Retrieve all dialogs of a bot to analyze user interactions.
- Add or remove users from specific lists to control message targeting.
Properties
| Name | Meaning |
|---|---|
| Действие (action) | The action to perform: Получить (get), Отправить (send), Добавить (add), Удалить (delete) |
| Объект (object) | 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 ID (BotUserId) used when adding or deleting a user from a list |
| Операция (operation) | When action is "send", specifies the type of sending operation: Текстовая рассылка списку (segment_dispatch), Текстовая рассылка пользователю (dispatch), Сообщение в диалог пользователю (message_to_dialog), Сообщение пользователю (message) |
| Бот Id (bot_id) | Bot ID used when sending messages or dispatches |
| Бот 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 списка (list_id) | List ID used when sending segment dispatch |
| ID пользователя (user_id) | User ID (BotUserId) used when sending dispatches or messages |
| Текст сообщения (content) | Text content of the message to send (used in send operations except "message") |
| ID сообщения (message_id) | Message ID used when sending a specific message |
Output
The node outputs the JSON response returned by the Chatforma API for the requested action. This typically includes data such as lists of bots, forms, users, dialogs, messages, or confirmation of sent messages and user list modifications.
If the API returns binary data (not evident in this code), it would be included accordingly, but this node primarily handles JSON responses.
Dependencies
- Requires an API key credential for authenticating requests to the Chatforma API.
- Uses the Axios HTTP client library to make REST API calls.
- The node expects the Chatforma API base URL
https://api.pro.chatforma.com/public/v1/.
Troubleshooting
No credentials got returned!
This error occurs if the required API key credential is not configured or accessible. Ensure that the API key credential is properly set up in n8n.API request failures (network errors, 4xx or 5xx responses)
Verify that the API key is valid and has sufficient permissions. Check network connectivity and that the specified bot IDs, user IDs, list IDs, and message IDs exist and are correct.Incorrect or missing parameters
Some actions require specific parameters (e.g., bot ID, user ID). Missing or invalid parameters will cause API errors. Double-check input values.Unsupported combinations of action/object/operation
The node restricts certain properties based on selected actions and operations. Make sure to select compatible options.
Links and References
- Chatforma API Documentation (assumed base URL; consult official docs for details)
- Axios HTTP Client
- n8n Documentation - Creating Nodes
