Navigation

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

    error AB1050

    Python SDK
    0
    9
    82
    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.
    • Mnagesh
      Mnagesh last edited by

      Getting totp error for one of my client .

      [I 240608 11:04:15 smartConnect:121] in pool
      [E 240608 11:04:15 smartConnect:243] Error occurred while making a POST request to https://apiconnect.angelbroking.com/rest/auth/angelbroking/user/v1/loginByPassword. Error: Invalid totp. URL: https://apiconnect.angelbroking.com/rest/auth/angelbroking/user/v1/loginByPassword, Headers: {'Content-type': 'application/json', 'X-ClientLocalIP': '127.0.0.1', 'X-ClientPublicIP': '106.193.147.98', 'X-MACAddress': '64:00:6a:07:e2:96', 'Accept': 'application/json', 'X-PrivateKey': 'VhEczsBX', 'X-UserType': 'USER', 'X-SourceID': 'WEB'}, Request: {'clientcode': 'xxxxxxx', 'password': 'xxxx', 'totp': 'xxxxxx'}, Response: {'status': False, 'message': 'Invalid totp', 'errorcode': 'AB1050', 'data': None}
      

      @Moderator_1
      @Moderator_2
      @Moderator_3

      Now I am full time Algo Trader and successfully developed my own Apps for my personal use.

      M 1 Reply Last reply Reply Quote 0
      • S
        sunil_modi last edited by

        How did solve this error? As i am not able to enable TOTP and when i try to generate it using secret i got the same error as yours.

        A 1 Reply Last reply Reply Quote 0
        • M
          Moderator_3 @Mnagesh last edited by

          Hello @Mnagesh

          Can you please use the pyotp python library
          totp = pyotp.TOTP(token).now()
          https://pypi.org/project/pyotp/

          Regards,
          SmartAPI Team

          P 2 Replies Last reply Reply Quote 0
          • P
            pas22021990 @Moderator_3 last edited by

            @Moderator_3
            Hi I am using pyotp python library but still getting same error.

            obj=SmartConnect(api_key=API_KEY,debug=True)
            data = obj.generateSession(USER_NAME,PWD,pyotp.TOTP(TOEKN).now())

            Response:
            {'status': False,
            'message': 'Invalid totp',
            'errorcode': 'AB1050',
            'data': None}

            M P 2 Replies Last reply Reply Quote 0
            • M
              Moderator_3 @pas22021990 last edited by

              Hello @pas22021990

              Please assign the value of totp into a separate variable instead of calling it out directly
              Then use the variable inside it

              Regrads,
              SmartAPI Team

              1 Reply Last reply Reply Quote 0
              • P
                pas22021990 @pas22021990 last edited by

                @pas22021990

                I tried having separate value of pyotp.TOTP(TOEKN).now() but still same issue. please refer attached screenshot.

                How does it solve problem if I assign it in separate variable?

                f565ead6-7b96-45cf-a1f7-da7643c276b1-image.png

                1 Reply Last reply Reply Quote 0
                • P
                  pas22021990 @Moderator_3 last edited by

                  @Moderator_3
                  I am using same library and getting same error.

                  1 Reply Last reply Reply Quote 0
                  • A
                    anodkar @sunil_modi last edited by

                    @sunil_modi Response: {'status': False, 'message': 'Invalid totp', 'errorcode': 'AB1050', 'data': None} I too getting same error. Everything on place then what is wrong

                    M 1 Reply Last reply Reply Quote 0
                    • M
                      Moderator_3 @anodkar last edited by

                      Hi @anodkar @sunil_modi Apologies for delayed response. The TOTP value should be a six-digit number configured in the Authenticator app. TOTP number should generate newly every 1 minute check that too. If the issue persists, please let us know with the required details.

                      Regards,
                      SmartAPI Team.

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