DocuPass Live Mobile Introduction

DocuPass Live Mobile is our latest identity verification app that allows you to to verify your user without writing lengthy codes, it features newest live document scanning technology directly through mobile phone camera stream, along with instant face verification and liveness check. The DocuPass Live Mobile module greatly improves user experience comparing to the Mobile module by reducing the overall time required to finish the verification process.

DocuPass Live Mobile does not require end-user to install any app on their phone, users can start verifying themselves by scanning QR code or using an URL. The module can also be embedded into native iOS or Android App using in-app-browser components to provide even better user experience.

Creating Verification Request

You need to create a verification request for every user requiring identity verification, to do so, submit a POST request to:

https://api.idanalyzer.com/docupass/create

The API supports both x-www-form-urlencoded and application/json POST payload, it is up to you to decide the format but be sure to set the correct Content-Type header in your request.

Required Parameters
Key Value Description
apikey String Your private API key is available under your web portal.
type 0: iframe module
1: mobile module
2: redirection module
3: live mobile module
The type of DocuPass module, for live mobile use 3.
companyname Your company or product name This string will be displayed throughout verification page so that end-user knows they are submitting identity information to your company
callbackurl URL to receive callback data Images and identity data will be sent to this url whenever a user succeeds or fails a verification. You must either enable vault_save or specify a callbackurl so that you can process verification result.
Optional Parameters
KeyValueDescription
biometric_threshold float between 0 to 1 (Default: 0.4) [Optional] Specify the minimum score to pass facial biometric verification
authenticate_minscore Float between 0 to 1 (Default: 0.3) [Optional] Document must meet minimum authenticity score to pass validation. Set 0 to disable validity/authenticity check.
authenticate_module 1: Module v1
2: Module v2 (Default)
quick: Quick check against fake ID database
[Optional] Specify module used for validating the document.
maxattempt Integer between 1 to 10 (Default: 2) The number of maximum fail attempts for each verification request. When max attempt is reached, a failed callback will be sent to your server and user will not be able to re-attempt identity verification unless you create a new verification request.
successredir URL Browser will be redirected to this URL when identity verification succeeds. DocuPass reference code and customid will be appended to the end of URL, e.g. https://www.yourwebsite.com/success.php?reference=XXXXXXXX&customid=XXXXXXXX
failredir URL Browser will be redirected to this URL when identity verification failed. DocuPass reference code and customid will be appended to the end of URL, e.g. https://www.yourwebsite.com/failed.php?reference=XXXXXXXX&customid=XXXXXXXX
customid String A custom string that will be sent back to your server's callback URL, and appended to redirection URLs set by successredir and failredir as a query string. It is useful for identifying your user within your database. This value will be stored under docupass_customid under Vault.
reusable true
false (Default)
Enabling this parameter will allow multiple users to verify their identity through the same URL, a new DocuPass reference code will be generated for each user automatically.
documenttype P: Passport
D: Driver's License
I: Identity Card
User must upload a specific type of document. For example "PD" would accept both passport and drivers license.
documentcountry ISO ALPHA-2 Country Code User must upload document issued by specified country. Separate multiple values with comma. For example "US,CA" would accept documents from United States and Canada.
documentregion State/Region full name or abbreviation User must upload document issued by specific state/region. Separate multiple values with comma. For example "CA,TX" would accept documents from California and Texas.
dualsidecheck true
false (Default)
[Optional] Check if the names, document number and document type matches between the front and the back of the document when performing dual-side scan. If any information mismatches error 14 will be thrown.
This module will automatically determine if a back-side scan is required, if an ID has all the information available on the front side, the user will not be asked to scan the back of the ID.
verify_expiry true: Enable (Default)
false: Disable
Only accept document that has not expired
verify_documentno Document number requiring verification User must upload document matching the document number supplied to pass verification.
verify_name Full name including first name and last name requiring verification User must upload document matching the name supplied to pass verification.
verify_dob Date of birth requiring verification, in YYYY/MM/DD format User must upload document matching the date of birth supplied to pass verification.
verify_age Age range, example: 18-40 Uploaded document must show an age between the specified values to pass verification.
verify_address Full address requiring verification User must upload document matching the address supplied to pass verification.
verify_postcode Full postcode requiring verification User must upload document matching the postcode supplied to pass verification.
vault_save true (Default)
false
Save user documents and parsed information into vault. This feature is particularly useful if you wish to inspect verification results. You must either enable vault_save or specify a callbackurl so that you can process verification result.
return_documentimage true (Default)
false
[Optional] Return document image uploaded by user in the callback request.
return_faceimage true (Default)
false
[Optional] Return face image uploaded by user in the callback request.
return_type 0: Base64-encoded Image Content (Default)
1: Remote Image URL
[Optional] Specify the type of image being returned, either base64-encoded image content or an URL to the image. (URL to image will be kept for only 7 days)
qr_color 6 Digit Hex Color (Default 000000) Color of the QR Code Foreground
qr_bgcolor 6 Digit Hex Color (Default FFFFFF) Color of the QR Code Background
qr_size Integer 1-50 (Default 5) Size of QR Code
qr_margin Integer 1-50 (Default 1) Border thickness of QR Code
welcomemessage text Replace generic greeting message on the first page with your customized text (max 1,000 characters)
nobranding true
false (Default)
Hide branding logo on all DocuPass pages (paid user only).
logo URL Custom branding logo (paid user only).
language en fr nl de es zh-TW zh-CN DocuPass automatically detects user device language and displays corresponding language. Set this parameter to override automatic language detection.
Sample Code
$url = "https://api.idanalyzer.com/docupass/create";
$apikey = "Your API Key";
$companyname = "Your Company";
$type = 3;
$callbackurl = "https://mywebsite.com/callback.php";
$customid = "testid123";

