24

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?

Francesco Rossetti
  • 343
  • 1
  • 2
  • 6

6 Answers6

71

You need to add the word bot before the botToken.

Token: xxx

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

vishnu narayanan
  • 3,813
  • 2
  • 24
  • 28
user3691431
  • 775
  • 6
  • 7
4

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

Dmitry
  • 581
  • 1
  • 4
  • 15
1

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

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.....
Ahmad Mobaraki
  • 7,426
  • 5
  • 48
  • 69
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.

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.

Ihor
  • 131
  • 1
  • 2