Invalid `checksum`

Agastya
Hi,

I am getting 'Invalid checksum' error when trying to generate the Access_token. Below is Python script I am running:
import pyotp
from kiteconnect import KiteConnect

api_key = "xxx"
api_secret = "yyy"
kite = KiteConnect(api_key=api_key)
# 2. Generate TOTP using your TOTP Secret Key
totp_secret = "zzz"
current_totp = pyotp.TOTP(totp_secret).now()
print(f"Your current 2FA TOTP is: {current_totp}")
# 3. Complete login via your browser to get the request_token
# After logging in manually or automating the URL redirection, capture the token:
request_token = "xyz"

# 4. Generate Session (Corrected Parameters)
try:
session = kite.generate_session(request_token=request_token, api_secret=api_secret)
kite.set_access_token(session["access_token"])
print("Login successful! Access token set.")
except Exception as e:
print(f"Session generation failed: {e}")

could you please let me know the issue?

Thanks,
Agastya
Tagged:
  • salim_chisty
    It means either your api_key or api_secret or request token is wrong. You may refer to the similar discussion here.
  • Agastya
    Thank you Salim. out of nowhere, it generated the Access token today morning, successfully. I followed the same login flow and same Python script as yesterday! Not sure what was the reason.
Sign In or Register to comment.