Skip to main content

Overview

API integration provides complete control over the user verification experience through custom UIs and direct API calls. Choose this approach when you need full customization of the user journey.
When to use API Integration:
  • Need complete UI customization
  • Building native mobile applications
  • Require specific flow control logic
  • Want to handle multiple providers differently

Prerequisites

  • API credentials from the Console
  • Understanding of verification flows
  • The provider activated for your app and enabled in its workflow. Otherwise create returns 403 PROVIDER_NOT_ACTIVATED or 403 PROVIDER_DISABLED_IN_WORKFLOW (409 WORKFLOW_NOT_CONFIGURED when the app has no workflow).

Implementation Steps

Step 1: Create Verification Session

Start a verification session with your chosen provider:
Redirect-flow providers (e.g., mitid, id-austria) send the user back to redirectUri. Without it, Hopae uses your app’s first registered redirect URI. QR and push providers do not use it. DC-flow providers have their own create-request variants for the browser and native paths — see the DC Flow tab in Step 2.

Step 2: Handle Flow Response

The API response varies by verification flow type:
Response
Implementation:
  1. On a computer, render flowDetails.qrData as a QR code. Who scans it, the phone’s camera or the app’s own scanner, depends on the provider. On a phone, don’t show a QR code: open the provider’s app from qrData.
  2. Poll for verification status
linkData is a link to Hopae’s page for this verification. It is optional: show it as the QR code on a computer, or open it on a phone with &return_url= and your percent-encoded URL appended, and the page runs the user’s steps for you. A few providers return no linkData (for example eudi-pid, cadmv).
Example

Step 3: Poll for Status

DC Flow users: skip this step. The DC flow has no polling — after submitting the wallet response in Step 2, proceed directly to Step 4.
Poll GET /verifications/{id} until status is completed, failed, or cancelled. On completed, call GET /verifications/{id}/userinfo to obtain the user attributes and provenance. Stop at expiresAt from the create response, 30 minutes after creation: after it, every call for the verification returns 404 SESSION_VERIFICATION_NOT_FOUND.

Step 4: Fetch User and Provenance

When status is completed, fetch GET /verifications/{id}/userinfo to retrieve personal attributes and verification context. You’ll see the personal claims alongside provenance (channel, credentials, evidence, metadata).
Request
Response
When the provider reports its own level of assurance, the response also has acr (for example "acr": "urn:hopae:loa:3"). A match provider adds match at the end: see Return Data Model.
Parsing tips:
  • provenance.presentation.credentials[].type reuses the providerId you supplied (for example, smartid, bankidse).
  • provenance.presentation.credentials[].evidence.token contains provider-specific keys; inspect the semicolon-delimited names string to know which ones are present.
  • Call GET /verifications/{verificationId}/evidence if you only need this token/names object without the rest of the UserInfo payload.
Evidence keys differ per provider. Use the semicolon-delimited names string to determine which fields are present under evidence.token.

Error Handling

Error Code Reference

View complete error codes and handling strategies

Best Practices

  • Never expose Client Secret in frontend code
  • Implement proper session management
  • Use HTTPS for all API calls
  • Validate all responses server-side
  • Show clear loading states during polling
  • Provide timeout warnings before expiry
  • Offer alternative authentication methods
  • Display provider-specific instructions
  • Implement exponential backoff for polling
  • Cache provider information
  • Minimize API calls with proper state management
  • Use webhooks for real-time updates (if available)

Comparison with Hosted OIDC Flow

Consider the Hosted OIDC Flow First: The OIDC integration guide handles provider UX and token issuance automatically. Choose direct APIs only when you need full UI control, native-only UX, or bespoke flow logic.

Next Steps

API Reference

Explore complete API documentation

OIDC Integration

Simpler integration alternative