Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error 404 while accessing api method on telegram bot

I just created a bot of telegram to finish a task for the school regarding the integration of ifttt and telegram.

My problem is that trying a browser to use a method of Telegram api it returned to me the following string: {"ok": false, "error_code": 404, "description": "Not Found"}

I use this link to try to access to my bot: https://api.telegram.org/botToken/getUpdates

The bot's token is valid

You can help you solve the problem?

like image 899
Francesco Rossetti Avatar asked Dec 15 '16 20:12

Francesco Rossetti


People also ask

Why bot in Telegram is not working?

Suggestions: Ensure the Bot is in the group and as an admin. Try adding a new access token (revoke existing API key and create a new one then replace in plugin settings) If you edited the bot with @BotFather, make sure to restore it to the default settings.

How can I access Telegram API?

You will have to visit https://my.telegram.org/ and login with your phone number and confirmation code which will be sent on Telegram, and fill in the form under “API Development Tools” with an app title and short name. Afterwards, you can find your api_id and api_hash at the same place.

What is telegram Bot API server?

The Bot API allows you to easily create programs that use Telegram messages for an interface. The Telegram API and TDLib allow you to build your own customized Telegram clients.

How can I get telegram Bot API key?

Obtaining api_id Sign up for Telegram using any application. Log in to your Telegram core: https://my.telegram.org. Go to "API development tools" and fill out the form. You will get basic addresses as well as the api_id and api_hash parameters required for user authorization.

What is apiexception in telegram bot?

telebot.apihelper.ApiException: A request to the Telegram API was unsuccessful. The Server returned HTTP 409 conflict. it because you run one more instance request to 'getUpdates'

What is optional HTTP in telegram?

HTTP or tg:// url to be opened when button is pressed Optional. An HTTP URL used to automatically authorize the user. Can be used as a replacement for the Telegram Login Widget. Optional. Data to be sent in a callback query to the bot when button is pressed, 1-64 bytes Optional.

What is request_poll option in telegram?

Note: request_poll option will only work in Telegram versions released after 23 January, 2020. Older clients will display unsupported message. This object represents type of a poll, which is allowed to be created and sent when the corresponding button is pressed. Optional.

How to react to a telegram callback button press?

NOTE: After the user presses a callback button, Telegram clients will display a progress bar until you call answerCallbackQuery. It is, therefore, necessary to react by calling answerCallbackQuery even if no notification to the user is needed (e.g., without specifying any of the optional parameters).


4 Answers

You need to add the word bot before the botToken.

Token: xxx

Resulting url to invoke: https://api.telegram.org/botXXX/getMe

like image 60
user3691431 Avatar answered Oct 02 '22 20:10

user3691431


By the way, if you have \n in the end of the token, it ll be the same 404 error

like image 23
Dmitry Avatar answered Oct 02 '22 18:10

Dmitry


I changed the folder permissions to 0755 and the problem was solved

like image 29
Hemn Karimi Avatar answered Oct 02 '22 19:10

Hemn Karimi


I have faced similar error using Telegram Bot SDK for laravel.

Error:

Telegram\Bot\Exceptions\TelegramResponseException Not Found

Finally I realized that bot word have to be removed from token!!

Change this:

TELEGRAM_BOT_TOKEN=botxxx.....

To this:

TELEGRAM_BOT_TOKEN=xxx.....
like image 33
Ahmad Mobaraki Avatar answered Oct 02 '22 19:10

Ahmad Mobaraki