Error while running the Telegram code in terminal

there may be mistake while typing ur confy.py file. check ur bot_id and chat_id . and check did u use @ symbol before ur chat id

@dhruvilp8141 Telegram 401 Error Unauthorised

Please do search your query before posting a new one. Forum has already answered some common errors like this. Try searching Telegram 401 or Telegram 404 for more solutions, if this does not resolves your issue.

1 Like

it is correct then also it is showing me error

even for me also getting same error,
i have used correct bot_id and chat_id but also im getting this error,

{“ok”;false,“error_code”:401, “description”:“unauthorized”}

Please help me out

Hi @puttur.sachin and @dhruvilp8141,

Can you share the screenshot of your code and conf file. Blur some part of the key in conf file.

please check the pics which is attached and please let me know.
im getting this error {“ok”;false,“error_code”:401, “description”:“unauthorized”}

Sir please check the following images and get me updated.

![Capture5|584x499]Preformatted text(upload://6i01CjaYDtDyAdhhIQM0K3X1v01.png)emphasized text

@puttur.sachin
you should never share api key and bolt device id
this is to be kept confidential.
please change the api key by reading all information related to it.
and if possible remove this images and blur the key and id and resend .

i have removed that pic and also i have changed the API_key.
Please help me on this error.

rahul.sing1 sir is the right person to help.

@rahul.singh1 sir can u please help me out for this error.
Here is the conf file.

Hi @puttur.sachin,

To debug the issue, I will suggest you run your code here VMware, Virtualbox, Digital Ocean all are not working : Solved. Here you can easily copy paste the value of telergam id and other credentials.

If the program is working online, it means there is typo error in your conf file else we will figure out something else for your code.

Do let me know in case you need any other information.

sir i have checked online now again the same error it is showing.

sir online i have cross checked the program and now its working and im getting the output also.

can i know y the VMware ubantu is not working for this sir.?

Hi @puttur.sachin,

This is not the issue of Vmware or virtualbox. As you I can see in your output, you are getting the response from the telegram and the response from telegram is Unauthorized. It means you are sending the wrong credentials to telegram. There must be some typo error in the credentials of your conf file. Check each character from http://repl.it/ code and from your python conf file code.

Check the similar thread here Telegram 401 Error Unauthorised

sir i have checked each and every character but now it is showing this error in VMware.

{“ok”;false,“error_code”:401, “description”:“Not found”}

@dhruvilp8141 Hey,this error occurs to me and it is due to invalid telegram credentials so recheck your telegram_chat_id and telegram_bot_id for incorrect entry.For me,the cause of error is due to wrong entry of O for zero as they look alike in telegram_bot_id so do check it.Hope it helps.

yes i too faced the same issue check the bot id they are case sensitive.check the upper case and lower case of each letter.i typed upper case ‘‘S’’ in lower case after correcting it i got the output

hello sir, can I run telegram program in kali linux. same problem in my project and it is working and output is also come but in telegram no msg coming and I copy http bot api . In console temperature value show .
//The current sensor value is: 81
The current sensor value is: 122

after result error shown
error show:
this is the response-> {‘value’: ‘You have been rate limited. Try after 5 Hours:59 Minutes:58 Seconds’, ‘success’: 0}
The current sensor value is: -999
Request was unsuccessfull. Skipping.

Hi @kolekarrushita,

This has happened because there is a rate limit of your API access
You’ve crossed your rate limit of your API Key. You can try again after some time and it will work as expected.

Please check this link https://docs.boltiot.com/docs/api-access-rules for more info.