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:
The placeholder is actually a token, not a key. Surely you already know what that is and can use it?
Send a message to your bot then retrieve the update with:
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:
The easier way is to go to the web version of Telegram and go to the chat whose ID you want to know. It’ll be in the URL which is in form:
For groups this works too, but their IDs are negative, so if URL looks like
then group chat ID is -1234567.
You could use Json Dump Bot.
The relevant section of the output will be similar to:
or: https://t.me/userinfobot – just forward message to get his id
On Android (or rather Lineage) I was able to look up the user_id under “Settings > Accounts > Telegram”
Click here to cancel reply.