Token exception

I am unable to get access token using python client. I have same set of code which is working for other zerodha client ID. Now i have updated new zerodha client id and updated with new API key and api secret.

I just created new api key and secret from zerodha developer portal. I already have develper portal account for other zerodha ID. In the same login i just created one more api key and secret by clicking "CreateApp" and there i mentioned different client ID. Used these api key and secret in my code which resulted my token error. Please help me on this.

when i execute below line which throws me an error saying "TokenException('Token is invalid or has expired.')"

session = brokerHandle.generate_session(requestToken, api_secret=self.brokerAppDetails.appSecret)
  • sujith
    Are you using the correct api_key and secret? You can enable debug logs and check the values in the request and response json.
  • visasimbu
    Yes I did Sujith after checking it in debug only i posted here. Even now i tried same in postman tool as well. I got exact same error in postman too. Here by attached screenshot.

    PS: Same code working for other two different zerodha account. I am having this issue only for this newly created zerodha account. Even I have regenerated new API secret and tried. Resulted into same issues.

    Please help me on this. I have paid money for this subscription but keys are not working.

  • visasimbu
    You were correct Sujith. On debug shows something values are correct. When I isolate my cred from other creds means when i put only needed cred in my config file things are working. So somewhere I am making incorrect call it seems. I will check come back to you. If you need any help on this.
Sign In or Register to comment.