Reference · built on requestConnectorMessaging & notifications

Telegram Bot API

Chats, messages, and bot commands over HTTPS from a Telegram bot, with updates by long polling or webhook.

About

Telegram is a messaging app with private chats, groups, and channels. A bot is an account issued by BotFather; it talks to the Bot API at api.telegram.org over HTTPS, and every call is the bot token followed by a method name such as sendMessage. Updates reach the bot by long polling with getUpdates or by a webhook registered with setWebhook. Dispatch desks and field crews often run their day in Telegram groups.

Through Fibric, an operator reads the updates your bot receives, matches commands and button presses, and proposes a sendMessage, an editMessageText, or a pinChatMessage for a person to approve before it goes out.

This is a reference listing. It documents what Fibric would read from Telegram Bot API and what it could propose, based on the vendor's published interfaces. Fibric builds it under a managed deployment when you request it; selecting it here installs nothing.

Inputs

  • Update objects from getUpdates long polling or from a webhook set with setWebhook; the two cannot run together
  • Message, Chat, and User objects, with text up to 4096 characters and captions up to 1024
  • CallbackQuery updates when someone presses an inline keyboard button
  • Chat details and membership through getChat and getChatMember
  • Group messages only when privacy mode is off, or when a message is a command addressed to the bot or a reply to it
  • Files up to 20 MB downloaded through the Bot API

Proposed actions

  • Target capability: propose a sendMessage, sendPhoto, or sendDocument to a chat the bot is in
  • Target capability: propose editMessageText on a message the bot sent
  • Target capability: propose answerCallbackQuery to acknowledge a button press
  • Target capability: propose pinChatMessage or deleteMessage where the bot holds that right in the chat
  • Target capability: propose forwardMessage or copyMessage from one chat to another

Proposed actions are target capabilities. Every action runs propose-first and needs a validated deployment and the appropriate permissions.

What you can build

  • Job confirmations in the crew group

    A new assignment becomes a proposed message in the crew's Telegram group with an inline button to acknowledge. The dispatcher approves it; the button press returns as a CallbackQuery and closes the loop.

    With Field Dispatch

  • ETA changes to a customer on Telegram

    When a stop's arrival window moves, the operator drafts a sendMessage to the customer's chat with the bot. Nothing goes to anyone who has not started that chat.

    With ETA Notice

  • Fault codes to the maintenance channel

    A diagnostic code from telematics becomes a proposed post in the fleet channel, pinned once a person approves it, and edited in place when the vehicle is cleared.

    With Vehicle Fault, Severe Weather Notice

Requirements

  • A bot created with BotFather and its token
  • The bot added to each group or channel it must read or post in; a bot cannot open a chat with a user first
  • For webhooks: an HTTPS endpoint on port 443, 80, 88, or 8443 with a public certificate or an uploaded self-signed one
  • Privacy mode turned off in BotFather if the bot must read every message in a group
Authentication
A bot token issued by BotFather and sent in the request path of every call; there is no OAuth and no user credential.

Limits

  • About one message per second per chat, 20 per minute in a group, and about 30 per second across all chats
  • Downloads are capped at 20 MB per file and uploads at 50 MB
  • A bot never receives messages sent by other bots, whatever its privacy mode
  • Setting a webhook disables getUpdates; a webhook accepts 1 to 100 concurrent connections, 40 by default

Access and pricing

Reference listing. Fibric builds the connector under a managed deployment when you request it. Your quote covers the build, capabilities, usage, and support.

Request Telegram Bot API ↗

Questions and answers

Can a Telegram bot message someone who has never talked to it?
No. A bot receives messages only from private chats a user opened, groups it was added to, and channels where it is a member. The person starts the conversation; after that the bot can send to that chat within the sending limits.
Should the bot use getUpdates or a webhook?
Either. getUpdates is long polling and needs no public endpoint. setWebhook delivers each update as a JSON POST to an HTTPS URL on port 443, 80, 88, or 8443, with an optional secret echoed back in the X-Telegram-Bot-Api-Secret-Token header. Setting a webhook disables getUpdates.
What does the bot see in a group?
With privacy mode on, the default, it sees commands addressed to it and replies to its own messages. With privacy mode off it sees every message in the group except those from other bots. You change the mode in BotFather.
Ask about Telegram Bot API

Ask about the capabilities and requirements in this listing.

For project-specific requirements, contact Fibric.