Connecting the getUpdates bot
There are two ways to connect a bot working through the getUpdate method, via the API (see the section "Connecting a bot via the API") or by replacing the host with api.telegram.org .
Bots of this type independently request updates from Telegram using HTTPS requests using the getUpdate method. To connect the bot to analytics, you need to change the host api.telegram.org to the host that the system will give you when you connect.
After changing the host, our platform will proxy all requests to the host api.telegram.org and collect statistics for you. Not only getUpdate requests can be sent to this address, but also all other types of requests (sending messages, files, etc.). All requests are proxied to the Telegram servers unchanged.
How to change the host connection in the bot?
Changing the host api.telegram.org provided by the Telegram Bot API, most libraries have the ability to change this address.
If you have not found the instructions for your library or you have problems connecting, please contact our technical support or fill out the form at the end of this page.
Important. The examples use the address "https://tgrasp.co ", you can use this address only if the bot token was specified in your personal account. In other cases, use only the address that you received in your personal account at the stage of setting up the bot.
If you have set a token for the bot in your personal account, the system will give you the address "https://tgrasp.co " otherwise the address will be "https://{code} .tgrasp.co"
Connection instructions for specific libraries
Select the library you are using
Python
PHP
JavaScript
Go
Java
Possible errors
All errors related to the work of the bot fall into the bot errors section in the personal account.
409
Conflict: terminated by other getUpdates request; make sure that only one bot instance is running
The error occurs when the telegram servers record two simultaneous getUpdates requests. Make sure that you have only one data acquisition thread running
502
502 Bad Gateway
Make sure that you are sending the request with the correct structure. Sometimes problems occur on telegram servers and they may respond with this error.
404
404 Not Found
Make sure you are using the correct address for the connection. Compare it with the address provided by the system. The address tgrasp.co can only be used if a token has been provided.
If you are using tgrasp.co, ensure that the bot ID (the first part of the token) matches the one you provided in graspil. The current bot ID in graspil is displayed below the connection address field.
Если вы не нашли нужную вам инструкцию напишите нам в чат на сайте или заполните форму ниже, мы пишем новые инструкции по запросу.
Last updated