tencent cloud

文字识别

ApplyCardVerificationExternal

下载
聚焦模式
字号
最后更新时间: 2026-09-07 16:30:04

1. API Description

Domain name for API request: ocr.intl.tencentcloudapi.com.

This API provides general OCR recognition for overseas identity documents.

A maximum of 20 requests can be initiated per second for this API.

We recommend you to use API Explorer
Try it
API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters

The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

Parameter Name Required Type Description
Action Yes String Common Params. The value used for this API: ApplyCardVerificationExternal.
Version Yes String Common Params. The value used for this API: 2018-11-19.
Region Yes String Common Params. For more information, please see the list of regions supported by the product. This API only supports: ap-singapore.
Nationality Yes String Country/Region of the document. For the full list of supported countries/regions, refer to the API description.
CardType Yes String Document type. Supported values: ID_CARD, PASSPORT, DRIVING_LICENSE, RESIDENCE_PERMIT (only supported in certain countries/regions, including Australia, Canada, Germany, New Zealand, Nigeria, Singapore).
ImageBase64Front No String Base64-encoded image of the document front.
Supported image formats: PNG, JPG/JPEG (GIF not supported).
Supported image size: The downloaded image after Base64 encoding must not exceed 2 MB. Image download time must not exceed 5 seconds.
Supported image resolution: Between 256256 and 40964096 pixels.
Note: You must provide either ImageUrlFront or ImageBase64Front. If both are provided, only ImageUrlFront is used.
ImageBase64Back No String The Base64 value of the reverse side of the document. Supported image formats: PNG, JPG/JPEG.
Supported image size: the downloaded image after Base64 encoding must be no more than 2M. Image download time must be no more than 5 seconds.
Supported image resolution: between 256 * 256 and 4096 * 4096. For some documents, either ImageUrlBack or ImageBase64Back must be provided. If both are provided, only ImageUrlBack is used.
ImageUrlFront No String URL of the document front image.
Supported image formats: PNG, JPG/JPEG (GIF not supported).
Supported image size: The downloaded image after Base64 encoding must not exceed 2 MB. Image download time must not exceed 5 seconds.
Supported image resolution: Between 256256 and 40964096 pixels.
Note: You must provide either ImageUrlFront or ImageBase64Front. If both are provided, only ImageUrlFront is used.
ImageUrlBack No String URL of the document back image.
Supported image formats: PNG, JPG/JPEG (GIF not supported).
Supported image size: The downloaded image after Base64 encoding must not exceed 2 MB. Image download time must not exceed 5 seconds.
Supported image resolution: Between 256256 and 40964096 pixels.
Note: For some documents, you must provide either ImageUrlBack or ImageBase64Back. If both are provided, only ImageUrlBack is used.
ReturnHeadImage No Boolean Whether to crop and return the face image from the document. Default: false.
If set to true, the image constraints are:
- Size after Base64 encoding must not exceed 5 MB.
- Maximum pixel width/height: 4000 for JPG, 2000 for other formats.
- Minimum pixel width/height: 64.
- Supported formats: PNG, JPG, JPEG, BMP (GIF not supported).
WebhookUrl No String Verification status callback URL. When set, this endpoint will be actively notified with the final verification result upon process completion. Leave blank to disable callbacks. Since callbacks are not fully reliable, a polling mechanism is advised to guarantee retrieval of the final status.

3. Output Parameters

Parameter Name Type Description
CardVerificationToken String Unique token for the verification process, used to retrieve the result.
RequestId String The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.

4. Example

Example1 Applying Card Verification External Sample Call

Input Example

POST / HTTP/1.1
Host: ocr.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: ApplyCardVerificationExternal
<Common request parameters>

{
    "Nationality": "ARG",
    "CardType": "PASSPORT",
    "ImageBase64Front": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAASABIAAD//9k="
}

Output Example

{
    "Response": {
        "CardVerificationToken": "b76914c0-e1ca-4c36-aede-b64e418d2319",
        "RequestId": "1dab853b-0f54-4479-94d8-e94dbd0c6aea"
    }
}

Example2 URL Call Example

Input Example

POST / HTTP/1.1
Host: ocr.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: ApplyCardVerificationExternal
<Common request parameters>

{
    "Nationality": "PHL",
    "CardType": "PASSPORT",
    "ImageUrlFront": "http://demo/demo.jpg"
}

Output Example

{
    "Response": {
        "CardVerificationToken": "969af1aa-dbb3-49df-b661-6d952bfdce2d",
        "RequestId": "74b25e14-27bc-48fd-a4f2-638066f16e83"
    }
}

5. Developer Resources

SDK

TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

Command Line Interface

6. Error Code

The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

Error Code Description
FailedOperation.DownLoadError Failed to download the file.
FailedOperation.ImageSizeTooLarge The image size exceeds the limit. Refer to the image size constraints in the input parameter description.
FailedOperation.OcrFailed OCR recognition failed. This error may be caused by unstable network connections, service anomalies, or other issues.
FailedOperation.UnKnowError Unknown error.
FailedOperation.UnOpenError The service has not been activated.
InvalidParameter.EngineImageDecodeFailed Image decoding failed.
InvalidParameterValue.InvalidFileContentSize The image file size is invalid or exceeds the allowed limit.
InvalidParameterValue.InvalidParameterValueLimit Incorrect parameter value.
ResourceUnavailable.ImageDownloadError Image file download failed.
ResourceUnavailable.InArrears The account has insufficient balance.
ResourceUnavailable.ResourcePackageRunOut The resource package has been exhausted.

帮助和支持

本页内容是否解决了您的问题?

填写满意度调查问卷,共创更好文档体验。

文档反馈