A
A
Alim20132021-10-01 16:33:19
API
Alim2013, 2021-10-01 16:33:19

How to create a telegram API link, by clicking on which I will receive messages in Json format from someone else's channel?

I need to generate an API link by clicking on which I will receive posts / messages from the telegram channel in Json format.

It is necessary that I can specify in the link id the channel (I recognize it with the help of @getidsbot), from where to get messages. The number of messages to display.

The key token was created via @BotFather. I did https://api.telegram .org/ bot11111111:aaaaAAAA/getUpdates?chat_id=-1000000000 using this method and it doesn't work. Gives messages of the bot itself, but it is necessary from the specified telegram channel.

There is also a getChatHistory method, which also failed to substitute it.
Maybe you need to generate a current key from your own profile, if so, how?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Viktor Golovanenko, 2021-10-01
@drygdryg

Telegram Bot API does not allow you to receive updates from other people's channels (that is, in which the bot is not a member).
You can use the MTProto API to read message history from any public channels .
It will not be possible to generate a link to the required API request, because MTProto is a different binary cryptographic protocol than HTTP, but you can use, for example, the Pyrogram (Python) library to interact with it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question