Comments (18)
Do print(resp.url) after this line.
https://github.com/krishnavelu/alice_blue/blob/master/alice_blue/alice_blue.py#L222
You’ll get the right url.
Try that url manually in any browser. During market time.
from alice_blue.
Sir i tried this, i got url , but when i use this url and enter all valid login details, it is showing "something went wrong"
from alice_blue.
https://ant.aliceblueonline.com/oauth2/auth?response_type=code&state=test_state&client_id=<'YOUR CLIENT ID'>&redirect_uri=https://ant.aliceblueonline.com/plugin/callback
Add your client ID and login to this URL during market hours, click on authorize and close that tab after a few seconds. And then you should be able to generate the access token and use the code just like your friend.
from alice_blue.
@akashraut7 try that during market time, not off market time.
If you are not able get access token manually, contact alice... I can’t do anything from my end.
from alice_blue.
@akashraut7 is the problem solved? I'll close this issue.
from alice_blue.
@krishnavelu can you please add this to the documentation on front page.
from alice_blue.
I don’t think so its necessary. People are in a hurry to try out api before api is enable in their account.
This error is due to that.
This has nothing to do with library.
Will refer previous issues and this issue for documentation.
from alice_blue.
Just to understand better
-
if the sdk only login during live market time, then how come we can place out of market order
https://antplus.aliceblueonline.com/#place-amo
-
also wondering why the skd login during only the market time ?
from alice_blue.
@krishnavelu with Upstox API we can log in during off market time also , and yes I belive you should place this thing on main documentation "generate tocken during market time only"
from alice_blue.
Sir i tried this, i got url , but when i use this url and enter all valid login details, it is showing "something went wrong"
I tried during market time only still i am getting something went wrong , can you please explain how you solved the issue , i am not getting anything like authorise application
from alice_blue.
Ohk so got it working I had to clear cookies and app data in my browser and then everything worked fine, @krishnavelu I belive you should Update the document , or atleast create FAQ for this.
from alice_blue.
@Jeyanthinath & @Parva14. You can use the API off market time also. But that doens't mean you can use anytime from 4:00pm to next day 9:00am. All brokers, alice-blue, zerodha, upstox have some undocumented down time. somewhere between 12:00 to 6:00am.
This issue occurs only for first time users of alice-blue api. When you'r account got created new and enabled api just now. If you try during off market time it won't work. That't why I recommend everywhere that when you are trying first time with alice-blue apis, try during market time.
Once you got api established in your account then no one complains about this problem.
That's why I said this problem is only due to people's eagerness to try out api immediately.
To be clear You can use this api off market time also.
from alice_blue.
I am also facing the same issue. Below is the last lines of trace:
File "D:\Python\Python36\lib\site-packages\alice_blue\alice_blue.py", line 249, in login_and_get_access_token
code = resp.url[resp.url.index('=')+1:resp.url.index('&')]
ValueError: substring not found
When I printed the resp.url I found something called consent challenge. Below is the url which may be different for each login. Clicking on this took me to the screen that is mentioned in the comment by Parva14 on Nov 18. I clicked on the Authorize button but it went into a redirecting loop.
https://ant.aliceblueonline.com/oauth/consent?consent_challenge=12cb23662377429a825905f7e4b20e1e
I tried to run my code again after sometime and it worked.
So, I think the consent challenge/authorization step needs to be documented clearly for new users.
from alice_blue.
Sir please make video how to get access token please sir
from alice_blue.
Fixed in #62
from alice_blue.
i have just created api
i just want to know from where i have to start
bcos new in coding
i have install python 3.8 vs code also
from alice_blue.
https://ant.aliceblueonline.com/oauth2/auth?response_type=code&state=test_state&client_id=<'YOUR CLIENT ID'>&redirect_uri=https://ant.aliceblueonline.com/plugin/callback
Add your client ID and login to this URL during market hours, click on authorize and close that tab after a few seconds. And then you should be able to generate the access token and use the code just like your friend.
sir can u help me
just want follow up
from alice_blue.
When you use string_object.index(substring), it looks for the occurrence of substring in the string_object. If substring is present, the method returns the index at which the substring is present, otherwise, it throws ValueError: substring not found.
Using Python's "in" operator
The simplest and fastest way to check whether a string contains a substring or not in Python is the "in" operator . This operator returns true if the string contains the characters, otherwise, it returns false .
str="Hello, World!"
print("World" in str)//output is True
Python "in" operator takes two arguments, one on the left and one on the right, and returns True if the left argument string is contained within the right argument string. It is important to note that the "in" operator is case sensitive i.e, it will treat the Uppercase characters and Lowercase characters differently.
from alice_blue.
Related Issues (20)
- Not able to download NFO contracts HOT 3
- Name not reflecting in WS for indices HOT 1
- Unable retrieve live data using web sockets HOT 1
- isAuthorized = r.json()['isAuthorized'] HOT 23
- Status 404 Not found - While logging in with session ID (was working until Yesterday) HOT 29
- Alice Blue Api - Login Help HOT 1
- DEPTH_DATA ( Null Values ) HOT 4
- Unable to get session id from the below code HOT 2
- AliceBlue API login error HOT 2
- Hi, I was wondering if its possible to generate a SessionID using AppCode and SecretKey alone? using a Python Script? Or do I need a Username and Password too along with AppCode and SecretKey? If its possible then please let me know how. HOT 1
- Base URL not responding https://a3.aliceblueonline.com/rest/AliceBlueAPIService HOT 6
- Websocket closes abruptly and live feed of banknifty stops HOT 1
- #Issue in generating EncKey HOT 1
- Unbale to genereate Token Failing at 2FA validation HOT 7
- STOPPED WORKING def square_off(self, instrument, quantity, product_type)
- Websocket Data to OHLC sample code
- Getting "websocket:error" time to time while streaming nifty index data HOT 1
- Error for option symbol HOT 1
- Web socket is not giving me a ohlc data
- Unable to get session ID. Getting json.decoder.JSONDecodeError error HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from alice_blue.