The api_id/api_hash combination is invalid
See original GitHub issueIt turns out that my script worked perfectly until I tried using it on another server, and from that moment on it stopped working and the error appears api_id / api_hash combination is invalid. I have checked api_id and hash_id many times, but they haven’t changed… so I would appreciate some help. Thanks.
Traceback (most recent call last):
File "mytelegram.py", line 41, in <module>
tclient.send_code_request(phone)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/telethon/telegram_client.py", line 241, in send_code_request
result = self(SendCodeRequest(phone, self.api_id, self.api_hash))
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/telethon/telegram_bare_client.py", line 486, in __call__
result = self._invoke(call_receive, request, ordered=ordered)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/telethon/telegram_bare_client.py", line 583, in _invoke
raise next(x.rpc_error for x in requests if x.rpc_error)
telethon.errors.rpc_error_list.ApiIdInvalidError: The api_id/api_hash combination is invalid
Issue Analytics
- State:
- Created 5 years ago
- Comments:18 (6 by maintainers)
Top Results From Across the Web
"The Combination Is Invalid" Error When Loading Assignment ...
Goal. On : 11.13.19.01.0 version, Data Load "The combination is invalid" error when loading assignment with expense accounts.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I actually figured it out. It was my fault I guess.
I created a bot account from BotFather and I was using my bot’s API token for all the variables;
api_id,api_hashandbot_token. I did not realize that I had to use myapi_idandapi_hashfor those variables. So to summarize:I was actually going back and forth through the documentation and realized that I was wrong after reading TelegramClient page. In my opinion it should be mentioned on here too.
The “here” you mention already says:
API ID, API hash, and bot token, all are different terms. But if you can improve the documentation, feel free to send a PR.