answerCallbackQuery
Answer a callback query triggered by an inline keyboard button click. This method must be called after receiving a callback_query to send an acknowledgment, even if no notification needs to be shown to the user.
Request
POST /:token/answercallbackquery
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| callback_query_id | String | Yes | Unique identifier for the callback query |
| text | String | No | Notification text to display to the user, 0-200 characters |
| show_alert | Boolean | No | Whether to show the notification as an alert dialog. Defaults to false, which displays a floating toast at the top |
| url | String | No | URL to be opened by the user's client |
| cache_time | Integer | No | Cache time for the callback query result in seconds, defaults to 0 |
Response
Returns Boolean true on success.
json
{
"ok": true,
"result": true
}Error Codes
| Code | Description |
|---|---|
| 400 | Bad request parameters, e.g. invalid callback_query_id |
| 401 | Invalid or expired token |
| 403 | Not authorized to answer this callback query |
| 500 | Internal server error |