$fields = array('callbackurl' => $callbackurl, 'customid' => $customid, 'companyname' => $companyname, 'type' =>  $type, 'apikey' => $apikey);
$resource = curl_init();
curl_setopt($resource, CURLOPT_URL, $url);
curl_setopt($resource, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($resource, CURLOPT_POST, 1);
curl_setopt($resource, CURLOPT_POSTFIELDS, $fields);
$result = json_decode(curl_exec($resource),true);
curl_close($resource);

if(!array_key_exists('error', $result)){
	//success
	print_r($result);
}else{
	//failed
	echo("Error #" . $result['error']['code'] . " " . $result['error']['message']);
}
import requests

apikey = "Your API Key"
companyname = "Your Company"
type = 3
callbackurl = "https://mywebsite.com/callback.php"
customid = "testid123"

payload = {'callbackurl': callbackurl, 'customid': customid, 'companyname': companyname, 'type':  type, 'apikey': apikey}
r = requests.post("https://api.idanalyzer.com/docupass/create", data=payload)
result = r.json()
if "error" in result:
    #failed
    print("Error #" + str(result['error']['code']) + " " + result['error']['message'])
else:
    #success
    print(result['result'])

Reading Response

If all the parameters are valid, API will return a JSON response:

{
    "reference": "AFNWUQG9C2X",
    "type": 3,
    "customid": "testid123",
    "url": "https://docupass.app/AFNWUQG9C2X",
    "qrcode": "https://api.idanalyzer.com/qr/AFNWUQG9C2X.png",
    "base_url": "https://docupass.app",
    "html": "<h3>Scan QR Code below to start identity verification.</h3><p><img src=\"https://api.idanalyzer.com/qr/AFNWUQG9C2X.png\" alt=\"QR Code\"/></p><p>Or visit <strong>https://docupass.app</strong> on your mobile phone and enter reference code:</p><h3>AFNWUQG9C2</h3>"
}
Key Type Description
reference String A unique reference code for the DocuPass session.
type Integer DocuPass module type, which should be the same as the value used to create the verification request.
customid String Custom string, which should be the same as the value used to create the verification request.
url String URL to begin verification when opened in browser.
qrcode String QR Code image pointing to url
base_url String You may send this link to your user and ask them to enter reference code to start verification.
html String Sample instructions in HTML that you can insert into your webpage.

Instructing Your Users

There are two ways for your users to begin a mobile identity verification:

1. Display the QR Code image for your user to scan
2. Ask your user to navigate to the base_url and enter the reference code

As seem from the sample html code returned by our API below, it is possible to present both methods and it would be up to your user to decide if they are going to scan the QR code or manually enter the address and reference code.

<h3>Scan QR Code below to start identity verification.</h3>
<p><img src=\"https://api.idanalyzer.com/qr/AFNWUQG9C2.png\" alt=\"QR Code\"/></p>
<p>Or visit <strong>https://docupass.app</strong> on your mobile phone and enter reference code:</p>
<h3>AFNWUQG9C2</h3>

View Demo

Embedding into Native Apps

It is possible to embed DocuPass lve mobile modules into your native mobile applications.

For iOS 14 or earlier, it is not possible to embed this module into WKWebView due to lack of support for GetUserMedia API, therefore you should open verification URL with Safari. Nevertheless, full support is available after iOS 14 Beta 2.

For Android, create a WebView and navigate to the URL given by DocuPass API.

You can add both successredir and failedredir parameter when creating verification requests, and listen for URL changes in your WebView. This way your app knows verification has been completed without having to poll your server for results.

Processing Callback

DocuPass API will send a callback to your server whenever user completes identity verification, you have to either implement a script to process the callback, or manually inspect verification results in vault.

DocuPass Callback Guide