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.

returnUrl and failReturnUrl can be standard web URLs such as https://... or custom app schemes such as myapp://.... If you use a custom scheme, register it in your app before going live. For the full validation rules and callbackUrl restrictions, refer to Redirect URL Requirements.

returnUrl and failReturnUrl can be standard web URLs such as https://... or custom app schemes such as myapp://.... If you use a custom scheme, register it in your app before going live. For the full validation rules and callbackUrl restrictions, refer to Redirect URL Requirements.

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:

Both redirect targets can be web URLs or app deep links, as long as your client application can handle them directly.

Both redirect targets can be web URLs or app deep links, as long as your client application can handle them directly.

Under Review Case: returnUrl

When 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

When it happens:

  • User did not complete submission
  • submission completed but verification failed (LIVENESS_ATTACK,POOR_FACE)

URL Format:

https://yourapp.com/kyc/failed?errorCode=CAMERA_ISSUE

App deep link example:

myapp://kyc/failed?errorCode=CAMERA_ISSUE

App deep link example:

myapp://kyc/failed?errorCode=CAMERA_ISSUE

errorCodeDescriptionNode
NOT_SUPPORTNot supported due to compatibility issuesCOMMON
CAMERA_ISSUECamera issue errorCOMMON
IAM_FAILEDUser submits after leaving page open for over 1 hourCOMMON
ERRORSystem error, backend processing exception or network issueCOMMON
DOCUMENT_AUTO_SCAN_TRY_COUNT_EXCEEDDocument auto-scan try count exceeded the limitDOCUMENT
DOCUMENT_MANUAL_TRY_COUNT_EXCEEDDocument manual photo try count exceeded the limitDOCUMENT
DOCUMENT_GALLERY_TRY_COUNT_EXCEEDGallery upload retry count exceededDOCUMENT
RESELECT_DOC_TYPEUser clicked to reselect document typeDOCUMENT
RESELECT_REGIONUser clicked to reselect regionDOCUMENT
NO_SUPPORTED_CARDThe card type detected from the document image is not supported.DOCUMENT
NO_SUPPORTED_CARD_CUSTOMIZEDThe card type is known but not supported currently. maybe support in the future.DOCUMENT
LIVENESS_TRY_COUNT_EXCEEDLiveness detection try count exceeded the limitFACE
LIVENESS_ATTACK

The liveness detection result < 50.0.

whenignoreFailWhenJump set to true, will jump to returnUrl instead.

FACE
SIMILARITY_FAILEDThe faceSimilarityScore < 70.0.
whenignoreFailWhenJump set to true, will jump to returnUrl instead.
FACE
FACE_QUALITY_TOO_POORFace image quality too low (blurry, insufficient lighting, or wrong angle)FACE


Troubleshooting

Issue: Callback Not Received

Solution: Check redirectUrl is correct and accessible

Issue: URL Expired

Solution: Generate new URL(1 hour lifecycle)