Error generating session


  • i am using the nodejs sdk and not able to login it is showing invalid totop error , i have fetched the latest totp and using the required credentials.

    let smart_api = new SmartAPI({
    api_key: "Y6obuCDt",
    });

    smart_api
    .generateSession("Y22365", "2014", "QOI6NFVNVQFGHKSAEOKRJZN4")
    .then((data) => {
    return data;
    })
    .then((data) => {
    console.log(data);
    })
    .catch((ex) => {
    //Log error
    });


  • Hello @yameen07
    You need to get the totp by passing the above string QOI6NFVNVQFGHKSAEOKRJZN4 then you need pass the created totp in your code.To achive the topt you can use any totp library.

    Regards,
    SmartAPI Team