Is there a way to get an OTP through an API?
There is no API for OTP. You can only get OTPs thought the portal.