Navigation

    SmartAPI Forum
    • Register
    • Login
    • Search
    • Categories
    • Popular
    • Groups
    • FAQs
    • API Docs

    LOGIN API

    Python SDK
    0
    2
    26
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A
      avinashm last edited by

      Enter TOTP for give client code here:
      TOTP received :
      Error in login 'NoneType' object is not subscriptable
      Traceback (most recent call last):
      File "C:\Users\Avinash\Documents\tradehull\level trading\new.py", line 9, in <module>
      refreshToken= data['data']['refreshToken']
      TypeError: 'NoneType' object is not subscriptable
      {'status': False, 'message': 'Invalid totp', 'errorcode': 'AB1050', 'data': None}

      can anyone guide how to resolve above issue as I am not able to log in .

      1 Reply Last reply Reply Quote 0
      • S
        skargwal last edited by

        from smartapi import SmartConnect
        import pyotp
        global obj

        user_id = ("Your Angel One Account id")
        api_key = ("Api Key")
        pwd = "Mobile app pin "
        qrotp = "Your QRotp"
        totp = pyotp.TOTP(qrotp)
        totp = totp.now()
        obj = SmartConnect(api_key)
        data = obj.generateSession(user_id, pwd,totp)

        refreshToken= data['data']['refreshToken']
        feedToken=obj.getfeedToken()
        userProfile= obj.getProfile(refreshToken)

        print(userProfile)

        1 Reply Last reply Reply Quote 0
        • First post
          Last post