Closed nrameshy closed 1 year ago
No
@krishnavelu Could you help me to know why I am getting this error?
Alice blue team has officially said this in the telegram group -
Users should log in through the Web(ant.aliceblueonline.com) or SSO or Mobile at least once a day, before connecting the API.
But they have changed and still changing many aspects of API rapidly, so unsure if this will persist or go away in the future.
Thank you @aeron7 for the info
Hi, I also started facing this issue from November 4, 2022 onwards. If I login manually first in the application, then only my code works. Please don't close this issue until we find some resolution @krishnavelu Please help.
you have to login through app or web before doing api login. No workaround for this.
You can use selenium to login pre the code and also pull the API secret and connect it to the official wrapper, we can set up authenticator TOTP and login
@srinidhihebbar260297 Stop promoting the stolen code here. Do somewhere else.
Just promoting the code with lesser errors while execution @krishnavelu
Just promoting the code with lesser errors while execution @krishnavelu
Lower execution? The only reason Alice's CTO is Alice's CTO is because of his bootlicking skills.
You can use selenium to login pre the code and also pull the API secret and connect it to the official wrapper, we can set up authenticator TOTP and login
Auto Login is barred as per SEBI rules. Otherwise, The method would've been added here.
Anyways, Anyone who uses or suggests someone to use Selenium to get API Secret must leave Algo Trading for his own good's sake! Ever heard of Python Requests Module?
For the last 3 days I have been observing the below error while generating session id using alice blue api(Version: 2.0.3).
Traceback (most recent call last): File "/home/nrameshy/mkt_data/scripts/get_ab_sessions.py", line 4, in <module> get_session_ids(access_file) File "/home/nrameshy/mkt_data/scripts/ab3_methods.py", line 33, in get_session_ids raise e File "/home/nrameshy/mkt_data/scripts/ab3_methods.py", line 19, in get_session_ids session_id = AliceBlue.login_and_get_sessionID(username = r.username, File "/home/nrameshy/.local/lib/python3.8/site-packages/alice_blue/alice_blue.py", line 232, in login_and_get_sessionID session_id = r.json()['userSession'] KeyError: 'userSession'
I tried to print the r.json() and prints the below info {'emsg': 'Enable/Login with TOTP, to create the session.', 'stat': 'Ok'}If I login to web/mobile app using TOTP and rerun my script to generate sessionID it works fine. So is it required to login web/mobile app before generating session id using alice blue api every day? Please help