ID Verification product integration includes client-side and server-side components. You can debug server-side APIs online through the Alibaba Cloud OpenAPI platform and obtain integration sample code. This topic describes the detailed steps for using the Alibaba Cloud OpenAPI platform to debug online and obtain sample code for integrating server-side APIs.
Prerequisites
You have read the Activate ID Verification document and activated the ID Verification service.
Server-side API endpoints
Different API services may provide different endpoints. Please refer to the corresponding API documentation for accurate information.
China (Hong Kong):
cloudauth-intl.cn-hongkong.aliyuncs.comSingapore:
cloudauth-intl.ap-southeast-1.aliyuncs.com
Integration methods
Alibaba Cloud provides SDKs for common programming languages. We recommend that you use these SDKs to call APIs directly without having to manage the underlying technical details.
If the existing SDKs cannot meet your requirements, you can construct your own signatures and use native HTTPS calls. However, due to the complexity of custom signature generation, this will require significant additional work. Please evaluate this option based on your business needs.
Call method | Notes |
Alibaba Cloud SDK | For specific programming languages supported by ID Verification SDKs, SDK versions, and installation methods, see ID Verification SDK Center. |
Online debugging and sample code
You can directly access the Call Results or SDK Examples page for the corresponding API through the Online Debugging And Integration section in the API documentation.

Number | Step description |
1 | Go to the ID Verification OpenAPI portal and log in to your Alibaba Cloud account. |
2 | Select or search for the API that you want to debug. If you enter through the API documentation entry, you will be directed to the corresponding API page. |
3 | Select an available endpoint. The selected endpoint will be displayed in the code on the right. Note Different API services may provide different endpoints. Please refer to the corresponding API documentation for accurate information. |
4 | Enter the debugging parameters. Parameter fields with values will be displayed in the code on the right. To call the API online to view the returned data, you can click Initiate Call in the lower right corner of the parameter area to call the API in real time. The right tab will automatically switch to the Call Results page. Note Fees may be incurred for paid APIs. |
5 | At the top of the right area of the page, click SDK Examples. |
6 | Select the SDK version and programming language as needed. Note We recommend that you select SDK version |
7 | The code will change in real time when you change the endpoint, API parameters, SDK version, or programming language. In the upper left corner of the code area:
In the upper right corner of the code area:
|
In your code, reuse the Client class provided by the Alibaba Cloud SDK. Do not create a new instance for each request because this can cause performance issues.
Obtaining access credentials
Access credentials are used to verify your identity. When you call ID Verification APIs from your local code, you must provide the correct access credentials to authenticate your identity. The following are common types of access credentials:
AccessKey: An AccessKey is a permanent access credential provided by Alibaba Cloud to Alibaba Cloud accounts and RAM users. It consists of an AccessKey ID and an AccessKey secret. For more information, see Create an AccessKey.
STS Token: A Security Token Service token (STS token) is a temporary access credential provided by Alibaba Cloud to RAM roles. You can customize the validity period and access permissions. For more information, see What is STS.
If you use a RAM user or RAM role to call ID Verification APIs, contact your system administrator after you create the user or role to grant the required permissions:
Access policy name | Notes |
AliyunAntCloudAuthFullAccess | Permission to call ID Verification-KYC services. |
If your access credentials are leaked, they can pose a significant security risk to your business. For information about how to securely configure and use access credentials, refer to the following solutions:
Credential type | Solution name | Scenarios |
AccessKey | Configure environment variables in Linux, macOS, and Windows systems | Access Alibaba Cloud OpenAPI by configuring system environment variables. |
STS Token | If your applications are deployed in a Container Service for Kubernetes (ACK) cluster, you can enable the RAM Roles for Service Accounts (RRSA) feature for the ACK cluster. This way, each application that is deployed in the ACK cluster can assume a different RAM role to call API operations of Alibaba Cloud. |
For more information, see Best practices for using access credentials to access Alibaba Cloud OpenAPI.
Exceptions and FAQ
If you encounter issues during integration and debugging, you can refer to the following table for troubleshooting:
SDK language | How to catch exceptions | Common issues and solutions |
Java | ||
Python | ||
PHP | ||
TypeScript | ||
.NET | ||
Go |
SDK integration: FAQ and best practices
How do I handle high latency when calling server-side APIs?
If you experience high latency when calling ID Verification server-side APIs, you can refer to the following method for troubleshooting and optimization: Server-side network latency analysis and optimization.
How do I create custom HTTPS requests if the SDK does not meet my needs?
If the existing SDKs do not meet your business needs and you want to create custom HTTPS requests, see Request structure and signature mechanism.