Request format
Every method is an HTTP request to https://api.telegram.org/bot<TOKEN>/methodName, with parameters as a query string or JSON, and JSON responses.
Receiving updates
- getUpdates: polling, simple, good for local testing;
- setWebhook: pushed by Telegram, real-time, recommended in production.
Five common methods
- sendMessage: text with Markdown and buttons;
- sendPhoto / sendDocument: images and files;
- answerCallbackQuery: respond to inline button taps;
- setWebhook: set the push URL;
- getMe: check whether the token works.
Caution
A token is a password — never commit it to a public repository. Reading group messages needs privacy mode off or admin rights.