- Create a bot
- Get the bot's API token from @BotFather
- Add your bot to the chat you'll be sending messages to
- Get the ID of the chat
a. Fetch bot updates and look for the chat id:b.curl https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/getUpdates | -r '.result[].message.chat.id'
https://api.telegram.org/bot<YourBOTToken>/getUpdates
Eg:-
https://api.telegram.org/bot123456789:jbd78sadvbdy63d37gda37bd8/getUpdates
- Send a message using the HTTP API: https://core.telegram.org/bots/api#sendmessage
curl -X POST \ -H 'Content-Type: application/json' \ -d '{"chat_id": "123456789", "text": "This is a test from curl", "disable_notification": true}' \ https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/sendMessage