access token expired


I generated a new access token using the login method, i used the access token to generate list of instruments using instrument function but when i try to use other functions like orders or holdings i get the below error.

raise exp(data["message"], code=r.status_code)
kiteconnect.exceptions.InputException: Invalid `api_key` or `access_token`.

and the existing access token is still valid to gather the data. any help would be appreciated
  • karthikdhanusu
    Hi Team,

    I am using the official python SDK to login and fetch the data, I am able to receive the request token with that I can generate a new access token as well but when i use certain functions it works like instrurments()/ profile() but when i try to use orders(), Holdings() or positions() I am getting an error response that I have parsed an invalid api_key or access_token. I did a test to check if the access token is valid or not, i used the instruments() function again inorder to validate it, it works but some of the functions don't work at all. Please help investigate this issue.
  • karthikdhanusu
    I am parsing the valid access_token, api_key and api_secret
  • karthikdhanusu
    When I try to use the restAPI I don't get this issue
  • sujith
    The instruments master file doesn't have authentication, but others have authentication.
    You can go through the login flow here.
    Make sure you understand this behavior.
Sign In or Register to comment.