Documentation

CoreAPI

Table of Contents

$apiendpoint  : mixed
$apikey  : mixed
$config  : mixed
$defaultconfig  : mixed
$throwError  : mixed
__construct()  : void
Initialize Core API with an API key and optional region (US, EU)
enableAMLCheck()  : void
Check document holder's name and document number against ID Analyzer AML Database for sanctions, crimes and PEPs.
enableAMLStrictMatch()  : void
By default, entities with identical name or document number will be considered a match even though their birthday or nationality may be unknown. Enable this parameter to reduce false-positives by only matching entities with exact same nationality and birthday.
enableAuthentication()  : void
Validate the document to check whether the document is authentic and has not been tampered, and set authentication module
enableBarcodeMode()  : void
Disable Visual OCR and read data from AAMVA Barcodes only
enableDualsideCheck()  : void
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.
enableImageOutput()  : void
Generate cropped image of document and/or face, and set output format [url, base64]
enableVault()  : void
Save document image and parsed information in your secured vault. You can list, search and update document entries in your vault through Vault API or web portal.
generateContract()  : void
Generate legal document using data from user uploaded ID
resetConfig()  : void
Reset all API configurations except API key and region.
restrictCountry()  : void
Check if the document was issued by specified countries, if not error code 10 will be thrown. Separate multiple values with comma. For example "US,CA" would accept documents from United States and Canada.
restrictState()  : void
Check if the document was issued by specified state, if not error code 11 will be thrown. Separate multiple values with comma. For example "CA,TX" would accept documents from California and Texas.
restrictType()  : void
Check if the document was one of the specified types, if not error code 12 will be thrown. For example, "PD" would accept both passport and drivers license.
scan()  : array<string|int, mixed>
Scan an ID document with Core API, optionally specify document back image, face verification image, face verification video and video passcode
setAccuracy()  : void
Set OCR Accuracy
setAMLDatabase()  : void
Specify the source databases to perform AML check, if left blank, all source databases will be checked. Separate each database code with comma, for example: un_sc,us_ofac. For full list of source databases and corresponding code visit AML API Overview.
setBiometricThreshold()  : void
Set the minimum confidence score to consider faces being identical
setOCRImageResize()  : void
Scale down the uploaded image before sending to OCR engine. Adjust this value to fine tune recognition accuracy on large full-resolution images. Set 0 to disable image resizing.
setParameter()  : void
Set an API parameter and its value, this function allows you to set any API parameter without using the built-in functions
setVaultData()  : void
Add up to 5 custom strings that will be associated with the vault entry, this can be useful for filtering and searching entries.
throwAPIException()  : void
Whether an exception should be thrown if API response contains an error message
verifyAddress()  : void
Check if supplied address matches with document.
verifyAge()  : void
Check if the document holder is aged between the given range.
verifyDOB()  : void
Check if supplied date of birth matches with document.
verifyDocumentNumber()  : void
Check if supplied document or personal number matches with document.
verifyExpiry()  : void
Check if the document is still valid based on its expiry date.
verifyName()  : void
Check if supplied name matches with document.
verifyPostcode()  : void
Check if supplied postcode matches with document.

Properties

$apiendpoint

private mixed $apiendpoint = ""

$defaultconfig

private mixed $defaultconfig = array("accuracy" => 2, "authenticate" => false, "authenticate_module" => 1, "ocr_scaledown" => 2000, "outputimage" => false, "outputface" => false, "outputmode" => "url", "dualsidecheck" => false, "verify_expiry" => true, "verify_documentno" => "", "verify_name" => "", "verify_dob" => "", "verify_age" => "", "verify_address" => "", "verify_postcode" => "", "country" => "", "region" => "", "type" => "", "checkblocklist" => false, "vault_save" => true, "vault_saveunrecognized" => false, "vault_noduplicate" => false, "vault_automerge" => false, "vault_customdata1" => "", "vault_customdata2" => "", "vault_customdata3" => "", "vault_customdata4" => "", "vault_customdata5" => "", "barcodemode" => false, "biometric_threshold" => 0.4, "aml_check" => false, "aml_strict_match" => false, "aml_database" => "", "contract_generate" => "", "contract_format" => "", "contract_prefill_data" => "", "client" => 'php-sdk')

$throwError

private mixed $throwError = false

Methods

__construct()

Initialize Core API with an API key and optional region (US, EU)

public __construct(string $apikey[, string $region = "US" ]) : void
Parameters
$apikey : string

You API key

$region : string = "US"

US/EU

Tags
throws
InvalidArgumentException
Return values
void

enableAMLCheck()

