tedchou12 / webull

Unofficial APIs for Webull.
MIT License
597 stars 183 forks source link

Not getting the Security question on Email #256

Closed manojjenago closed 2 years ago

manojjenago commented 3 years ago

Hi ,

I am trying to use the following code to log in to Webull. But it seems that I am only getting the MFA code , however not getting the security code and Questions. Anything missing here ?

wb.get_mfa(webull_phone) #mobile number should be okay as well. wb.get_security(webull_email) #get your security question. Thanks , Manoj

manojjenago commented 3 years ago

Hi ,

I am getting a sequirity question and ID , however when I tried to enter that , It is always showing results as , below instead of the token. Am I missing anything here ..

{"msg": "Invalid verification code, please regain!", "traceId": "3720c3a1ba00469390d1a4", "code": "verification.code.resend"}

tedchou12 commented 3 years ago

@manojjenago I strongly don't advice trying to go over the security question, because in the end, you will be getting the access and refresh token as well.

If you really want to get it work, I recommend reading over this instead, is much easier and faster. https://github.com/tedchou12/webull/wiki/Workaround-for-Login

manojjenago commented 3 years ago

@manojjenago I strongly don't advice trying to go over the security question, because in the end, you will be getting the access and refresh token as well.

If you really want to get it work, I recommend reading over this instead, is much easier and faster. https://github.com/tedchou12/webull/wiki/Workaround-for-Login

Thanks for your response , I tried the workaround earlier , however was not getting the refresh token from web using workaround. I will try it again . Thanks, Manoj

tedchou12 commented 3 years ago

I am pretty sure refresh token should be given, but if that's not the case, try taking a look here... https://www.youtube.com/watch?v=fqBOePxsCDQ

manojjenago commented 3 years ago

I am pretty sure refresh token should be given, but if that's not the case, try taking a look here... https://www.youtube.com/watch?v=fqBOePxsCDQ

Thanks , I was able to get the refresh token and it was working for a couple of days. But today I am getting this weird error


  File "C:\WeBullTesting\Webull-Trading-Bot\Renko_BUY_SELL_MACD_06_24.py", line 679, in <module>
    log_in_weBull()

  File "C:\WeBullTesting\Webull-Trading-Bot\test.py", line 61, in log_in_weBull
    wb._refresh_token = credential_data['refreshToken']

  File "C:\WeBullTesting\Webull-Trading-Bot\my-venv\lib\site-packages\win32com\client\dynamic.py", line 565, in __setattr__
    raise AttributeError("Property '%s.%s' can not be set." % (self._username_, attr))

AttributeError: Property 'Open._refresh_token' can not be set.

is that my token expired ? or anything

Thanks , Manoj

hz2018tv commented 2 years ago

I am getting {'msg': 'validation failed', 'traceId': 'b49f8e51e06540dc88ab6019a36fd3bb', 'code': 'user.global.4001'} from login(), I did get the MFA in email, also passed in the questionId with answer to that questionId by doing wb.login(email,pass,"wb1",mfa,"2001",ans_to_2001). thanks.

tedchou12 commented 2 years ago

@hz2018tv I strongly recommend this instead: https://github.com/tedchou12/webull/wiki/Workaround-for-Login

hz2018tv commented 2 years ago

@hz2018tv I strongly recommend this instead: https://github.com/tedchou12/webull/wiki/Workaround-for-Login

yes. the workaround works. are the tokens really going to expire on the expiry time? that means we need to manually retrieve those from time to time. not a big deal though, just inconvenient.

tedchou12 commented 2 years ago

No, the refresh token doesn't expire. Mine has been running for over 1 year and still going.