krishnavelu / alice_blue

Official Python library for Alice Blue API trading
GNU General Public License v3.0
134 stars 82 forks source link

KeyError: 'isAuthorized' #478

Closed amolc closed 1 year ago

amolc commented 2 years ago

access_token = AliceBlue.login_and_get_sessionID(username,password,twoFA, api_secret=api_secret,app_id=app_id) File "/Users/amolc/2020/finance/env/lib/python3.9/site-packages/alice_blue/alice_blue.py", line 216, in login_and_get_sessionID isAuthorized = r.json()['isAuthorized'] KeyError: 'isAuthorized'

rajeshrapally commented 2 years ago

Im also getting this error suddenly, for working code, is there any technical issue @krishnavelu ?

amolc commented 2 years ago

Hello,

Is there any discord group which we can form to solve the technical errors quickly.

selvaks030 commented 2 years ago

Am also facing same issue

krishnavelu commented 2 years ago

This is due to wrong credentials.

aabhi922 commented 2 years ago

We are seeing this error very frequently but this seems to be an issue with Aliceblue because at the same time web login is also failing

selvaks030 commented 2 years ago

any alternative method we can use to avoid KeyError: 'isAuthorized error ?

krishnavelu commented 2 years ago

No

anilalur commented 1 year ago

This is happening after TOTP. It works if you login from web/app using TOTP before the running the script. @krishnavelu how to work around this ?

krishnavelu commented 1 year ago

Totp doesn't affects api.

selvaks030 commented 1 year ago

am facing this issue only after our git version 2.0

now I use diff code to generate session Id alone and using that session id with our git code

PythonNovice5 commented 1 year ago

Totp doesn't affects api.

It does and I verified it multiple times, do we have some work around please?

anilalur commented 1 year ago

Yes, there is a auto TOTP code, so you can add that for authentication. You can check with Alice API support and they will help you out.

Kittu21082002 commented 1 year ago

In twoFA what should i have to give?

PythonNovice5 commented 1 year ago

Yes, there is a auto TOTP code, so you can add that for authentication. You can check with Alice API support and they will help you out.

@anilalur Thank you so much for the response, I sent an email and raised a ticket with Aliceblue support and waiting for their response on the matter. If possible can you please share the code snippet here? I can directly use it in my code.

Also Alice blue support team replied like this :- Dear eshant garg,

As per SEBI guidelines we are not providing auto-login.

amolc commented 1 year ago

Still facing the same issue. I guess, we need a workaround to solve this.

anilalur commented 1 year ago

t.me/aliceblueapi

aeron7 commented 1 year ago

Refer https://github.com/krishnavelu/alice_blue/issues/500#issuecomment-1386357865