Error 404 while accessing api method on telegram bot
Asked Answered
B

6

29

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?

Bitch answered 15/12, 2016 at 20:24 Comment(1)
check your token botJonathonjonati
I
79

You need to add the word bot before the botToken.

Token: xxx

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

Infundibuliform answered 4/1, 2017 at 9:16 Comment(0)
J
5

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

Javed answered 18/3, 2019 at 8:39 Comment(0)
E
1

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

Emblaze answered 13/10, 2020 at 11:40 Comment(0)
H
1

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.....
Homologize answered 15/12, 2020 at 9:9 Comment(0)
P
1

Just now, I encountered the same problem with you.After several minutes checking, I found that I add redundant symbols by mistake.

Telegram API Documention points out that we can make requests by https://api.telegram.org/bot<token>/METHOD_NAME.Actually I fill the '<>' with token, which '<>' should be deleted, and so that it caused the wrong return.

I hope my experience can help you.

Pessimism answered 8/11, 2022 at 8:36 Comment(0)
H
0

If you are experiencing this error in your IDE:

/Users/UserName/Project/node_modules/telegraf/lib/core/network/client.js:291
            throw new error_1.default(data, { method, payload });
                  ^
TelegramError: 404: Not Found
    at Telegram.callApi (/Users/UserName/Project/node_modules/telegraf/lib/core/network/client.js:291:19)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async Telegraf.launch (/Users/UserName/Project/node_modules/telegraf/lib/telegraf.js:182:78) {
  response: { ok: false, error_code: 404, description: 'Not Found' },
  on: { method: 'getMe', payload: {} }
}

Then you most likely have a problem with your .env file (specifically the bot token). Make sure your .env file parameters are written without trailing semicolons and without quotes (the latter is not required, but it may be important in your case).

I also recommend using the dotenv package if you are working in a node environment with .env files.

Hardpressed answered 10/10, 2022 at 22:40 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.