Bot API · Bot token
answerCallbackQuery
Answer an inline-button press
Answers an inline-keyboard button press. The answer is delivered to the tapping user's app over realtime: a toast notification, or a modal alert when show_alert is true. Re-answering the same query replaces the previous answer.
Request
curl https://api.sprintelex.com/answerCallbackQuery \
-H "Authorization: Bearer <bot-token>" \
-H "Content-Type: application/json" \
-d '{"callback_query_id":"<callback_query_id>"}'Parameters
| Name | Type | Required | Rules |
|---|---|---|---|
| callback_query_id | string (UUID) | Yes | the query id from the callback_query update, must belong to this bot+env |
| text | string | No (default '') | at most 200 characters; empty text shows nothing |
| show_alert | boolean | No (default false) | true = modal alert, false = toast |
Response
{ ok: true, result: true }Rate limit: none in code
Errors
| Status | Error | When |
|---|---|---|
| 400 | callback_query_id is required | missing callback_query_id |
| 400 | text must be at most 200 characters | text too long |
| 400 | callback query not found or expired | no query with that id for this bot+env |
| 500 | could not answer callback query | DB upsert failed |