Actions32
- Bot Actions
- Callback Actions
- Chat Actions
- File Actions
- Message Actions
- Payment Actions
- Sticker Actions
Overview
The node provides functionality to interact with the Bale Messenger API, specifically focusing here on the Callback resource with the Answer Query operation. This operation allows the user to send an answer to a callback query that was sent from an inline keyboard in a chat. It is useful for bots that use inline keyboards and need to respond to user interactions promptly, such as confirming button presses or providing feedback without sending a new message.
Typical scenarios include:
- A bot presenting inline buttons to users and needing to acknowledge their selection.
- Sending notifications or alerts in response to user actions on inline keyboards.
- Providing URLs or messages as responses to callback queries.
Example: When a user clicks a button on an inline keyboard, the bot can answer the callback query to show a notification or alert, or open a URL in the user's client.
Properties
| Name | Meaning |
|---|---|
| Query ID | Unique identifier for the callback query to be answered (required). |
| Reply Keyboard | Adds a custom reply keyboard with rows of buttons. Each button sends its text as a message when pressed. |
| Reply Keyboard Remove | Options to remove the custom keyboard, including whether to remove it and if removal is selective. |
| Additional Fields | Optional parameters including: |
| - Cache Time: Maximum seconds the result may be cached client-side. | |
| - Show Alert: Whether to show an alert instead of a notification at the top of the chat screen. | |
| - Text: Text of the notification shown to the user (0-200 characters). | |
| - URL: URL to be opened by the user's client. |
Output
The output JSON contains a single field:
successful: A boolean indicating whether the callback query was answered successfully.
If an error occurs, the output includes:
successful: falseerrorMessage: The error message string.errorDetails: Additional error data if available.
No binary data is output by this operation.
Dependencies
- Requires an active Bale Messenger API token credential configured in n8n.
- Uses the Bale Messenger API endpoint
https://tapi.bale.ai/bot. - Relies on the
axioslibrary for HTTP requests. - No additional environment variables are required beyond the API token.
Troubleshooting
- Invalid Query ID: If the provided Query ID is incorrect or expired, the API call will fail. Ensure the Query ID matches the callback query received.
- API Authentication Errors: If the API token is invalid or missing, authentication errors will occur. Verify the API credentials are correctly set up.
- Network Issues: Failures to reach the Bale Messenger API endpoint will cause errors. Check network connectivity.
- Error Messages: The node logs detailed error information. Common errors include "Failed to answer callback query" with details from the API response. Use these logs to diagnose issues.
- JSON Parsing Errors: For related operations like answering inline queries, invalid JSON in parameters will throw errors. Ensure JSON strings are well-formed.
Links and References
- Bale Messenger Bot API Documentation (official API docs)
- n8n Documentation (for general node usage and credential setup)