Access Documentation
SDK
FinAuth Lite
compare
compare
# Compare
# Version
5.0.0
# Description
This interface is used to upload customer image data and obtain the 1:1 face comparing results.
# Request URL
Singapore: POST https://api-sgp.yljz.com/finauth/v5/compare
Indonesia: POST https://api-idn.yljz.com/finauth/v5/compare
Note : In a production environment, please use HTTPS communication method. HTTP communication is an unsafe link and involves security risks. Please do not use it in a production environment. If you use HTTP in a production environment, service reliability cannot be guaranteed.
# Permission
Only when the user accesses the FinAuth product can the FinAuth Web APIs be called. Please consult FinAuth business personnel for the process of accessing FinAuth.
# Parameters
| Optional/mandatory | Parameter name | Parameter type | Parameter description | ||
| Mandatory | sign | String | Customer's signature for invoking this API. Please refer to the "Authentication Guide" document for the specific method of generating the signature. | ||
| Mandatory | sign_version | String | Please pass the signature algorithm version number as "hmac_sha1" | ||
| Optional | biz_no | String | "Default is empty". Customer's business serial number, recommended to be set as a unique serial string related to your business. It will be returned to your server as is during the 'return' process, helping you confirm the ownership of the corresponding business. This field should not exceed 128 bytes. | ||
| Mandatory | compare_id | String | Compare Scene ID: The configuration related to this verification request can be set in the "Console Compare Scene", and the generated ID number will be used in the interface | ||
| Mandatory | encryption_type | String |
Whether to enable data encryption during transmission: |
||
| Mandatory | image | File | Verify by uploading your own photo | ||
| Mandatory | image_ref1 | File | The reference face photo provided by the application. If no face is found in image_ref1, error code 400 (NO_FACE_FOUND) will be returned; If there are multiple faces in the image, the largest face will be selected for comparison | ||
| Optional | uuid | String | It is used to mark the unique ID of the user corresponding to this recognition, with a length not exceeding 128 bytes. Continuously using the same ID for the same user facilitates result tracing and data report optimization. | ||
# Return Values
| Parameter category | Parameters | Type | Remarks | |||||
| #Basic return information | request_id | String | Unique character string used to distinguish each request. | |||||
| biz_no | String | The business serial number passed in will be returned as is. | ||||||
| time_used | Int | Time spent for the whole request (unit: millisecond). This field must be returned. | ||||||
| error | String | This character string will be returned only in case of failed request. Detailed return is included in the following error section. Otherwise, this field does not exist. | ||||||
| #code | result_code | Int |
Indicate the status code of the result of this verification. Specific results and reasons can be obtained by combining with the fields "result_code" and "result_message":
|
|||||
| #Status code description | result_message | String | The specific reason can be known through this field information. For details, please refer to the comparison table of result_code & result_message. | |||||
| #Comparison results | verification | Json |
|
|||||
| #Additional return information | images | Json |
A list of images: corresponding image fields will be added based on the collected images in the future.
|
|||||
| video_key | String | Decryption key: used to obtain videos and images saved on the SDK (not a mandatory return field, with permission required). | ||||||
| visual_attributes | Json |
Additional Attributes:
|
||||||
| verify_risk_info | Json |
Comparison risk warning results: "verify_info_tags":Json type;indicates the risk type of image comparison
|
||||||
| face | Json |
When using the "rawimage" method, the attributes of the verification image are returned, including:
|
Example of correct request for return
{
"request_id":"1531397565,39b19451-393c-4fc4-8fae-6dc74b2b00d7",
"biz_no":"",
"time_used":1448,
"result_code":1000,
"result_message":"SUCCESS",
"verification":{
"ref1":{
"confidence":86.63057,
"thresholds":{
"1e-3":62.168713,
"1e-4":69.31534
"1e-5":74.39926,
"1e-6":78.038055
}
}
},
"face":{
"quality":38.221,
"quality_threshold":30.1,
"rect":{
"left":0.18,
"top":0.18,
"width":0.596,
"height":0.596
},
"orientation":90
},
"visual_attributes":{
"age":20,
"gender":0,
"age_image_ref1":38,
"gender_image_ref":0,
},
"verify_risk_info":{
"verify_info_tags":{
"is_gender_risk":0,
"is_age_risk":1,
}
}
}
Example of wrong request
{
"error": "AUTHORIZATION_ERROR: INVALID_SIGN"
}
# Comparison table of result_code & result_message
| result_code | result_message | Explanation of meaning | Whether to charge |
|---|---|---|---|
| 1000 | SUCCESS | The person in the image to be compared is the same person as in the other images. | yes |
| 2000 | PASS_LIVING_NOT_THE_SAME | The person in the image to be compared was not the same person as in at least one of the other images after verification. | yes |
# Error Message
| Status Code | Error Message | Description |
|---|---|---|
| 400 | MISSING_ARGUMENTS:<key> | One mandatory parameter is missing. |
| 400 | IMAGE_ERROR_UNSUPPORTED_FORMAT:<param> | Corresponding image of <param> cannot be analyzed, It may not be an image file or relevant data is damaged. <param>may be image_ref1 or image. Attention: There will only be one item for <param>, which is the first name that meets the condition. |
| 400 | NO_FACE_FOUND:<param> | Indicate that no face was found in the uploaded images of "image_ref" and "image". |
| 400 | INVALID_IMAGE_SIZE:<param> | The uploaded image is too large, that is, the length or width of the pixel size exceeds 4096 pixels. <param> may be image_ref1 or image. Attention: There will only be one item for <param>, which is the first name that meets the condition. |
| 400 | LOW_QUALITY | The image quality is too low. |
| 400 | MULTIPLE_FACES | There are multiple faces in the image. |
| 400 | KEY_NOT_FOUND | encryption_type is enabled for encryption, but encryption public key and decryption private key are not configured. |
| 403 | AUTHENTICATION_ERROR | Invalid signature. |
| 403 | AUTHORIZATION_ERROR:<reason> |
The API key has been deactivated, the call limit has been exceeded, there is no permission to access this API, or there is no permission to access this API in the current manner. Possible values for <reason>:
|
| 403 | CONCURRENCY_LIMIT_EXCEEDED | The concurrent number of requests has exceeded the limit. |
| 404 | API_NOT_FOUND | The API called does not exist. |
| 413 | Request Entity Too Large | The request sent by the customer exceeds the 10MB limit. The return for this error will be plain text, not in "json" format. |
| 500 | INTERNAL_ERROR | Internal server error. Please retry your request when such errors occur. If you continue to experience this issue, please contact FinAuth customer support or your business representative for assistance. |
