Руководство администратора
С помощью смарт-действия «Отправить HTTP-запрос» можно автоматизировать общение через бот мессенджера Telegram.
1. Если вы еще не зарегистрированы в Telegram, пройдите регистрацию.
2. Получите идентификатор нового бота : обратитесь к боту @BotFather c требованием создать нового бота (команда /newbot ).
3. Получите идентификатор беседы с ботом :
• Откройте диалог со своим созданным ботом и напишите ему произвольное сообщение,
• Откройте в браузере ссылку
где — идентификатор, полученный от @BotFather,
• В полученном json-ответе найдите значение в параметре result->message->chat->id , это и есть .
URL для отправки сообщения боту формируется по образцу:
https://api.telegram.org/bot < bot_token >/sendMessage?chat_id= < chat_id >&text=
URL для получения последнего сообщения от бота формируется по образцу:
Если возвращается одно сообщение, то json имеет вид:
Чат-бот может вернуть сразу несколько последних ответов — json вида:
Первое непрочитанное ответное сообщение доступно как значение атрибута result.message[0].text , а доступен как значение атрибута result.message[0].chat.id (этот параметр важен, поскольку бот может вести несколько чатов одновременно).
Простейший пример обмена сообщениями с чат-ботом Telegram описан ниже.
Смарт-пакет для отправки сообщения боту.

Смарт-действие для отправки сообщения боту.
Вариант смарт-действия для отправки сообщения боту с использованием двух параметров:

Вариант смарт-действия для отправки сообщения боту с использованием двух параметров.
![]()
Для данного кейса не поддерживаются зашифрованные задачи

Смарт-пакет для работы с курсом валюты в формате JSON.
Обратите внимание на необходимость очистки ответа веб-сервиса от лишних символов, эти объяснения даны здесь. Поэтому во втором смарт-действии для выделения текста сообщения используется выражение TSQL:
select top 1 JSON_VALUE ( @ActionResult8639, ‘$.HttpResponse.ResponseContent.result[0].message.text’ )
How to find chat id in Telegram | @chat_id_robot [EN]
Telegram user ID — is a digital code that is assigned to each account upon registration. This identifier is needed by the system in order to correctly save data and associate it with a specific user. You won’t be able to find the ID of your account or another chat in the messenger menu.
How to find out your chat id?
- Go to the bot https://t.me/chat_id_robot (or find @chat_id_robot by login)
- Press the ‘/start’ button
- The bot will display your chat ID (see screenshot below)
What else can a bot do?
What information can be sent to @chat_id_robot:
- Logins/links to users or channels.
2. Invite links (telegram invite link).
3. Forwarded message. The bot displays information about the user/chat/channel from which the message was forwarded.
4. One or more images / files.
For images, the bot outputs all kinds of sizes and 2 variables: file_id, file_unique_id.
For files, only type and file_id.
IMPORTANT! Using these variables, you cannot reuse images / files in other bots, because for each bot, an individual file_id is generated by Telegram (file_unique_id is unique for all bots).
5. Links in the buttons below the posts.
mraaroncruz / steps.md
@crystalbit I found an alternative way in the meantime.
- Go to https://web.telegram.org
- Click on your channel
- Look at the URL and find the part that looks like c12112121212_17878787878787878
- Remove the underscore and after c12112121212
- Remove the prefixed letter 12112121212
- Prefix with a -100 so -10012112121212
- That’s your channel id.
Soooo stupid, but it is very quick and it works.
mraaroncruz commented Apr 30, 2020
And thanks for the comment!
ZeroDragon commented Aug 20, 2020 •
With the updated solution I did not even had to make my channel public!
japentaca commented Sep 28, 2020
- Go to https://web.telegram.org
- Click on your channel
- Look at the URL and find the part that looks like c12112121212_17878787878787878
- Remove the underscore and after c12112121212
- Remove the prefixed letter 12112121212
- Prefix with a -100 so -10012112121212
- That’s your channel id.
The only solution I found ! ! !
Thanks a lot !
syntaxhacker commented Oct 1, 2020

much easier way .. forward a message from that channel to this @JsonDumpBot bot
can voila there’s your ID
rajesh457 commented Oct 8, 2020
- Go to https://web.telegram.org
- Click on your channel
- Look at the URL and find the part that looks like c12112121212_17878787878787878
- Remove the underscore and after c12112121212
- Remove the prefixed letter 12112121212
- Prefix with a -100 so -10012112121212
- That’s your channel id.
Thank you so much
seupedro commented Jan 28, 2021

You can simply forward a message to @JsonDumpBot.
The bot dumps a complete json of all request that he receives.
NOTE: I’m not affiliate and it’s not my bot.
reasje commented Feb 17, 2021
much more easier way — to write public username to https://t.me/username_to_id_bot and then easily get the id in response
Thanks , worked for me !
OtenMoten commented May 7, 2021 •

