Smart API Login issue" or "Not able to login


  • Hi , I am unable to login and getting the below error, please check and let me know the correct way to do it.

    [I 250422 17:51:26 smartConnect:124] in pool

    KeyError Traceback (most recent call last)
    Cell In[2], line 62
    58 writer.writerow([datetime.now(), action, spot])
    61 if name == "main":
    ---> 62 obj = login()
    63 while True:
    64 now = datetime.now().strftime("%H:%M")

    Cell In[2], line 17, in login()
    14 obj = SmartConnect(api_key=apiKey)
    16 data = obj.generateSession(client_id, pin, totp)
    ---> 17 print("🎉 Login Successful! Access Token:", data['data']['access_token'])
    19 return obj

    KeyError: 'access_token'


  • @kksw599 login is working fine, please check your code, and ensure you are fetching correct TOTP.