15 min integration

v2client Integration Guide

Integrate okID verification into your application using the v2client portal. Complete server-to-server integration in under 15 minutes.

Prerequisites

okID Dashboard Access

Access to v2dashboard to create and manage API keys

Server Environment

Any server that can make HTTP requests (Node.js, Python, PHP, Go, etc.)

v2client Portal URL

The hosted v2client instance URL (e.g., https://verify.test.okid.io)

How v2client Integration Works

1. Get API Key

Create API key in v2dashboard

2. Generate Verification

Server calls v2client with API key

3. Redirect User

User completes verification in portal

Your Server → v2client Portal → okID Backend
     │              │                 │
     │ 1. POST       │ 2. Create      │
     │ /generate-    │ verification   │
     │ verification  │ using API key  │
     │ + API key ────┼───────────────▶│
     │              │                 │
     │ 3. Redirect   │ 4. User        │
     │ user to       │ verification   │
     │ portal ──────▶│ flow ─────────▶│

1
Get Your API Key

Create an API key in the v2dashboard. This key authenticates your server when generating verification IDs.

Security Requirements

API keys are for server-side use only. Never expose them in client-side code, URLs, or logs.

Creating Your API Key:

  1. Log into your v2dashboard
  2. Navigate to the "API Keys" section
  3. Click "Create API Key"
  4. Configure verification modules (document, liveness, form_data)
  5. Set retention period and other settings
  6. Save the API key securely in your server environment

Store Securely

Store your API key as an environment variable or in a secure configuration system.

# Environment variable (recommended)
API_KEY=your-api-key-here
V2CLIENT_URL=https://verify.test.okid.io

2
Generate Verification ID

When a user needs to verify their identity, your server makes a request to the v2client portal to generate a verification ID.

Server-Side Only

This step must be performed on your server. API keys are never sent to browsers.

API Endpoint:

POST {v2client_url}/api/generate-verification

Headers:
  Content-Type: application/json
  X-SDK-Key: your-api-key-here

Response:
{
  "verificationId": "ver_abc123...",
  "expiresAt": "2024-01-01T12:00:00Z",
  "modules": {...},
  "flow": ["terms", "document", "liveness"]
}

Example Implementation:

Node.js / Express:
app.post('/verify-user', async (req, res) => {
  try {
    // Generate verification ID using your API key
    const response = await fetch(`${process.env.V2CLIENT_URL}/api/generate-verification`, {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
        'X-SDK-Key': process.env.API_KEY
      }
    });

    if (!response.ok) {
      throw new Error('Failed to generate verification');
    }

    const { verificationId } = await response.json();
    
    // Redirect user to v2client portal
    const verifyUrl = `${process.env.V2CLIENT_URL}/verify?verification_id=${verificationId}`;
    res.redirect(verifyUrl);
    
  } catch (error) {
    res.status(500).json({ error: 'Verification generation failed' });
  }
});
Python / Flask:
import os
import requests
from flask import redirect

@app.route('/verify-user', methods=['POST'])
def verify_user():
    try:
        # Generate verification ID using your API key
        response = requests.post(
            f"{os.getenv('V2CLIENT_URL')}/api/generate-verification",
            headers={
                'Content-Type': 'application/json',
                'X-SDK-Key': os.getenv('API_KEY')
            }
        )
        response.raise_for_status()
        
        verification_data = response.json()
        verification_id = verification_data['verificationId']
        
        # Redirect user to v2client portal
        verify_url = f"{os.getenv('V2CLIENT_URL')}/verify?verification_id={verification_id}"
        return redirect(verify_url)
        
    except Exception as e:
        return {'error': 'Verification generation failed'}, 500
PHP:
<?php
function generateVerification() {
    $v2clientUrl = $_ENV['V2CLIENT_URL'];
    $apiKey = $_ENV['API_KEY'];
    
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, "$v2clientUrl/api/generate-verification");
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_HTTPHEADER, [
        'Content-Type: application/json',
        "X-SDK-Key: $apiKey"
    ]);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    
    $response = curl_exec($ch);
    $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
    curl_close($ch);
    
    if ($httpCode === 200) {
        $data = json_decode($response, true);
        $verificationId = $data['verificationId'];
        
        // Redirect user to v2client portal
        $verifyUrl = "$v2clientUrl/verify?verification_id=$verificationId";
        header("Location: $verifyUrl");
        exit;
    } else {
        http_response_code(500);
        echo json_encode(['error' => 'Verification generation failed']);
    }
}
?>

3
User Verification Flow

After redirecting the user to the v2client portal, they will complete the verification process automatically.

What Happens Next:

  1. User lands on the v2client verification portal
  2. Portal validates the verification ID
  3. User completes verification modules (terms, document, liveness, forms)
  4. Results are processed and stored
  5. User sees completion status
  6. Verification results appear in your v2dashboard
Example User Journey:

URL: https://verify.company.com/verify?verification_id=ver_abc123

Step 1: Accept terms of service

Step 2: Upload ID document (front/back)

Step 3: Take selfie for liveness detection

Step 4: Fill any additional form data

Step 5: Verification complete!

Checking Results

All verification results appear in your v2dashboard under the "Verifications" section. You can also use webhooks or polling to get results programmatically.

Testing Your Integration

Quick Test Checklist:

API key created and stored securely
Server can make requests to v2client generate-verification endpoint
Verification ID is generated and user is redirected correctly
User can complete verification flow in v2client portal
Results appear in your v2dashboard

Ready for Production

Once your test verification completes successfully, your integration is ready for production use!