IMPORTANT
- Before using this service, please note the following:
- First, you need to integrate our liveness SDK in your mobile app (Please contact operations to get this SDK)
- Our SDK will get the face photo of the person using your app
For each face photo of your user, a “livenessId” will be assigned, which you may use to query the face photo through this API.
Request URL
https://api.advance.ai/openapi/liveness/v3/detection-result
POST (application/json)
Code Sample:
curl -X POST \
-H "X-ACCESS-TOKEN: {Your Access Token}" \
-H "Content-Type: application/json" \
-d '{"livenessId": "ddsd-9e6-dcc9-4ca1-bdfe-9f001c05f1b1","resultType": "IMAGE_URL"}' \
"https://api.advance.ai/openapi/liveness/v3/detection-result"
Request Header Parameters:
| Parameter | Description |
| X-ACCESS-TOKEN | [string] Please Click here to get your access token |
Request Parameters:
| Parameter | Description |
| livenessId | [string] an identifier for your user’s face photo from the SDK |
|
resultType |
[string] [optional] the preferred format for the liveness image, [IMAGE_URL] or [IMAGE_BASE64]. The default will be [IMAGE_URL] |
Notes:
[IMAGE_URL]: Returns a URL where the customer’s face image can be downloaded, the url will remain valid for only 24 hours.The availability of images in the format of image_url should be impacted and expected slow response when the public network’s situation is not in a good condition.
[IMAGE_BASE64]: Returns the base64 string of the image
Response Description:
| Parameter | Description |
| code | Liveness Detection Status Code |
|
transactionId |
The request id, the max length is 64 |
|
pricingStrategy |
Whether the request will be charged, enum type: [FREE], [PAY] |
|
message |
Status Code Explanation |
|
data |
detectionResult : [string] The image URL or the image base64
livenessScore: [double] The score for anti-spoofing, ranging from [0,100], less than 50 means it might be an attack. Please refer to the Note below of given suggestions based on different liveness scores. auditImageUrl : [string] The audit image link imageFarUrl: [string] Photo taken by user in far stage imageNearUrl: [string] Photo taken by user in near stage farImageTime: [long] Timestamp of the imageFar nearImageTime: [long] Timestamp of the imageNear attackType: [int] Return attacktype when livenessScore=0 attackSubType: Currently return [null], will return more details in the future |
|
extra |
Extra response info (Exception Message) |
Notes:
- If the user’s liveness score is more than 50, that is regarded as normal behavior, and the suggestion is pass.
- If the user’s liveness score is less than 50, that is regarded as abnormal behavior, and the suggestion is manual check.
Notes:
imageFarUrl : Returns a URL where the customer’s face far view image can be downloaded, the url will remain valid for only 24 hours.The availability of images in the format of image_url should be impacted and expected slow response when the public network’s situation is not in a good condition.
imageNearUrl : Returns a URL where the customer’s face near near image can be downloaded, the url will remain valid for only 24 hours.The availability of images in the format of image_url should be impacted and expected slow response when the public network’s situation is not in a good condition.
auditImageUrl : Will return audit image in a link, format is zip, need to be configured in SDK first, otherwise it will be null the url will remain valid for only 24 hours.The availability of images in the format of auditImageUrl should be impacted and expected slow response when the public network’s situation is not in a good condition.
Response Code:
| Status Code | Message |
| LIVENESS_ID_NOT_EXISTED | [FREE] Liveness Id does not exist |
| RESULT_NOT_FOUND | [FREE] The requested resource was not found or has been deleted |
|
PARAMETER_ERROR |
[FREE] Parameter error, please check your request whether has illegal parameters |
Note: Please remember to add a handler for the Status Codes in the Glossary as well
More detail can refer to the Liveness Detection API Doc
https://doc.advance.ai/liveness_detection.html#liveness-detection
Comments
0 comments