This topic describes how to use the Initialize operation to initiate an authentication request.
Initiate an authentication request
Operation: Initialize
Request method: HTTPS POST
Description: Before each authentication process, call this operation to obtain a transactionId and a transactionUrl. Use these to link all operations in the authentication request.
This API is subject to an exclusive queries per second (QPS) limit. For more information, see ID Verification server-side API QPS limits.
Endpoints:
NoteAn internal network is a private communication network for Alibaba Cloud products within the same region. If your application server is deployed in an Alibaba Cloud region, you can use the VPC endpoint to access the ID Verification service for a more secure and stable network connection.
China (Hong Kong)
Public endpoint:
cloudauth-intl.cn-hongkong.aliyuncs.comVPC endpoint:
cloudauth-intl-vpc.cn-hongkong.aliyuncs.com
Online debugging and integration
Before you debug and integrate, read Use OpenAPI Explorer to debug and integrate server-side API operations. This document explains how to call API operations on the OpenAPI platform and how to obtain the SDK and its sample code.
You can call this operation in OpenAPI Explorer to test it and generate the SDK code examples.
Request parameters
Name | Type | Required | Description | Example |
ProductCode | String | Yes | The product solution to use. The only valid value is FACE_LIVENESS. | FACE_LIVENESS |
MerchantBizId | String | Yes | A unique business ID that you define. Use this ID to track and troubleshoot issues. The ID can be up to 32 characters long and can contain letters and digits. Make sure that the ID is unique. Note Alibaba Cloud servers do not check the uniqueness of this value. For better tracking, ensure that this ID is unique. | e0c34a77f5ac40a5aa5e6ed20c35**** |
MetaInfo | String | Yes | The MetaInfo environment parameter. In a real environment, you need to obtain it by calling the getMetaInfo() function via a JS file. Refer to the client integration document for the corresponding platform to obtain the MetaInfo. Important
| |
MerchantUserId | String | Yes | A user ID that you define, or another identifier for a specific user, such as a mobile number or email address. We strongly recommend that you desensitize this value in advance, for example, by hashing the value. | 123456789 |
ReturnUrl | String | No | The target URL to which the user is redirected. Important This parameter is optional only when you use an iframe for encapsulation. | https://www.alibabacloud.com |
SceneCode | String | No | A custom authentication scenario ID. You can use this ID to query related records in the console. The ID can be up to 10 characters long and can contain letters, digits, or underscores (_). | 1234567890 |
LanguageConfig | String | No | The custom language configurations. Convert the language configurations that you want to add to a JSON string based on the configuration template. Then, specify this parameter to add the custom language configurations. For more information, see Internationalization language and custom text support. | |
SecurityLevel | String | No | The mode representing different security levels of the authentication process. Valid values:
| 02 |
StyleConfig | String | No | The custom UI configurations. Convert the UI configurations that you want to add to a JSON string based on the configuration template. Then, specify this parameter to add the custom UI configurations. For more information, see IDV UI style customization. | |
Model | String | No | The type of liveness detection to perform:
Note For supported SDK versions, see SDK release notes. | PHOTINUS_LIVENESS |
DocVideo | String | No | Specifies whether to save a verification video.
Note Because video files are large, the system may discard the video file if the network is unstable to prioritize the transmission of essential authentication images. | N |
ShowGuidePage | String | No | Specifies whether to show the guide page: Note This switch is not supported on PC.
| 1 |
ProcedurePriority | String | No | Specifies whether to allow a fallback method when a compatibility issue occurs during mobile H5 authentication.
Note
| url |
CallbackUrl | String | No | The webhook address for authentication results. The callback request method is GET by default. The webhook address must start with
Warning
| https://www.aliyun.com?callbackToken=100000****&transactionId=shaxxxx&passed=Y&subCode=200 |
CallbackToken | String | No | A security token that you generate. It is used for anti-replay and tamper-proofing checks. If you set this value, the CallbackToken field is included in the CallbackUrl webhook. | NMjvQanQgplBSaEI0sL******** |
AppQualityCheck | String | No | Specifies whether to enable strict face quality check: Important This feature is not supported by the Web SDK.
| Y |
Return Data
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 | Success | ||
Message | String | A detailed description of the response code. | success | |
Result.TransactionId | String | The unique identifier for the entire authentication process. This field is used for billing statistics and for initiating CheckResult API operation requests. Important
| hksb7ba1b28130d24e015d6******** | |
Result.TransactionUrl | String | The web authentication URL. After authentication, the user is redirected based on the ReturnUrl input parameter. Important
| https://www.alibabacloud.com/index.html?clientcfg=**** | |
Result.Protocol | String | Standard encrypted authentication protocol. Note This field is required when you integrate H5 web pages using the iframe embedding integration mode. | hksb7ba1b28130d24e015d********* | |
Response codes
HTTP status code | Code | Message |
200 | Success | Request successful. |
400 | MissingParameter | Parameter cannot be empty. |
InvalidParameter | Invalid parameter. | |
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. | |
500 | InternalError | Internal system error. Provide feedback to engineers for troubleshooting. |