Getting Error AB1050
-
Hi all,
Can anyone help , I am getting following error while trying Smartapi trading API :
data:null
errorcode:'AB1050'
message:'Invalid totp'
status:falseCode 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(); -
@pratikpopat92 Thanks
-
@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.
-
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 .
-
@sauronx
You are not passing totp, I guess they haven't updated their library to accept totp in constructor. -
I tried with python SDK & it works there but not working with Nodejs . Any information on this ?