Not able to generate token

Gjain75
data = kite.generate_session("my api key", api_secret="my secret key")

TokenException: Token is invalid or has expired.
  • Gjain75
    data = kite.generate_session(api_key, api_secret)
    DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): api.kite.trade:443
    DEBUG:urllib3.connectionpool:https://api.kite.trade:443 "POST /session/token HTTP/1.1" 403 None
    Traceback (most recent call last):

    File "", line 1, in
    data = kite.generate_session(api_key, api_secret)

    File "C:\ProgramData\Anaconda3\lib\site-packages\kiteconnect\connect.py", line 257, in generate_session
    resp = self._post("api.token", params={

    File "C:\ProgramData\Anaconda3\lib\site-packages\kiteconnect\connect.py", line 840, in _post
    return self._request(route, "POST", url_args=url_args, params=params, is_json=is_json, query_params=query_params)

    File "C:\ProgramData\Anaconda3\lib\site-packages\kiteconnect\connect.py", line 912, in _request
    raise exp(data["message"], code=r.status_code)

    TokenException: Token is invalid or has expired.

  • Gjain75
    Solved it myself. Though would have expected a response from Zerodha team.
  • tahseen
    @Gjain75

    I am not from Zerodha but with all the example and so much on youtube, every new joiner on forum cannot expect Zerodha team to handhold people on the very first step - token generation

    Till date, I have not come across a single problem following their examples. They have done a very good job, let us appreciate them. What was brokerage industry before you, everyone knows
  • Gjain75
    @tahseen thank you for your comment. You are not aware of the background, I had a detailed chat with support team before taking API subscription and had told them that I am not a tech guy but know basics of coding and requested for a paid developer which they dont provide. They assured that at every step I would be handholded or find solutions at the forum, howsoever elementary or basic my problems would be, and on that assurance I bought subscription. that said, I wasnt expecting more than what was promised. Hope that clarifies.
  • tahseen
    @Gjain75 Hope your issue is resolved, if not, you can ask me
  • Gjain75
    Hi Tahseen. My issue is resolved. It was my first day yesterday, and I did not know how to start. Now I am able to get it done. thanks for your help.
Sign In or Register to comment.