much easier way .. forward a message from that channel to this @JsonDumpBot bot
can voila there’s your ID
Yo bro I donate 5 BAT to you because you save me a lot of lifetime.
mansourcodes commented Jun 1, 2021
much more easier way — to write public username to https://t.me/username_to_id_bot and then easily get the id in response
NeihTzxc commented Jul 12, 2021
can’t use this way anymore, do you have any other way?
OtenMoten commented Jul 12, 2021
much more easier way — to write public username to https://t.me/username_to_id_bot and then easily get the id in response
@NeihTzxc use this method.
ttodua commented Jul 22, 2021
talhazan commented Sep 10, 2021

much easier way .. forward a message from that channel to this @JsonDumpBot bot
can voila there’s your ID
rfwn commented Nov 8, 2021
what if i had a channel id and wanted to get the channel link?
mraaroncruz commented Nov 8, 2021
I still stand by my original solution above where you just have to remove a -100 from a number in a URL.
It feels a bit over-engineered to use a chatbot
mraaroncruz commented Nov 8, 2021
lol and there are three JsonDumpBots. The one that seems to work is the one with the dumptruck icon. But I wouldn’t forward them anything sensitive 😀 😀 😀 😀 😀
ayy-em commented Jan 15, 2022
just wanted to say @syntaxhacker is da MVP for that bot link
myfingerhurt commented Aug 8, 2022
Just right click on channel post and select Copy Post Link , you will get something looks like to this
https://t.me/c/123456789/137
Then do -100 + 123456789 = -100123456789 is your Channel id.

ImGegio95 commented Nov 3, 2022
the solution doesn’t work now. How can I find chat_id now?
wonbinbk commented Feb 2, 2023 •
Thanks everyone, from this thread, I found 2 ways that work:
- Using web.telegram.org, and click on the channel, the URL will be something like: https://web.telegram.org/z/#-1782626220, the channel id is -1001782626220
- Forward a message from that channel to @username_to_id_bot, it will reply with the channel id.
lifeeric commented Feb 15, 2023 •
from telethon.sync import TelegramClient, events client = TelegramClient("bot", API_ID, API_HASH) channel_name = "channel username" channel = client.get_entity(channel_name) print(f' Channel ID: ') client.start() client.run_until_disconnected()
How to Find a Chat ID in Telegram

Telegram is a wildly popular messaging app with a Bot API interface. That means most, if not all, tasks are performed by third-party software. It can pretty much do whatever you can think of – from customizing notifications to making multiplayer games.

Every chat room has an ID number attached to it. It doesn’t matter if it’s private or public nor how many people are involved.
How to Find a Telegram Chat ID On a Mac
You can access Telegram by using the built-in browser for Mac. From there on, you can contact a bot via the web app to find out what your personal chat ID is. Here’s how to do it:
- Open your Safari browser and go to https://web.telegram.org.

- Type your phone number in the corresponding field.
- Telegram will then send you a 6-digit code to your mobile app. Use the number to log in.
- Move your cursor to the search box in the top-left corner of the screen. Type @RawDataBot and hit Enter.

- Click on Telegram Bot Raw to get a message containing your chat info.

We mentioned there’s a hack for checking the chat ID for your group. This only works for the web app, but it’s still pretty nifty:

- Go to https://web.telegram.org.
- Open a group chat.
- Look at the URL at the top of the screen. The digits behind the letter “g” are actually your chat ID. Just add “ — “ in front of the numbers.
If you’re not cut out for online use, you might want to download the desktop version. Telegram is available for free on the Mac App Store. Here’s how you can get it:
- Launch the App Store through the LaunchPad or the Dock. You can also use Spotlight Search to find it.

- Select Categories from the panel on the left-hand side. Browse for the Telegram app. There’s also a search function you can use to find it.

- Click on the Telegram thumbnail to open it. Under the app info, click on the Get button.

- To complete the download, type in your Apple ID and password.

How to Find a Telegram Chat ID On a Windows PC
Of course, there’s a desktop version for both Windows and Linux PCs. You can get it from the official Telegram website. Here’s how:
- Using your preferred browser, go to the official Telegram website.

- Navigate to the top of the screen. Click on the Apps tab.

- Choose Telegram for Windows/Linux in the section for desktop apps.

The desktop app uses the same interface as the online or mobile version. It has all the same features as well, meaning you can use Telegram Bot Raw to find out your chat ID. Here’s how:
- Click on the app icon to launch it.

- Navigate to the Search Box in the top-left corner.

- Type @RawDataBot and select Telegram Bot Raw from the drop-down list.

- 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.

How To Find Telegram Chat ID On Android
You can find the official Android app on Google Play. Once you install it on your phone, you gain access to all Bot API services. That includes Telegram Bot Raw. Here’s how to find your chat ID on the Android app:
- Tap to open the Telegram app.

- In the top-right corner, tap on the small magnifying glass icon.

- Type @RawDataBot in the search dialog box and then tap the search icon.

- Select Telegram Bot Raw from the search results.

- You’ll get an auto-reply message. Tap the Start button.

- You’ll get another message containing your First Name, Last Name, and Chat ID. Find chat from the list of information.

