Incorrect `api_key` or `access_token`

Sansanju
Hi Team,

I getting an error while running python script as "Incorrect `api_key` or `access_token`" . When I am just dealing with historical data then same access token is working but when I am working on script which has order placement it is giving me an error with same access token

I tried to logout from kite web and then regenberate the request token but still getting same error

Kindly help
  • salim_chisty
    You can check out the documentation for the login flow. You may refer to the similar discussion here.
  • Sansanju
    Thanks @salim_chisty

    Sorry but I am not getting what I need to do exactly by reading these articles.. Could you please help with proper steps?
  • salim_chisty
    Your access token might have expired. You need to fetch a new access token. An access token is valid for one whole day. Once you get an access token, you don't have to request it again unless you are logged out.

    A request token is valid for a couple of minutes and can be used only once. You should not request for access token for every run. Make sure you store the access token in preferences or a database and reuse it in the next run, and don't call generateSession for every run.
Sign In or Register to comment.