Issues with login using Kite Connect API and python3

agrawaam
Hello

Im trying to use python3 and Kite Connect API and am a complete newbie to the API.

Ive created a PUBLISHER app and got the api_key and secret_key from the kite developer portal.

This is what i did on the python3 shell:

from kiteconnect import KiteConnect
kite = KiteConnect(api_key="zzzz")
kite.login_url()
'https://kite.trade/connect/login?api_key=zzzz'
Then using the URL provided above I go to it in my web browser which redirects and gives me the request_token...which I use as below:

user = kite.request_access_token("aaaa",secret="bbbb")

This throws the following error and I cant figure out why!!!! HELP!!!

Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python3.4/dist-packages/kiteconnect/__init__.py", line 235, in request_access_token
"checksum": checksum
File "/usr/local/lib/python3.4/dist-packages/kiteconnect/__init__.py", line 467, in _post
return self._request(route, "POST", params)
File "/usr/local/lib/python3.4/dist-packages/kiteconnect/__init__.py", line 554, in _request
raise(exp(data["message"], code=r.status_code))
kiteconnect.exceptions.PermissionException: That API call is not allowed for the authenticated user

HELP!!
  • sujith
    Hi @agrawaam,
    Publisher is just a javascript button to include in your blog or website for placing orders.

    KiteConnect is a full fledged APIs to access orderbook, positions, live market data, historical data and placing orders.

    Check out documentation here https://kite.trade/docs/connect/v1/#publisher-js-plugin
  • agrawaam
    Thanks for the quick reply @sujith

    Since I have a PUBLISHER app, is that the reason why I am getting the exception???
  • sujith
    @agrawaam,
    Yes, you are getting the error because you are using publisher app.
  • agrawaam
    @sujith , Thanks for the confirmation. I checked on the portal and it says that the cost of the app is 2000 credits where 1 credit = Rs 1.

    Is there any way to get a trial to test drive the API ... need not be on LIVE data but enough to check out the functionality of the entire API along with execution timings...

    I read somewhere that the API was going through a major revamp and would be greatly speeded up from the current 3 orders/sec if I recall correctly... Is that going to happen anytime soon and can you provide any timing statistics around that...

    Again thanks in advance for all the help and guidance!
  • sujith
    @agrawaam,
    Providing Sandbox environment for API users has been on our list for a very long time. Currently, our priority has been to revamp our core APIs as our client base is increasing.
    We are beta testing new core APIs internally. It will be up soon.
    I am afraid we can't guarantee any timeline as of now because there are too many external factors which affect execution and we want to be completely sure before we deploy this.

    After completion of revamping, we will be working on implementing the sandbox.
Sign In or Register to comment.