session_id. The second call submits the OTP the holder received.
1
Set your credentials
Use
https://dev.idto.ai (staging) while you build and https://prod.idto.ai (production) when you go live. Keep the client ID and API key on your server only. Never ship them to a browser or a mobile app..env
2
Send the OTP
200 with data.session_id. Keep it with the user’s record.200
3
Submit the OTP
Call
submitOtp(sessionId, otp) with the OTP the holder types in. A verified result returns error_code: null and the Aadhaar details in data.Test it
The sample Aadhaar999999990019 is a placeholder. It passes idto’s format check, so the call reaches a source, and the result depends on which source serves your account. No OTP is sent to anyone in either case. A source that rejects the number answers like this, and nothing is billed:
400 Rejected by the source, not billed
200 with error_code: "IDTO_202" and data: null, and that call is billed. sendOtp returns the HTTP status and error_code for both, so branch on error_code.
Good to know
user_consentmust betrue, or the call returnsIDTO_005.- A malformed OTP is rejected with
IDTO_001before it is checked.