API Access Token

X3_27
Hello. I am having a problem with access token. My access token becomes invalid/expired after every run. I need to regenerate my request token and access token each time i have to test some commands from console. How can ensure access token remains valid for 24 hours so that I can run work without interruption. I have an active App created and Kiteconnect working normally. I am not logged in to any other instance of kite.
  • Sravanthi_bh
    You may refer to a similar discussion here.
  • X3_27
    Thank you @Sravanthi_bh . I have no understood the problem and expiry issue is resolved. But new problem encountered "Invalid API_KEY or ACCESS_TOKEN". After significant testing I found that this error is coming only when i try to fetch real time data like OLHC, LTP and even My profile data. Fetching static data like name of indexes, name of instruments etc does not throw error. I can see that i have a valid access token but unable to access real time data. Please guide. Note: I have linked App to Zerodha account and paid 500 as per the new rule. Nothing was asked to be paid at the time of APP creation like older times.
  • sujith
    You seem to have added credits to the developers account but created Kite personal app. You will need to create a Kite Connect app on the developers console.
  • X3_27
    Thanks @sujith . That's true. I can delete the app and create a new developer app. Let me try.
  • X3_27
    X3_27 edited May 14
    @sujith Created a new Connect APP and it is active. Regenerated access token with new api key and secret key. Same problem exists. I can only see static data from python console.

    kite.profile() function which should at least return my profile information is the one throwing error and along with other functions to return instrument LTP data.

    kiteconnect.exceptions.TokenException: Incorrect `api_key` or `access_token`.
Sign In or Register to comment.