Every Telegram Bot API call is https://api.telegram.org/bot<token>/<method>. Responses are {"ok": true, "result": …} or {"ok": false, "description": …}.
Message @BotFather in Telegram, send /newbot, and it gives you a token like 123456:ABC-DEF…. It goes in the URL, so treat the whole URL as secret. In the examples it's written {{TELEGRAM_BOT_TOKEN}}.
A bot can only message someone who has messaged it first. To find your chat id, message your bot, then run get updates.
Full reference: https://core.telegram.org/bots/api
The bot's id, name, and username — confirms the token works.
curl https://api.telegram.org/bot{{TELEGRAM_BOT_TOKEN}}/getMe
parse_mode can be MarkdownV2 or HTML.
curl -X POST https://api.telegram.org/bot{{TELEGRAM_BOT_TOKEN}}/sendMessage \
-H "Content-Type: application/json" \
-d '{"chat_id": "{{CHAT_ID}}", "text": "Hello from <b>PostTaco</b>", "parse_mode": "HTML"}'
Messages sent to your bot since the last call. Each has message.chat.id. Doesn't work while a webhook is set.
curl "https://api.telegram.org/bot{{TELEGRAM_BOT_TOKEN}}/getUpdates?limit=10"
Telegram POSTs every update to your HTTPS URL instead. deleteWebhook undoes it.
curl -X POST https://api.telegram.org/bot{{TELEGRAM_BOT_TOKEN}}/setWebhook \
-H "Content-Type: application/json" \
-d '{"url": "{{WEBHOOK_URL}}"}'