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

NameTypeRequiredRules
callback_query_idstring (UUID)Yesthe query id from the callback_query update, must belong to this bot+env
textstringNo (default '')at most 200 characters; empty text shows nothing
show_alertbooleanNo (default false)true = modal alert, false = toast

Response

{ ok: true, result: true }

Rate limit: none in code

Errors

StatusErrorWhen
400callback_query_id is requiredmissing callback_query_id
400text must be at most 200 characterstext too long
400callback query not found or expiredno query with that id for this bot+env
500could not answer callback queryDB upsert failed