Check document holder's name and document number against ID Analyzer AML Database for sanctions, crimes and PEPs.

public enableAMLCheck([bool $enabled = false ]) : void
Parameters
$enabled : bool = false

Enable or disable AML/PEP check

Return values
void

enableAMLStrictMatch()

By default, entities with identical name or document number will be considered a match even though their birthday or nationality may be unknown. Enable this parameter to reduce false-positives by only matching entities with exact same nationality and birthday.

public enableAMLStrictMatch([bool $enabled = false ]) : void
Parameters
$enabled : bool = false

Enable or disable AML strict match mode

Return values
void

enableAuthentication()

Validate the document to check whether the document is authentic and has not been tampered, and set authentication module

public enableAuthentication([bool $enabled = false ][, mixed $module = 2 ]) : void
Parameters
$enabled : bool = false

Enable or disable Document Authentication

$module : mixed = 2

Authentication Module: 1, 2 or quick

Tags
throws
InvalidArgumentException
Return values
void

enableBarcodeMode()

Disable Visual OCR and read data from AAMVA Barcodes only

public enableBarcodeMode([bool $enabled = false ]) : void
Parameters
$enabled : bool = false

Enable or disable Barcode Mode

Return values
void

enableDualsideCheck()

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.

public enableDualsideCheck([bool $enabled = false ]) : void
Parameters
$enabled : bool = false

Enable or disable dual-side information check

Return values
void

enableImageOutput()

Generate cropped image of document and/or face, and set output format [url, base64]

public enableImageOutput([bool $cropDocument = false ][, bool $cropFace = false ][, string $outputFormat = "url" ]) : void
Parameters
$cropDocument : bool = false

Enable or disable document cropping

$cropFace : bool = false

Enable or disable face cropping

$outputFormat : string = "url"

"url" or "base64", defaults to "url"

Tags
throws
InvalidArgumentException
Return values
void

enableVault()

Save document image and parsed information in your secured vault. You can list, search and update document entries in your vault through Vault API or web portal.

public enableVault([bool $enabled = true ][, bool $saveUnrecognized = false ][, bool $noDuplicateImage = false ][, bool $autoMergeDocument = false ]) : void
Parameters
$enabled : bool = true

Enable or disable Vault

$saveUnrecognized : bool = false

Save document image in your vault even if the document cannot be recognized

$noDuplicateImage : bool = false

Prevent duplicated images from being saved

$autoMergeDocument : bool = false

Automatically merge images with same document number into a single entry inside vault

Return values
void

generateContract()

Generate legal document using data from user uploaded ID

public generateContract(string $templateId[, string $format = "PDF" ][, mixed $prefillData = array() ]) : void
Parameters
$templateId : string

Contract Template ID displayed under web portal

$format : string = "PDF"

Output file format: PDF, DOCX or HTML

$prefillData : mixed = array()

Associative array or JSON string, to autofill dynamic fields in contract template.

Tags
throws
InvalidArgumentException
Return values
void

resetConfig()

Reset all API configurations except API key and region.

public resetConfig() : void
Return values
void

restrictCountry()

Check if the document was issued by specified countries, if not error code 10 will be thrown. Separate multiple values with comma. For example "US,CA" would accept documents from United States and Canada.

public restrictCountry([string $countryCodes = "US,CA,UK" ]) : void
Parameters
$countryCodes : string = "US,CA,UK"

ISO ALPHA-2 Country Code separated by comma

Return values
void

restrictState()

Check if the document was issued by specified state, if not error code 11 will be thrown. Separate multiple values with comma. For example "CA,TX" would accept documents from California and Texas.

public restrictState([string $states = "CA,TX" ]) : void
Parameters
$states : string = "CA,TX"

State full name or abbreviation separated by comma

Return values
void

restrictType()

Check if the document was one of the specified types, if not error code 12 will be thrown. For example, "PD" would accept both passport and drivers license.

public restrictType([string $documentType = "DIP" ]) : void
Parameters
$documentType : string = "DIP"

P: Passport, D: Driver's License, I: Identity Card

Return values
void

scan()

Scan an ID document with Core API, optionally specify document back image, face verification image, face verification video and video passcode

public scan(string $document_primary[, string $document_secondary = "" ][, string $biometric_photo = "" ][, string $biometric_video = "" ][, string $biometric_video_passcode = "" ]) : array<string|int, mixed>
Parameters
$document_primary : string

Front of Document (File path, base64 content or URL)

$document_secondary : string = ""

Back of Document (File path, base64 content or URL)

$biometric_photo : string = ""

Face Photo (File path, base64 content or URL)

$biometric_video : string = ""

