Actions4
Overview
This node integrates with the Chatforma API to manage and interact with chatbots, user lists, dialogs, and messages. It supports actions such as retrieving data (bots, forms, lists, users, dialogs, dialog messages), sending text messages to users or segments, and managing user membership in lists by adding or deleting users.
Common scenarios where this node is useful include:
- Automating chatbot message dispatches to specific user segments or individual users.
- Fetching chatbot-related data for analytics or further processing.
- Managing user subscriptions to different chatbot segments or lists.
- Sending targeted notifications or updates via chatbots.
Practical examples:
- Send a promotional message to all users in a selected segment.
- Retrieve all active bots to display or process their information.
- Add a new user to a marketing list segment.
- Delete a user from a notification list.
- Send a message directly into a user's dialog.
Properties
| Name | Meaning |
|---|---|
| Действие | Action to perform: Получить (get), Отправить (send), Добавить (add), Удалить (delete) |
| Объект | Object to retrieve when action is "Получить": Боты (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) | Operation to perform when action is "Отправить" (send): Текстовая рассылка списку (segment_dispatch), Текстовая рассылка пользователю (dispatch), Сообщение в диалог пользователю (message_to_dialog), Сообщение пользователю (message) |
| Бот Id (bot_id) | Bot ID used for sending messages |
| Бот ID (get_bot_id) | Bot ID used when retrieving forms, lists, dialogs, dialog messages, or users |
| ID пользователя (get_user_id) | User ID used when retrieving dialog messages |
| Список пользователей (list_id) | User list ID used when sending segment dispatch messages |
| ID пользователя (user_id) | BotUserId of the user when sending direct messages or dialog messages |
| Текст сообщения (content) | Text content of the message to send |
| ID сообщения (message_id) | Message ID used when sending a specific message to a user |
Output
The node outputs the JSON response returned by the Chatforma API for the requested action. The structure depends on the API endpoint called:
- 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 objects related to message dispatch.
- For "add" and "delete" actions, it returns the result of the user addition or removal operation.
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.
- The node expects network access to
https://api.pro.chatforma.com.
Troubleshooting
- Missing credentials error: If no API key credential is provided, the node throws an error "No credentials got returned!". Ensure that valid API authentication is 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 rate limits or connectivity issues: Network problems or API limits can cause request failures. Check network connectivity and API usage quotas.
- Unexpected API responses: If the API changes or returns unexpected data, the node output may not match expectations. Review API documentation and update node configuration accordingly.
Links and References
- Chatforma API Documentation (assumed URL based on API base)
- Axios HTTP Client
- n8n Documentation on Creating Custom Nodes
