Actions4
Overview
This node integrates with the Chatforma API to manage and interact with chatbots, forms, user lists, dialogs, and messages. It supports four main actions: retrieving data (get
), sending messages or dispatches (send
), adding users to lists (add
), and deleting users from lists (delete
).
Common use cases include:
- Fetching information about bots, forms, user lists, dialogs, or dialog messages.
- Sending messages directly to users, dialogs, or user segments.
- Managing user membership in specific bot segments (lists).
Practical examples:
- Automatically retrieve all active bots to monitor their status.
- Send a broadcast message to a selected user segment.
- Add a new user to a marketing list segment.
- Delete a user from a notification list.
Properties
Name | Meaning |
---|---|
Действие (action) | The action to perform. Options: Получить (get), Отправить (send), Добавить (add), Удалить (delete). |
Объект (object) | When action is "get", specifies what to retrieve. Options: Боты (bots), Формы (forms), Списки (lists), Пользователи (users), Диалоги (dialogs), Сообщения диалогов (dialogs_messages). |
Бот Id (list_bot_id) | Bot ID used when adding or deleting a user from a list. Required for add/delete actions. |
ID списка (list_list_id) | List (segment) ID used when adding or deleting a user. Required for add/delete actions. |
ID пользователя (list_user_id) | User's BotUserId used when adding or deleting a user from a list. Required for add/delete actions. |
Операция (operation) | When action is "send", specifies the type of send operation. Options: Текстовая рассылка списку (segment_dispatch), Текстовая рассылка пользователю (dispatch), Сообщение в диалог пользователю (message_to_dialog), Сообщение пользователю (message). |
Бот Id (bot_id) | Bot ID used for sending messages or dispatches. Required for send actions. |
Бот ID (get_bot_id) | Bot ID used when getting forms, lists, dialogs, dialog messages, or users. Required for get action except bots. |
ID пользователя (get_user_id) | User ID used when getting dialog messages. Required for get action on dialogs_messages. |
Список пользователей (list_id) | List (segment) ID used when sending segment dispatch messages. Required for segment_dispatch operation. |
ID пользователя (user_id) | User's BotUserId used when sending messages or dispatches. Required for send actions except add/delete. |
Текст сообщения (content) | Text content of the message to send. Required for send operations except "message". |
ID сообщения (message_id) | Message ID used when sending a specific message to a user. Required for "message" operation. |
Output
The node outputs JSON data returned by the Chatforma API corresponding to the requested action and object/operation. The structure varies depending on the 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 responses from the API about message dispatch. - For
add
anddelete
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.
- The node expects network access to
https://api.pro.chatforma.com
.
Troubleshooting
- Missing Credentials: If no API credentials are provided, the node throws an error "No credentials got returned!". Ensure that a valid API key credential is configured.
- Invalid IDs: Providing incorrect or missing Bot IDs, User IDs, List IDs, or Message IDs will likely cause API errors. Double-check these values before running.
- API Errors: The node does not explicitly handle HTTP errors; if the API returns an error, it will propagate. Check the API response for details.
- Incorrect Action/Operation Combinations: Selecting unsupported combinations of action and object or operation may lead to unexpected behavior or errors.
- Network Issues: Ensure the n8n instance has internet access and can reach the Chatforma API endpoint.
Links and References
- Chatforma API Documentation (assumed URL based on API base)
- Axios HTTP Client
- n8n Documentation on Creating Custom Nodes