Examples / Messaging and communication / Telegram Bot API
Telegram Bot API webhooks
Updates for a bot: messages, commands, callback queries, inline queries.
Events
- message
- edited_message
- callback_query
- inline_query
Signature
Header X-Telegram-Bot-Api-Secret-Token carries the secret you set with setWebhook. Compare it with your stored value.
✓ A bin checks Telegram Bot API signatures: add the secret_token from setWebhook under Signature verification (Telegram).
Retries
Telegram retries an update until it gets a 2xx, for up to about 24 hours.
See a retry schedule in the calculator.
{
"update_id": 823456789,
"message": {
"message_id": 1042,
"from": { "id": 987654321, "first_name": "Ravi", "username": "ravi" },
"chat": { "id": 987654321, "type": "private" },
"date": 1759924800,
"text": "/status ORD-20481",
"entities": [ { "offset": 0, "length": 7, "type": "bot_command" } ]
}
}
Receive Telegram Bot API webhooks with webhooks.xyz
Create a bin. Paste its URL into Telegram Bot API. Each request shows at once with its headers and body. Add your server as a destination, and deliveries retry when it is down. Request an invite.
More in messaging and communication: Discord, Slack, Twilio, WhatsApp Business (Meta).