Access token issue - Not staying valid for a day

whity
whity edited April 2 in Python client
Hi Team I am using a python code which saves the access token in a text file, this is later read to start the session . But every time I do this, I am getting the below error.

kiteconnect.exceptions.TokenException: Token is invalid or has expired.

I am only able to use this access token one time.
Not sure, what I am doing wrong, can someone help?
  • whity
    I am using the free personal api version.
  • sujith
    You may refer to this thread.
  • Sravanthi_bh
    Kindly make sure you are not using the same access token the next day. If not, pause and restart the subscription again.

    You may check out this thread for a similar discussion. Also, refer to API documentation for the complete login flow.
  • whity
    @sujith I have the access token saved in a text file, How do I reuse again from another code? Process is not clear.
  • Matti
    @whity this token saved in the text file is for the same day or reused everyday? An access token is only valid for the current trading day and you'll have to generate a new one everyday.
  • whity
    @Matti I am trying to use within the same day. Can u guide how to reuse the access token from another code, basically how to reuse?
  • whity
    @Matti @sujith how to reuse an access token throughout the day..? say I got the token and saved in a file. how to use that again to start trading again, intraday?
  • Sravanthi_bh
    You may check out the similar discussion here
  • whity
    @Sravanthi_bh @sujith @Matti Appreciate your help, it worked. I recommend to put this code example in the github examples. It will really help!
Sign In or Register to comment.