New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RPCError(...), 'The api_id/api_hash combination is invalid.' #46
Comments
Have you made sure that you're using the right combination of API ID and API hash? You get these from https://my.telegram.org. |
@Lonami Thank you for the reply! |
Okay, we can keep this open. Good luck and keep me updated :) |
I have the same problem: (RPCError(...), 'The api_id/api_hash combination is invalid.'). |
That's really strange, I have never had this problem. Not sure what it could actually be. I assume https://my.telegram.org provides no insight on the problem either?
By this do you mean you're also using 2 different combinations of Could you try with the "public" API ID/hash from these lines? But please don't abuse it! API ID and hash should be kept private, but since that's public, I guess it's okay to just try. |
Yes, I used 2 different combinations of api_id and api_hash. (Used 2 phone numbers) |
What did you mean? |
After authorization, a hint appeared: "Enter the chat id or command", I entered 1. This is id of The Telegram. And I could send it messages and receive. |
I have the same problem |
Welp… More people having this issue than I would have thought. I literally extracted that error from the Telegram documentation, quote:
After looking for this error on more places I found this issue on ex3ndr's API, the last comment suggesting to try a different IP address manually: static const BuiltInDc _builtInDcs[] = {
{ 1, "149.154.175.50", 443 },
{ 2, "149.154.167.51", 443 },
{ 3, "149.154.175.100", 443 },
{ 4, "149.154.167.91", 443 },
{ 5, "149.154.171.5", 443 }
}; It's strange, though, because the error is Some people using TLSharp had the same issue, even on more recent ones, though they got no reply with a fix for it. Not even Stack Overflow seems to have an answer… Edit: After trying their suggestion I successfully managed to use my production IP, which is said to be "DC 2": Edit 2: It would be good if you could test other libraries out there with the offending API ID and hash to confirm whether it's Telethon related. |
I have same error API_ID_INVALID in 2 different account new created using tlsharp, but in my old account tlsharp works perfect, I changed server address to test and production IP or { 1, "149.154.175.50", 443 }, { 2, "149.154.167.51", 443 },{ 3, "149.154.175.100", 443 },{ 4, "149.154.167.91", 443 }, { 5, "149.154.171.5", 443 } but not result. please help me to resolve this problem. thanks 4 your attention. |
Does Telethon work with the one working on TLSharp? |
sorry I use tlsharp in C#, I've never worked with telethon. |
You cannot pretend me to help you with TLSharp, that is not my library. You should not ask here for help if you're not using this library (not to mention, we're debating a specific issue, not solving questions even if they're related). So, if you're here, it would be nice if you were willing to help to keep this on topic. I need the help of people using both Telethon and other libraries to confirm whether it's Telethon related or a Telegram issue. |
OK, Thank you, but error message is same and solution to one library can help to other. anyway Thank you for your attention. |
most probably it's telegram issue, but Currently there are no resources. |
The same problem, checked two accounts. |
Also does not work with "DC 2" IP |
As far as i know this problem has something to do with the length of new API keys. All API keys that are 5 digits or less - works perfectly. But new ones has 6 digits. And they fail to authorize. |
As far as I know, keys are sent as integer values, not as strings. So this should be no issue I guess. But who knows what they can be doing server side… (I mean, it makes more sense to fail the check for a string length, but numbers don't have a "length" per se unless doing |
I know.. And i was very surprised too. But i checked myself 4 combinations of api/key old ones and new ones with teleton, MadelineProto, golang mtproto and all 5 digits worked, but no 6 digits ever succeded. P.S. Here is TLSharp same issue with traces. No solution so far... |
Hey! Thank you very much for doing that. We can confirm the issue is not Telethon related per se. Nevertheless I will keep this open so people can see this discussion and participate. |
Finally, it works for me! UPDATE UPDATE 2Finally, it works for me![2]
|
Telegram informed me that they have fixed this problem. Use twitter to communicate with them |
Can't find any proof twits, another guy is still experiencing this problem. |
Hmmm. I checked now. I can log in |
Hooray. I also checked, login works!!!))) |
that's oooooooooook |
Nice to know it works now! I'm closing this issue then. |
I have the same issue. So what's the definitive solution? Can anyone help me? |
Just FYI: I'm having the same issue with a six digit id. Four digits work fine. The issue also occurs in other Telegram libraries and is unrelated to Telethon. I guess that this will be fixed by telegram in the near future, so I did not invest a lot of time into finding a workaround. |
I was having the same problem and found a solution to this while I was reading this page, so in case it helps someone... [API] (*#valuesChangedToProtectTheInnocent) Lonamie's comment #issuecomment-293615300 gave me a clue to try removing the single quotes. When I removed the single quotes from the Hash line, it suddenly started working \o/ |
Thanks @johngh |
@johngh Tried that, still no dice |
I am experiencing the same issue still. My id is 9 digit long |
Hi! I receive same problem! I was tried to create session with telethon.sync and failed, but async version can do it! Hope it will help to someone |
@AntonSmirnov2 could you please share the snippet of your code that fixed the issue? |
The code should not matter (unless you actually wrote the hash value wrong, or have spaces or quotes in it, neither of which should be there). The more likely answer is that the API ID and hash take a while to "activate" and be valid and all you have to do is wait (not sure how long). |
@Lonami I'm facing the same initial issue, is there a way to accelerate the activation id/hash from telegram? |
I have never experienced this issue myself. I have no idea why Telegram behaves this way, or how the issue can be resolved. I cannot offer much help. From what I've seen the problem solves itself after some time. I don't know anything else. This is beyond Telethon's control. |
I have the same issue. So what's the definitive solution? Can anyone help me? |
started to encounter the same problem, need help |
I have the same problem too.I tried with two numbers but the problem is still there |
@alexferreras Just like you 3 days ago I ran into this problem when I created an application on https://my.telegram.org / And as @Lonami said, you just have to wait. It's been 3 days and today I lost an error and everything worked @Svarog89 @vpinigin @alirezaPahlavanzadeh If you have created the app recently, just wait a few days |
check format phone number |
First of all, English is not my language, so sorry if I make mistakes.
I hope this helps someone. |
I had such issue with telethon connected via Web (QR code). I cleaned .session and .db files. Executed simple script similar to sergioea, then confirmed with a code sent to TG. After that error is gone for my main scirpt. |
When I run python3 try_telethon.py it all the time says
OS: MacOS, Ubuntu 12.04.
It even does not want to connect. The error occurs on the first self.connect call (Could not stabilise initial connection). What is worth, occasionally this call works. But all the time it fails on sending a code (SendCodeRequest). I use 2 different telegram accounts. The result is the same.
I do as it's written in the readme:
I get the same result in case of using an installed through the pip version.
Could you please tell, if I should do something else.
Update
When the connect call works, it returns the following
The text was updated successfully, but these errors were encountered: