Code Monkey home page Code Monkey logo

Comments (18)

krishnavelu avatar krishnavelu commented on July 22, 2024

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.

akashraut7 avatar akashraut7 commented on July 22, 2024

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.

Parva14 avatar Parva14 commented on July 22, 2024

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.

krishnavelu avatar krishnavelu commented on July 22, 2024

@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.

krishnavelu avatar krishnavelu commented on July 22, 2024

@akashraut7 is the problem solved? I'll close this issue.

from alice_blue.

Jeyanthinath avatar Jeyanthinath commented on July 22, 2024

@krishnavelu can you please add this to the documentation on front page.

from alice_blue.

krishnavelu avatar krishnavelu commented on July 22, 2024

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.

Jeyanthinath avatar Jeyanthinath commented on July 22, 2024

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.

priyakumariengineer avatar priyakumariengineer commented on July 22, 2024

@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.

priyakumariengineer avatar priyakumariengineer commented on July 22, 2024

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.

priyakumariengineer avatar priyakumariengineer commented on July 22, 2024

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.

krishnavelu avatar krishnavelu commented on July 22, 2024

@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.

RajeshSivadasan avatar RajeshSivadasan commented on July 22, 2024

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.

PRAKSH24884 avatar PRAKSH24884 commented on July 22, 2024

Sir please make video how to get access token please sir

from alice_blue.

krishnavelu avatar krishnavelu commented on July 22, 2024

Fixed in #62

from alice_blue.

maheshalgo1 avatar maheshalgo1 commented on July 22, 2024

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.

maheshalgo1 avatar maheshalgo1 commented on July 22, 2024

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.

markfilan avatar markfilan commented on July 22, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.