Face Video (File path, base64 content or URL)

$biometric_video_passcode : string = ""

Face Video Passcode (4 Digit Number)

Tags
throws
InvalidArgumentException
throws
APIException
throws
Exception
Return values
array<string|int, mixed>

setAccuracy()

Set OCR Accuracy

public setAccuracy([int $accuracy = 2 ]) : void
Parameters
$accuracy : int = 2

0 = Fast, 1 = Balanced, 2 = Accurate

Return values
void

setAMLDatabase()

Specify the source databases to perform AML check, if left blank, all source databases will be checked. Separate each database code with comma, for example: un_sc,us_ofac. For full list of source databases and corresponding code visit AML API Overview.

public setAMLDatabase([string $databases = "au_dfat,ca_dfatd,ch_seco,eu_fsf,fr_tresor_gels_avoir,gb_hmt,ua_sfms,un_sc,us_ofac,eu_cor,eu_meps,global_politicians,interpol_red" ]) : void
Parameters
$databases : string = "au_dfat,ca_dfatd,ch_seco,eu_fsf,fr_tresor_gels_avoir,gb_hmt,ua_sfms,un_sc,us_ofac,eu_cor,eu_meps,global_politicians,interpol_red"

Database codes separated by comma

Return values
void

setBiometricThreshold()

Set the minimum confidence score to consider faces being identical

public setBiometricThreshold([float $threshold = 0.4 ]) : void
Parameters
$threshold : float = 0.4

float between 0 to 1, higher value yields more strict verification

Tags
throws
InvalidArgumentException
Return values
void

setOCRImageResize()

Scale down the uploaded image before sending to OCR engine. Adjust this value to fine tune recognition accuracy on large full-resolution images. Set 0 to disable image resizing.

public setOCRImageResize([int $maxScale = 2000 ]) : void
Parameters
$maxScale : int = 2000

0 or 500~4000

Tags
throws
InvalidArgumentException
Return values
void

setParameter()

Set an API parameter and its value, this function allows you to set any API parameter without using the built-in functions

public setParameter(string $parameterKey, string $parameterValue) : void
Parameters
$parameterKey : string

Parameter key

$parameterValue : string

Parameter value

Return values
void

setVaultData()

Add up to 5 custom strings that will be associated with the vault entry, this can be useful for filtering and searching entries.

public setVaultData([string $data1 = "" ][, string $data2 = "" ][, string $data3 = "" ][, string $data4 = "" ][, string $data5 = "" ]) : void
Parameters
$data1 : string = ""

Custom data field 1

$data2 : string = ""

Custom data field 2

$data3 : string = ""

Custom data field 3

$data4 : string = ""

Custom data field 4

$data5 : string = ""

Custom data field 5

Return values
void

throwAPIException()

Whether an exception should be thrown if API response contains an error message

public throwAPIException([bool $throwException = false ]) : void
Parameters
$throwException : bool = false

Throw exception upon API error, defaults to false

Return values
void

verifyAddress()

Check if supplied address matches with document.

public verifyAddress([string $address = "123 Sample St, California, US" ]) : void
Parameters
$address : string = "123 Sample St, California, US"

Address requiring validation

Return values
void

verifyAge()

Check if the document holder is aged between the given range.

public verifyAge([string $ageRange = "18-99" ]) : void
Parameters
$ageRange : string = "18-99"

Age range, example: 18-40

Tags
throws
InvalidArgumentException
Return values
void

verifyDOB()

Check if supplied date of birth matches with document.

public verifyDOB([string $dob = "1990/01/01" ]) : void
Parameters
$dob : string = "1990/01/01"

Date of birth in YYYY/MM/DD

Tags
throws
InvalidArgumentException
Return values
void

verifyDocumentNumber()

Check if supplied document or personal number matches with document.

public verifyDocumentNumber([string $documentNumber = "X1234567" ]) : void
Parameters
$documentNumber : string = "X1234567"

Document or personal number requiring validation

Return values
void

verifyExpiry()

Check if the document is still valid based on its expiry date.

public verifyExpiry([bool $enabled = false ]) : void
Parameters
$enabled : bool = false

Enable or disable expiry check

Return values
void

verifyName()

Check if supplied name matches with document.

public verifyName([string $fullName = "ELON MUSK" ]) : void
Parameters
$fullName : string = "ELON MUSK"

Full name requiring validation

Return values
void

verifyPostcode()

Check if supplied postcode matches with document.

public verifyPostcode([string $postcode = "90001" ]) : void
Parameters
$postcode : string = "90001"

Postcode requiring validation

Return values
void

Search results