For Telegram, how can I find out my own user id (chat_id
) for use with the Telegram API?
I want to send myself a message via the Telegram API, like this:
https://api.telegram.org/bot<BOTID>/sendMessage
When you've located @userinfobot, click or tap it. Then, select Start at the bottom of the chat. By clicking Start, you've automatically entered “/start.” It will prompt the bot to display your user ID, as well as your selected first name, last name, and the language of choice.
Click on the “Start” button in the auto-reply message. The Telegram bot will send a message with your account info. Scroll down and find “Chat.” Your chat ID number is listed below, next to “id.
From now on, you can choose a public username in the Settings section of Telegram. If you do, anyone will be able to find you by your username and contact you – without having to know your phone number. To find people by username, just start typing any name in the search field of the Contacts section.
CHAT_ID: To send a message through the Telegram API, the bot needs to provide the ID of the chat it wishes to speak in. The chat ID will be generated once you start the first conversation with your bot. Start a conversation with your bot:
Steps to finding a user’s ID on the Telegram app 1 You will first, of course, need to open the Telegram app on your device. ... 2 When the Home page opens, in the search bar search for the @userinfobot and click on that username. 3 You should now start a chat with this bot, click on the big Start button at the end of your screen. More items...
You can also use your Face ID or just press the “Home” button. Find the Telegram icon and tap to launch the app. Use the search function to access the “Telegram Bot Raw.” Find your chat ID in the auto-reply message. You can also use a chat command to ask the Telegram bot for your account information.
Download and install the telegram messenger for your platform. Start the telegram client and follow the registration process. Cool Tip: Install the Telegram app on Ubuntu and Linux Mint! Read more → BotFather: The BotFather is the one bot to rule them all.
Send a message to your bot then retrieve the update with:
https://api.telegram.org/bot<BOTID>/getUpdates
In the json string returned you will find you chat_id/user_id.
In single chat with the bot chat_id is equal to user_id.
Now you can send your message with:
https://api.telegram.org/bot<BOTID>/sendMessage?chat_id="yourchatid"&text="Hello!"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With