TOTP while login

Hi

I need help with the TOTP for Login while using the API.
Do we need to manually enter the TOTP every single time or is there some way which we can integrate and the TOTP would be generated automatically or is the API KEY sufficient to create a session.

Someone please help

1 Like

Hi sushluniya,

You are required to manually enter the Time-Based One-Time Password (TOTP) for login purposes, as a security measure. The API key should be included every time along with the TOTP for logging in.

Thank you, and please feel free to contact us for any further issues.

but if I am planning to use these API’s for Algo then how can I enter the TOTP every single time, it needs to be dynamically read from some place right?

I am using pytop, try that.
import pyotp
totp = pyotp.TOTP(SECRET)
print(“Current OTP:”, totp.now())
login = thefirstock.firstock_login(userId=USER_ID,password=PASSWD,TOTP=totp.now(),
vendorCode=fs_vendor_code,apiKey=fs_api_key)