Navigation

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

    Getting Error AB1050

    Bugs
    0
    6
    107
    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.
    • S
      sauronx last edited by

      Hi all,

      Can anyone help , I am getting following error while trying Smartapi trading API :

      data:null
      errorcode:'AB1050'
      message:'Invalid totp'
      status:false

      Code snippet :
      let { SmartAPI, WebSocket } = require("smartapi-javascript");

      let smart_api = new SmartAPI({
      api_key: "TRADING_API_KEY",
      });
      smart_api.generateSession("My_AngelOneUserID", "Password")
      .then((data) => { //Getting above error in data
      return smart_api.getProfile();

      S 1 Reply Last reply Reply Quote 0
      • S
        sauronx @sauronx last edited by

        I tried with python SDK & it works there but not working with Nodejs . Any information on this ?

        H 1 Reply Last reply Reply Quote 0
        • H
          Harshu0132 @sauronx last edited by

          @sauronx
          You are not passing totp, I guess they haven't updated their library to accept totp in constructor.

          S 1 Reply Last reply Reply Quote 0
          • S
            sauronx @Harshu0132 last edited by

            Thanks @pratikpopat92

            Yes I also thought that could be the reason as there is usage of TOTP in other libraries but not in Nodejs.

            Any information how can I make it work with Nodejs .

            H 1 Reply Last reply Reply Quote 0
            • H
              Harshu0132 @sauronx last edited by

              @sauronx After installing library from npm, make changes in lib > smart-api.js > line 148 there is a function "self.generateSession" and in function call "smart_api.generateSession("CLIENT_CODE", "PASSWORD")" pass totp here.

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

                @pratikpopat92 Thanks

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