You are not supposed to enter TOTP. You are supposed to enter the QR code received during TOTP registration.
If you are using python/dot net, or any other language, they have their OTP nugets, where you can pass your QR and it generates the OTP.
Plesae let me the language you are using for integration for further help.