This topic describes how to call the CheckResult API operation to query the authentication result of the document OCR solution.
Description
API operation: CheckResult
Request method: HTTPS POST
Description: After you receive a callback notification, call this API operation on the server to retrieve the authentication result.
ImportantID Verification service results are stored for 30 days by default and then automatically deleted. You must query the authentication results within 30 days after the authentication process is complete.
QPS limit: The API has a dedicated queries per second (QPS) limit. For more information, see QPS limits for ID Verification server-side API operations.
Endpoints:
NoteThe internal network is used for communication between Alibaba Cloud products in the same region. If your server is deployed in an Alibaba Cloud region, you can use the internal endpoint to access the ID Verification service. This provides more secure and stable network communication.
China (Hong Kong)
Internet:
cloudauth-intl.cn-hongkong.aliyuncs.comInternal:
cloudauth-intl-vpc.cn-hongkong.aliyuncs.com
Debug and integrate online
Before you start debugging and integration, ensure that you read the Use OpenAPI Explorer to debug and integrate server-side APIs document to understand how to call APIs in OpenAPI Explorer and obtain SDKs and their code.
You can use OpenAPI Explorer to debug this API operation directly and generate SDK code examples.
Request parameters
Name | Type | Required | Description | Example |
MerchantBizId | String | Yes | A custom unique business identifier that you can use to track and troubleshoot issues. It can be a combination of letters and digits up to 32 characters long. Make sure that it is unique. Note Alibaba Cloud servers do not check the uniqueness of this field. For better tracking, make sure this field is unique. | e0c34a77f5ac40a5aa5e6ed20c35**** |
TransactionId | String | Yes | The unique identifier for the entire authentication flow. You must obtain this value by calling the Initialize API operation. Important To avoid tampering threats, you must use the TransactionId stored on your server from the Initialize API operation call. We do not recommend using the TransactionId from the client-side callback. | hksb7ba1b28130d24e015d6******** |
IsReturnImage | String | No | Specifies whether to return the authentication image materials:
| Y |
Response parameters
Name | 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 | The response code. | Success | |
Message | String | A detailed description of the response code. | success | |
Result.Passed | String | The final authentication result. Valid values:
| Y | |
Result.SubCode | String | A description of the authentication result. For more information, see | 200 | |
Result.ExtIdInfo | String | Information about the document OCR result. For the JSON format, see the example on the right. For more information, see ExtIdInfo. | | |
ExtIdInfo
Name | Type | Description | Example |
ocrIdPassed | String | The final result of the document OCR stage:
| N |
idImage | String | The document OCR photo in Base64 format. This field is returned if you set the IsReturnImage parameter to Y in the request and the document OCR process completes successfully. | base64 |
ocrIdInfo | String | The document OCR field information. For more information, see OCR recognition response fields. Note If the document OCR process fails, this field is empty. | |
spoofInfo | String | The document anti-spoofing detection result, which includes the risk assessment result and risk type: Note Card detection is enabled only when IdSpoof = Y in the Initialize API operation. Otherwise, spoofResult returns N by default and spoofType is empty.
| |
ocrIdEditInfo | String | The document OCR field information submitted by the user after editing on the OCR result page. This is returned when the client is configured to enable the OCR result editing page (ShowOcrResult). | |
idBackImage | String | The OCR photo of the back of the document, in Base64 format. Note This field is returned if you set the isReturnImage = Y parameter in the request and the document OCR process completes successfully. | base64 |
ocrIdBackInfo | String | The OCR field information from the back of the document. Important If the document OCR process fails, this field is empty. | |
spoofBackInfo | String | The document anti-spoofing detection result, which includes the risk assessment result and risk type: Note Card detection is enabled only when IdSpoof = Y in the Initialize API operation. Otherwise, spoofResult returns N by default and spoofType is empty.
Note This is an algorithm prediction result. This field might not be returned. Avoid setting a necessary dependency on it for your business. | |
Return code
HTTP status code | Code | Message description |
200 | Success | Request successful. |
400 | MissingParameter | Parameter cannot be empty. |
InvalidParameter | Invalid parameter. | |
TransactionIdInvalid | Invalid Transaction ID. | |
403 | Forbidden.RAMUserAccessDenied | You need to grant the RAM user the AliyunAntCloudAuthFullAccess permission. For more information, see Authorize RAM users to access the service. |
Forbidden.AccountAccessDenied | Ensure that you have activated ID verification and your account has no overdue payment. | |
Throttling.Api | API request is blocked due to throttling. | |
404 | ProcessNotCompleted | The entire authentication process is not completed. |
500 | InternalError | Internal system error. Provide feedback to engineers for troubleshooting. |
ResultObject.SubCode error codes
Subcode is returned based on different product solutions or integration methods. For details, refer to the following table.
Applicable solution | Error code | Is authentication record billed | Description and suggested reasons |
General | 200 | Yes | Authentication passed. |
| 211 | Yes | The quality or resolution of the certificate image does not meet requirements, or the image itself is incomplete. Ensure the photo of the certificate's portrait side is clear, has normal exposure, is complete without occlusion, and has no significant angle deviation. |
| 212 | Yes | Certificate anti-counterfeiting detection indicates risk. There may be high-risk operations such as rephotographing, tampering, or photocopying. |
| 213 | Yes | The specified certificate type was not detected (recognition mode) or the certificate type could not be identified (classification mode). We recommend uploading a clear, complete certificate image with normal angle. |
Field returned by document recognition
Hong Kong (China) Identity Card
Both the 2003 and 2018 versions of smart identity cards are supported.
Field | Type | Description |
name | String | The name. |
englishName | String | The name in English. |
nameCode | String | The Chinese name code. |
sex | String | The gender. Valid values:
|
birthDate | String | The date of birth. |
idNumber | String | The ID card number. |
currentIssueDate | String | The date of registration. |
firstIssueDate | String | The month and year of first registration. |
isPermanent | String | Indicates whether the identity card is a permanent resident identity card. Valid values:
|
symbols | String | The remarks. Example: "***AZ". |
Exit-Entry Permit for Traveling to and from Hong Kong and Macao
Field | Type | Description |
name | String | The name. |
englishName | String | The romanized name. |
sex | String | The gender. |
birthDate | String | The date of birth. |
idNumber | String | The ID card number. |
issueDate | String | The issuance date. |
expiryDate | String | The expiration date. |
placeOfIssue | String | The issuance place. |
originOfIssue | String | The issuance authority. |
Mainland Travel Permit for Hong Kong and Macao Residents
Field | Type | Description |
name | String | The name. |
englishName | String | The romanized name. |
sex | String | The gender. |
birthDate | String | The date of birth. |
idNumber | String | The ID card number. |
issueDate | String | The issuance date. |
expiryDate | String | The expiration date. |
originOfIssue | String | The issuance authority. |
Mainland Travel Permit for Taiwan Residents
Field | Type | Description |
name | String | The name. |
englishName | String | The romanized name. |
sex | String | The gender. |
birthDate | String | The date of birth. |
idNumber | String | The ID card number. |
issueDate | String | The issuance date. |
expiryDate | String | The expiration date. |
originOfIssue | String | The issuance authority. |
placeOfIssue | String | The issuance place. |
Global passport
Field | Type | Description |
surname | String | The surname. |
givenname | String | The given name. |
sex | String | The gender. |
birthDate | String | The date of birth. |
passportNo | String | The passport number. |
nationality | String | The nationality. |
expiryDate | String | The expiration date. |
countryCode | String | The country code. |
Macao (China) Resident Identity Card
Field | Type | Description |
surnameCN | String | The surname in Chinese. |
givennameCN | String | The given name in Chinese. |
surname | String | The surname in English. |
givenname | String | The given name in English. |
sex | String | The gender. |
birthDate | String | The date of birth. |
idNumber | String | The ID card number. |
expiryDate | String | The expiration date. |
placeOfBirth | String | The code of the birthplace. Example: "AS". |
People's Republic of China Resident Identity Card
Field | Type | Description |
name | String | The name. |
sex | String | The gender. |
ethnicity | String | The ethnicity. |
birthDate | String | The date of birth. |
idNumber | String | The ID card number. |
address | String | The address. |
province | String | The province of residence. Note This is a reserved field and is empty by default. |
city | String | The city of residence. Note This is a reserved field and is empty by default. |
originOfIssue | String | The issuance authority. |
issueDate | String | The issuance date. |
expiryDate | String | The expiration date. |