← All posts
Guide

Telegram Inline Button Keeps Loading? Check answerCallbackQuery

If a Telegram inline callback button keeps loading, check whether your bot calls answerCallbackQuery for the received callback_query. Returning HTTP 200 from your webhook is not that call. Telegram says clients display a progress indicator until the query is answered, even when you do not need to show a notification. Answer the interaction promptly; track any slower business operation separately.

Key takeaways

  • A callback button produces a callback_query, not an ordinary text message for your message handler.
  • Pass the incoming query’s id as callback_query_id; do not substitute a message, chat, or update identifier.
  • An empty callback answer is useful: notification text is optional.
  • Removing the loading indicator does not prove that a payment, approval, or support action finished.

Why answerCallbackQuery matters for a loading button

The official Telegram Bot API reference distinguishes a callback button from a URL button. callback_data is sent to the bot in a callback query; a URL button opens its configured link. First confirm which button you actually created.

For a callback interaction, three outcomes must remain separate:

OutcomeWhat establishes itWhat it does not establish
Webhook delivery acknowledgedYour receiver’s successful HTTP responseThe callback was answered
Button interaction answeredanswerCallbackQuery for that queryYour business operation succeeded
Business operation completedYour application’s committed resultMerely receiving or answering a click is insufficient

Telegram documents that answerCallbackQuery can show a notification or an alert and returns True on success. The required parameter is callback_query_id; text is optional. A plain webhook acknowledgement cannot replace it.

If your confusion is about invoking Bot API methods inside the webhook response rather than making a separate request, see webhook response bodies vs separate API requests. That is a transport choice; this guide focuses on the missing button-interaction answer.

Find the broken boundary

No callback reaches the handler

Inspect the received update type instead of searching only message logs. Check whether your dispatcher handles callback_query and whether an explicit allowed_updates filter includes it. Telegram documents that omitting allowed_updates retains the previous setting, so leaving it out of a later configuration call is not a reset.

If the entire update is missing, use getWebhookInfo delivery diagnostics. A delivery problem and a handler that silently ignores callbacks require different fixes.

The callback arrives, but the button still loads

Check this field mapping against the actual update:

Incoming valueUse
callback_query.idSupply as callback_query_id to answerCallbackQuery
callback_query.dataInterpret as application input when present
callback_query.messageMessage context when present; do not require it for every callback
callback_query.inline_message_idContext for a message sent via inline mode when present

Telegram documents different message context for ordinary bot messages and inline-mode messages. A handler that always dereferences callback_query.message.chat can fail before it reaches the answer call.

Use a separate answerCallbackQuery request when you need to inspect the result. Record the real success or error without exposing the bot token. Do not wait for an AI response, CRM request, or other slow dependency before providing interaction feedback.

The indicator clears, but the action is wrong

Treat callback data as input, not permission. Telegram warns that the originating message may no longer contain a button with the received data. Recommended application checks include action allowlisting, user authorization, and current server-side object state.

For example, in a hypothetical approval workflow, answering the click should not mark an application approved. Validate the request, perform the state transition once, and display its actual result separately. Deduplicate repeated update deliveries, and use a business-level guard against repeated clicks; those are different duplication problems.

Test the interaction, not just the webhook

Before release, exercise these cases:

  • A valid callback receives an answer without notification text.
  • A slow business task does not hold the interaction answer behind it.
  • Missing message context does not crash the callback handler.
  • Unknown or stale callback data does not trigger an unauthorized action.
  • A repeated delivery or repeated click does not repeat an irreversible operation.

These are recommended acceptance tests, not claimed test results or a Telegram timing guarantee.

Where UnifyPort fits

Keep Telegram’s official Bot API for bot inline keyboards and callback answers. UnifyPort’s unofficial interface addresses connected messaging accounts with a different normalized event contract. Its public webhook event catalogue includes message.received, but does not document a callback_query event or an answerCallbackQuery operation. Do not rename a message event into a callback or assume a unified webhook answers the bot’s button.

If your application also needs account-level inbound intake, keep that receiver separate from the bot interaction handler. UnifyPort’s delivery reference specifies that response bodies are discarded; returning Bot API method JSON there does not execute a callback answer.

FAQ

Does HTTP 200 stop a Telegram button’s loading indicator?

Not by itself. The callback needs answerCallbackQuery; HTTP acknowledgement covers update delivery.

Must I send text with answerCallbackQuery?

No. Telegram documents text as optional. You can answer without displaying a notification.

Should I use the message ID as callback_query_id?

No. Use the id of the incoming CallbackQuery.

Can a unified message webhook replace this handler?

Not under UnifyPort’s documented contract. Keep callback handling in your official Telegram bot integration.

Next step and source

Trace one controlled button press from callback_query receipt to the actual answerCallbackQuery result. If you also need connected-account intake, review the standard webhook event contract before sharing application logic across the two receivers.

Official source checked on 2026-09-22: Telegram Bot API — CallbackQuery, answerCallbackQuery, InlineKeyboardButton, and allowed_updates.

UnifyPort API

Turn messaging integration into a stable product pipeline.

Start by sending through one API, then bring every inbound message back into your business system with standard events.