Error while running the Telegram code in terminal

Here by u will find the screenshot of the error i m getting while running the Telegram code in terminal. So please help out with this error.

there may be mistake while typing ur 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

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 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