Direct URL Integration
This guide covers integrating Advance.AI Web SDK using direct URL redirection - the simplest integration method.
Why Choose URL Integration?
✅ Simplest Implementation: Just redirect to a URL
✅ No Iframe Restrictions: Bypass iframe-related browser limitations
✅ Works Everywhere: Compatible with all browsers and webviews
✅ Mobile-Friendly: Perfect for mobile apps and deep links
✅ Quick MVP: Get started in minutes
How It Works
┌──────────────┐
│  Your App    │
└──────┬───────┘
       │
       │ 1. User clicks "Verify"
       │
       ▼
┌──────────────────┐
│  Your Backend    │  Call generateUrl API
└──────┬───────────┘
       │
       │ 2. Get verification URL
       │
       ▼
┌──────────────┐
│  Your App    │  Redirect to URL
└──────┬───────┘
       │
       │ 3. window.location.href = url
       │
       ▼
┌─────────────────────┐
│  AAI Verification   │  User completes verification
│  (new page/tab)     │
└──────┬──────────────┘
       │
       │ 4. Verification complete
       │
       ▼
┌──────────────────┐
│  Your Redirect   │  Handle callback with results
│  URL (your app)  │
└──────────────────┘
How To Integrate
1. Open URL in WebView
After calling the Generate URL API with the required parameters including returnUrl and failReturnUrl,there will be a url in the response body.
Then App needs to open the URL in WebView.
2. Give Camera Permission
Refer to Camera Permission (H5)
3. Handle Redirect Url
The verification flow will redirect users to one of two URLs based on the result:
Under Review Case: returnUrl
returnUrlWhen it happens:
- User successfully submitted all required materials and under review
 
Important Recommendation: We strongly advise against relying solely on the returnUrl to determine the final KYC result. This URL signifies that the submission process is complete and under review. We may add new parameters to this URL in the future to provide more granular state updates (e.g.,submissionStatus = SUBMITTED). Client systems should be designed to handle these potential future enhancements.
Failure Case: failReturnUrl
failReturnUrlWhen it happens:
- User did not complete submission
 - submission completed but verification failed (LIVENESS_ATTACK,POOR_FACE,TWO_MANY_ATTEMPT)
 
URL Format:
https://yourapp.com/kyc/failed?errorCode=CAMERA_ISSUE
errorCode  | Description  | 
|---|---|
NOT_SUPPORT  | Not supported due to compatibility issues  | 
DOCUMENT_AUTO_SCAN_TRY_COUNT_EXCEED  | Document auto-scan try count exceeded the limit  | 
DOCUMENT_MANUAL_TRY_COUNT_EXCEED  | Document manual photo try count exceeded the limit  | 
DOCUMENT_GALLERY_TRY_COUNT_EXCEED  | Gallery upload retry count exceeded  | 
NO_PERMISSION  | No camera permission  | 
CAMERA_ISSUE  | Camera issue error  | 
IAM_FAILED  | User submits after leaving page open for over 1 hour  | 
RESELECT_DOC_TYPE  | User clicked to reselect document type  | 
RESELECT_REGION  | User clicked to reselect region  | 
LIVENESS_TRY_COUNT_EXCEED  | Liveness detection try count exceeded the limit  | 
LIVENESS_ATTACK  | The liveness detection result < 50.0. whenignoreFailWhenJump set to true, will jump to returnUrl instead.  | 
SIMILARITY_FAILED  | The faceSimilarityScore < 70.0.  | 
NO_SUPPORTED_CARD  | The card type detected from the document image is not supported.  | 
NO_SUPPORTED_CARD_CUSTOMIZED  | The card type is known but not supported currently. maybe support in the future.  | 
Troubleshooting
Issue: Callback Not Received
Solution: Check redirectUrl is correct and accessible
Issue: URL Expired
Solution: Generate new URL(1 hour lifecycle)
Updated 7 days ago
