Skip to content

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

ParameterTypeRequiredDescription
callback_query_idStringYesUnique identifier for the callback query
textStringNoNotification text to display to the user, 0-200 characters
show_alertBooleanNoWhether to show the notification as an alert dialog. Defaults to false, which displays a floating toast at the top
urlStringNoURL to be opened by the user's client
cache_timeIntegerNoCache time for the callback query result in seconds, defaults to 0

Response

Returns Boolean true on success.

json
{
  "ok": true,
  "result": true
}

Error Codes

CodeDescription
400Bad request parameters, e.g. invalid callback_query_id
401Invalid or expired token
403Not authorized to answer this callback query
500Internal server error