ID Verification supports face retrieval. You can create face groups and add face images in the ID Verification console or by calling this API.
API information
API name: AddFaceRecord
Request method: POST
Transport protocol: HTTPS
QPS limit: The request rate for a single tenant is limited to 50 QPS.
Endpoints:
NoteDifferent ID Verification solutions support different regions, and data is isolated between them. To access your data, you must use the API domain name for the region where your data is stored.
Singapore
Public endpoint:
cloudauth-intl.ap-southeast-1.aliyuncs.comInternal endpoint:
cloudauth-intl-vpc.ap-southeast-1.aliyuncs.com
Indonesia (Jakarta)
Public endpoint:
cloudauth-intl.ap-southeast-5.aliyuncs.comInternal endpoint:
cloudauth-intl-vpc.ap-southeast-5.aliyuncs.com
China (Hong Kong)
Public endpoint:
cloudauth-intl.cn-hongkong.aliyuncs.comInternal endpoint:
cloudauth-intl-vpc.cn-hongkong.aliyuncs.com
Malaysia (Kuala Lumpur)
Public network:
cloudauth-intl.ap-southeast-3.aliyuncs.comInternal network:
cloudauth-intl-vpc.ap-southeast-3.aliyuncs.com
Online debugging and integration
Before you debug or integrate, read the Use OpenAPI to debug and integrate server-side APIs guide to understand how to call APIs on the OpenAPI platform and how to obtain the SDK.
You can use OpenAPI Explorer to directly run and debug this API, and generate an SDK code example.
Image upload requirements
Image format: JPG, JPEG.
Image size: 50 KB to 100 KB is recommended. The maximum file size is 10 MB. Upload images larger than 1 MB by using a URL or file stream.
Image resolution: A resolution of 640×480 pixels (height × width) is recommended. The maximum resolution is 1920×1080 pixels. The image height must be greater than its width. For best results, scale the shorter side to 720 pixels and use a compression ratio of 0.8.
Image quality: The image must be clear and have proper exposure. The face must not be too dark, too bright, or have halos.
Face detection: If an image contains multiple faces, the system detects the largest face by default.
Request parameters
To upload a face image, use one of the following parameters: FacePicture, FacePictureUrl, or FacePictureFileObject.
Parameter | Type | Description | Required | Example |
ProductCode | string | The product code. This is a static field. Value: FACE_ENROLL | Yes | FACE_ENROLL |
FaceGroupCode | string | The code of the face group. | Yes | sgl****7uc |
MerchantUserId | string | A custom, unique user ID, up to 32 characters in length.
| No | 130A2C10B9EE4D8488E35384FF03hst |
FacePicture | string | The Base64-encoded string of the face image. | No | base64 |
FacePictureUrl | string | The URL of the face image. | No | https://example.com/test.jpg |
FacePictureFileObject | InputStream | The local file stream of the face image. To upload an image this way, you must call the Advance API and pass a valid InputStream object. For more information, see Special scenario: Configure the Advance API for file uploads. | No | The InputStream object of the image |
FaceQualityCheck | string | Specifies whether to check the quality of the face image.
Note Reserved feature. Not currently supported. | No | N |
Response parameters
Parameter | Type | Description | Example | |
HTTP status code | integer | The HTTP status code. | 200 | |
HTTP Body | RequestId | string | The request ID. | 130A2C10-B9EE-4D84-88E3-5384FF03**** |
Code | string | Success | ||
Message | string | A description of the return code. | The request was successful. | |
Result.Passed | string | The registration result.
| Y | |
Result.ExtFaceInfo | string | Details about the registration result in JSON format. See the example. For more information, see ExtFaceInfo. | | |
ExtFaceInfo
Parameter | Type | Description | Example |
faceQuality | string | The image quality.
| HIGH |
Return codes
HTTP status code | Code | Description |
200 | Success | The request was successful. |
400 | MissingParameter | A required parameter is missing. |
InvalidParameter | The specified parameter is invalid. | |
403 | Forbidden.RAMUserAccessDenied | The RAM user lacks the required permissions. Grant the AliyunAntCloudAuthFullAccess permission to this user. For more information, see Grant permissions to a RAM user. |
Forbidden.AccountAccessDenied | Access to the account is denied. Ensure that ID Verification is activated and that your account has no overdue payments. | |
Throttling.Api | The API call was throttled. | |
500 | InternalError | An internal system error occurred. Contact technical support for assistance. |
503 | ServiceUnavailable | The service is unavailable. Contact technical support for assistance. |