Telegram : {"ok":false,"error_code":404,"description":"Not Found"}

bolt_api_key = ‘49f0bcf2-4876-4767-adbf-xxxxxxxxxx’
device_id = ‘BOLTxxxxxx’
telegram_chat_id = ‘@temperature_alert0912
telegram_bot_id = ‘bottemp_alert_0912bot’
threshold = 250

I used this config file for Telegram_alert but the response that i received from Telegram is:
{“ok”:false,“error_code”:404,“description”:“Not Found”}

I am unable to resolve this error code.

1 Like

your bot id is wrong. it is supposed to be the api key for bot with the prefix bot

use this to generate api key
and put it there
url for your ease of use

the bot id used by u is wrong…
u will need to use the api given by the botfather which should be prefixed by “bot”…

1 Like

Thanks Bro… I struggled with this for 4 hrs.

bolt_api_key = "09bb1e62-356a-4b49-8c41-6fc179293a32"

device_id = "BOLT290760"

telegram_chat_id = "@alert_waale_bhiya"

telegram_bot_id = "1101895140:AAHv0Bx5mvZ4-fJKRyUqHJdtuYcT2EiaICU"

threshold = 0.0001

The error in this code is related to the configuration setup for the Telegram_bot_id. The variable telegram_bot_id should contain the Bot Token value provided by the BotFather in Telegram, but in this case, it contains bottemp_alert_0912bot which is incorrect. This is the reason why the API request to Telegram returns a 404 Not Found error code.

To fix this error, you need to create a bot on Telegram and obtain a valid bot token from BotFather, then update the value of telegram_bot_id with the correct token. After updating the bot token, send a message to the bot and confirm that it is working properly.