I am getting following error while generating access token for kite3: Please guide me.
(kite3) 17:18 ~/krish $ ipython Python 3.6.0 (default, Jan 13 2017, 00:00:00) Type 'copyright', 'credits' or 'license' for more information IPython 6.2.1 -- An enhanced Interactive Python. Type '?' for help.
In [1]: from kiteconnect import KiteConnect In [2]: api_key="xxxx" In [3]: api_secret="xxxxx" In [4]: kite=KiteConnect(api_key,api_secret) In [5]: kite.login_url() Out[5]: 'https://kite.trade/connect/login?api_key=xxxxx&v=3' In [6]: kite.request_access_token("w1vCPQjMkck31F10s71m0pQ0ImWNVBZ8",api_secret) --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) in () ----> 1 kite.request_access_token("w1vCPQjMkck31F10s71m0pQ0ImWNVBZ8",api_secret) AttributeError: 'KiteConnect' object has no attribute 'request_access_token' In [7]:
1. import logging 2. from kiteconnect import KiteConnect 3. logging.basicConfig(level=logging.DEBUG) 4. kite = KiteConnect(api_key="my api key") # my request token from "https://kite.trade/connect/login?api_key=xxxxx&v=3" and login. 5. data = kite.generate_session("my request token",api_secret="my api secret")
7. kite.set_access_token(data["access_token"])
Please correct if above steps are not correct or anything missing. becuase with above even I am not able to get access token in ipython and getting message " Invalid token".
I would like to know if an access_token generated by logging in from one session is constrained to be used only from that session, or whether it can be additionally be used for things like getting LTP in a python/node script
Is above in one line?
2. from kiteconnect import KiteConnect
3. logging.basicConfig(level=logging.DEBUG)
4. kite = KiteConnect(api_key="my api key")
# my request token from "https://kite.trade/connect/login?api_key=xxxxx&v=3" and login.
5. data = kite.generate_session("my request token",api_secret="my api secret")
7. kite.set_access_token(data["access_token"])
Please correct if above steps are not correct or anything missing. becuase with above even I am not able to get access token in ipython and getting message " Invalid token".