Request Parameters
Parameter | Type | Required | Description |
---|---|---|---|
otp_id | string | Yes | OTP ID from the original OTP request |
code | string | Yes | OTP code entered by the user |
developer_app_id | string | Yes | Same developer app ID used for requesting the OTP |
Response Format
Valid Code:Best Practices
Code Validation
- Validate that the code contains only digits
- Check code length before sending to API
- Trim whitespace from user input
- Handle case where user includes spaces in code
Security Considerations
- Store OTP IDs securely (session storage, encrypted database)
- Don’t expose OTP IDs in client-side logs
- Implement maximum verification attempts
- Clear OTP data after successful verification
User Experience
- Show clear error messages for invalid codes
- Provide option to request new OTP if expired
- Display remaining time for code expiration
- Allow users to resend OTP after reasonable delay
Error Handling
- Check both
success
andverified
fields in response - Provide clear error messages to users
- Implement rate limiting to prevent brute force attacks
- Log verification attempts for security monitoring
Error Code | Description | Recommended Action |
---|---|---|
INVALID_CODE | Code doesn’t match | Allow retry, show attempts remaining |
OTP_EXPIRED | Code has expired | Offer to send new code |
MAX_ATTEMPTS_EXCEEDED | Too many failed attempts | Lock user out, require new OTP request |
OTP_NOT_FOUND | Invalid request ID | Handle as invalid request |
ALREADY_VALIDATED | Code already used | Treat as invalid attempt |