- Under chat, you’ll see a number. It’s marked with the word id on the right-hand side. That’s your Chat ID number.

As we said, group chats also have an identification number. However, you can only look it up if you’re the admin.
How to Find a Telegram Group Chat ID On an Android
- Go to your home screen or Apps menu and open Telegram.

- Find a group chat where you’re the admin. Tap to open it.
- At the top of the screen, tap on the group name.
- Tap the Add Member tab.

- At the top of the screen, tap on the search bar. Type @RawDataBot in the dialog box.

- From the two search results, select Telegram Bot Raw.

- In the bottom-left corner of the screen, tap the blue checkmark button. A pop-up box will appear asking you if you want to add the bot to your chat. Tap Add to confirm or Cancel to stop the process.

- Tap the left-pointing arrow at the top of the screen to go back to the chat. You’ll see a message from the Telegram Raw Bot with information about the group.

- Find chat in the auto-reply message. Below you’ll see the ID number for the group.

How to Find a Telegram Chat ID On an iPhone
The App Store also has a free mobile version available for iPhone. It looks and performs the same as the Android app, down to the process of getting your chat ID. Just in case, let’s go through it again:
- Go to your home screen.
- 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. All it takes is sending a private message:
- Open the Telegram app.

- Select the chat with Telegram Bot Raw to form the list.

- Type /start and tap the arrow icon on the right-hand side to send.

Protip: don’t delete the chat with Telegram Bot Raw. That way, you can always find your chat ID.
How to Create a New Telegram Chat ID
Unsurprisingly, the answer is by using bots. Telegram allows you to update your chat ID through a series of HTTPS requests. You first have to create a bot and then add it to your group as an admin. From there on, it’s pretty straightforward. Also, the process is identical for private and public chats alike.
The most convenient way to do it is by using your browser. Telegram is compatible with virtually any search engine currently in use. Technically, you can do it with your Android or iOS device, but it’s somewhat awkward. Getting a chat ID update requires you to copy and paste your bot token into a website URL, so it’s much easier to use your computer instead.
Keep reading for step-by-step instructions for each device.
Mac
The first part of the process is creating your own bot by using (surprise) a different bot. It sounds far more complicated than it actually is. Here’s how to do it:
- Launch the Telegram desktop app.

- Move your cursor to the search bar in the upper-left corner.

- Type @Botfather in the dialog box. Make sure to choose the official version from the search results. It has a blue checkmark next to the bot name.

- A new chat will open. Click Start.

- You’ll get a message containing a list of commands. Use /newbot to create your bot.

- Botfather will ask you to choose a username for your bot. Type the name and add _bot at the end.

After that, you can update to a different chat ID through an HTTPS request. Here’s what you should do:
- Launch your browser and go to api.telegram.org/bot .
- Navigate to the URL at the top of the screen. Select BOT ID by dragging your cursor.
- Paste your Botfather bot token in the highlighted part. Make sure not to erase the /getUpdates.
- Find your updated chat id in the JSON string below.
Desktop PC
As we’ve mentioned, you can’t change your chat ID on the desktop app. It has to be done online. However, you can use it to make some necessary preparations instead. For example, adding the bot as an admin. Here’s how:
- Open the Telegram app on your desktop.

- Choose a group chat from the panel on the left-hand side.
- Move your cursor to the upper-right corner and click on the three vertical dots.

- Choose Manage Group from the drop-down list.

- A pop-up window will appear. Scroll down and click on the Administrators tab.

- Click on the Add Administrator button in the bottom-left corner. Select your bot from the list of members.

- A pop-up window will appear. Navigate to the bottom-right corner and click Save.

On Android (and iPhone)
It’s really not advisable to do this with your phone. It’s not that you can’t do it with your chosen browser app; it’s just so awkward. Since smartphones have a touch screen, copying your bot token into the URL is quite a hassle. The more sensible solution is to use your computer to access the API web page.
Additional FAQs
Why can’t I access the chat ID?
You have to have a username to be able to access chat IDs. Telegram doesn’t automatically generate one, so you have to set it yourself. Here’s how:
1. Tap on the Telegram icon on your home screen.
2. In the top-left corner, tap on the three horizontal lines. If the app launched a private conversation when opened, go back to the chat list.
3. Choose Settings from the drop-down panel on the left-hand side.
4. Tap on the Username section under your phone number. Type at least five characters to create a valid username. If it’s available, a notification will appear below. If not, the text will turn red. Telegram will ask you to come up with a different name.
5. Tap on the checkmark in the top-left corner to finish.
A Bot for Every Occasion
Once you get used to the particular interface, it’s actually quite handy. Telegram made sure there was a bot for every occasion, and that included managing chat IDs.
You can easily find out what your personal chat ID is after creating a username. When it comes to group chats, you have to be the admin to access that information. The same goes for creating or updating an ID number. And remember – in case of any bugs or glitches, you can always rely on Telegram’s excellent troubleshooting.
Do you like Telegram? What are your thoughts on apps that have Bot API? Comment below and tell us if there’s another way to change your chat ID.
