python api generate_session shows error for checksum but no way to control it

jharames

data = kite.generate_session(requestToken, apiSecret)

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

---------------------------------------------------------------------------
TokenException Traceback (most recent call last)
in
1 requestToken='request token' <- masked by me
----> 2 data = kite.generate_session(requestToken, apiSecret)

~/opt/anaconda3/lib/python3.7/site-packages/kiteconnect/connect.py in generate_session(self, request_token, api_secret)
257 "api_key": self.api_key,
258 "request_token": request_token,
--> 259 "checksum": checksum
260 })
261

~/opt/anaconda3/lib/python3.7/site-packages/kiteconnect/connect.py in _post(self, route, url_args, params, is_json)
828 def _post(self, route, url_args=None, params=None, is_json=False):
829 """Alias for sending a POST request."""
--> 830 return self._request(route, "POST", url_args=url_args, params=params, is_json=is_json)
831
832 def _put(self, route, url_args=None, params=None, is_json=False):

~/opt/anaconda3/lib/python3.7/site-packages/kiteconnect/connect.py in _request(self, route, method, url_args, params, is_json)
896 # native Kite errors
897 exp = getattr(ex, data["error_type"], ex.GeneralException)
--> 898 raise exp(data["message"], code=r.status_code)
899
900 return data["data"]

TokenException: Invalid `checksum`.

  • nakrj
    TokenException: Invalid 'CheckSum' being reported even for correct api key and secret. Kindly, resolve ASAP.
  • sudarshan1413
    sudarshan1413 edited February 22
    Even I am facing the same issue. I just created new App on 22nd Feb 2021. App is not even saving Re-Generated secret and showing Server Error 500.


  • nakrj
    @rakeshr Is there a problem with the API ? Getting TokenException:invalid checksum errors. Kindly, have it checked.
  • rakeshr
    @nakrj
    This is fixed, you can try re-generating successful access_token now.
  • jharames
    Works fine now, thanks.
This discussion has been closed.