Liveness Verify

1. Implement eKYC using user portraits at 3 angles

API:

MethodURLcontent-type
POSThttps://cloud.computervision.com.vn/api/v2/ekyc/verify_livenessmultipart/form-data

Body:

KeyTypeValueDescription
portrait_leftfileexample_1.jpgThe user's left image file
portrait_midfileexample_2.jpgFile image of the user's front face
portrait_rightfileexample_3.jpgThe user's right image file
{
"portrait_right": "iVBORw0KGgoAAAANSU...",
"portrait_mid": "iVBORw0KGgoAAAANSU...",
"portrait_left": "iVBORw0KGgoAAAANSU..."
} // In the case of ?format_type=base64, the POST method.

Demo Python:

import requests
api_key = "YOUR_API_KEY"
api_secret = "YOUR_API_SECRET"
img1_path = '/path/to/your/example_1.jpg'
img2_path = '/path/to/your/example_2.jpg'
img3_path = '/path/to/your/example_3.jpg'
response = requests.post(
"https://cloud.computervision.com.vn/api/v2/ekyc/verify_liveness",
auth=(api_key, api_secret),
files={ 'portrait_left': open(img1_path, 'rb'),
'portrait_mid': open(img2_path, 'rb'),
'portrait_right': open(img3_path, 'rb')
})
print(response.json())

2. Response

The response will be a JSON with the following format:

{
"data": {
"invalidCode": string,
"invalidMessage": string,
"matching_mid_left": string,
"matching_mid_right": string,
"valid": string // (True/False)
},
"errorCode": string,
"errorMessage": string
}

Error code table:

CodeMessage
0Success
1The photo does not contain content
2Url is unavailable
3Incorrect image format
4Out of requests
5Incorrect api_key or api_secret
6Incorrect format type

Warning error code table:

CodeMessage
0Successful
1The mid image does not contain face
2The left image does not contain face
3The right image does not contain face
4The mid image and the left image do not match
5The mid image and the right image do not match
6Invalid center image
7Invalid left image
8Invalid right image