调用TranslateCertificate进行证件翻译。

请确保在使用该接口前,已充分了解图片翻译产品的收费方式和价格

该接口适用于证件翻译。 如需调用通用图片翻译和电商图片翻译,请参考这里

图片限制

文件大小限制:4M

支持的格式:jpg, jpeg, png

接口QPS限制:40

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

请求参数

名称 类型 是否必选 示例值 描述
Action String TranslateCertificate

系统规定参数。取值:TranslateCertificate

SourceLanguage String zh

原图语言

TargetLanguage String en

译文语言

ImageUrl String http://imageurl

oss文件地址:一个可以不用赋权就能访问的http地址

CertificateType String driving_license

翻译的证件类型:身份证(idcard),驾驶证(driving_license)

ResultType String text

翻译结果类型:文本(text),图片(image),不传值默认:text

返回数据

名称 类型 示例值 描述
RequestId String 6640DE48-201C-4110-AE87-FB8FA34412B9

请求Id

Data Object

翻译结果

TranslatedValues Array of CertificateTranslateItemDTO

译文结果列表

KeyTranslation String name

key对应的译文

Key String 姓名

证件内容标题,如身份证中的姓名,性别

Value String 庄严

原文

ValueTranslation String Solemn

译文

示例

请求示例

http(s)://[Endpoint]/?Action=TranslateCertificate
&CertificateType=driving_license
&ImageUrl=http://imageurl
&SourceLanguage=zh
&TargetLanguage=en
&<公共请求参数>

正常返回示例

XML格式

HTTP/1.1 200 OK
Content-Type:application/xml

<TranslateCertificateResponse>
    <RequestId>BA8DAAE0-1985-4B19-86BA-97C1753FCF3A</RequestId>
    <Data>
        <TranslatedValues>
            <ValueTranslation>Huang Jia</ValueTranslation>
            <KeyTranslation>name</KeyTranslation>
            <Value>黄佳</Value>
            <Key>姓名</Key>
        </TranslatedValues>
        <TranslatedValues>
            <ValueTranslation>2019-07-05</ValueTranslation>
            <KeyTranslation>effective start date</KeyTranslation>
            <Value>2019-07-05</Value>
            <Key>有效起始日期</Key>
        </TranslatedValues>
        <TranslatedValues>
            <ValueTranslation>331021190</ValueTranslation>
            <KeyTranslation>certificate number</KeyTranslation>
            <Value>331021190</Value>
            <Key>证号</Key>
        </TranslatedValues>
        <TranslatedValues>
            <ValueTranslation>1999-11-04</ValueTranslation>
            <KeyTranslation>date of birth</KeyTranslation>
            <Value>1999-11-04</Value>
            <Key>出生日期</Key>
        </TranslatedValues>
        <TranslatedValues>
            <ValueTranslation>No. 3 Damaiyu Street, Yuhuan county, Zhejiang province</ValueTranslation>
            <KeyTranslation>address</KeyTranslation>
            <Value>浙江省玉环县大麦屿街道3号</Value>
            <Key>住址</Key>
        </TranslatedValues>
        <TranslatedValues>
            <ValueTranslation>Fujian Ningde, traffic police division, public security bureau</ValueTranslation>
            <KeyTranslation>license issuing unit</KeyTranslation>
            <Value>福建省宁德市公安局交通警察支队</Value>
            <Key>发证单位</Key>
        </TranslatedValues>
        <TranslatedValues>
            <ValueTranslation>Chinese</ValueTranslation>
            <KeyTranslation>nationality</KeyTranslation>
            <Value>中国</Value>
            <Key>国籍</Key>
        </TranslatedValues>
        <TranslatedValues>
            <ValueTranslation>2019-07-05</ValueTranslation>
            <KeyTranslation>date of first issue</KeyTranslation>
            <Value>2019-07-05</Value>
            <Key>初次领证日期</Key>
        </TranslatedValues>
        <TranslatedValues>
            <ValueTranslation>C1</ValueTranslation>
            <KeyTranslation>class</KeyTranslation>
            <Value>C1</Value>
            <Key>准驾车型</Key>
        </TranslatedValues>
        <TranslatedValues>
            <ValueTranslation>Women's</ValueTranslation>
            <KeyTranslation>sex</KeyTranslation>
            <Value>女</Value>
            <Key>性别</Key>
        </TranslatedValues>
        <TranslatedValues>
            <ValueTranslation>2019-07-05至2025-07-05</ValueTranslation>
            <KeyTranslation>validity period</KeyTranslation>
            <Value>2019-07-05至2025-07-05</Value>
            <Key>有效期限</Key>
        </TranslatedValues>
    </Data>
</TranslateCertificateResponse>

JSON格式

HTTP/1.1 200 OK
Content-Type:application/json

{
  "TranslateCertificateResponse" : {
    "RequestId" : "BA8DAAE0-1985-4B19-86BA-97C1753FCF3A",
    "Data" : {
      "TranslatedValues" : [ {
        "ValueTranslation" : "Huang Jia",
        "KeyTranslation" : "name",
        "Value" : "黄佳",
        "Key" : "姓名"
      }, {
        "ValueTranslation" : "2019-07-05",
        "KeyTranslation" : "effective start date",
        "Value" : "2019-07-05",
        "Key" : "有效起始日期"
      }, {
        "ValueTranslation" : "331021190",
        "KeyTranslation" : "certificate number",
        "Value" : "331021190",
        "Key" : "证号"
      }, {
        "ValueTranslation" : "1999-11-04",
        "KeyTranslation" : "date of birth",
        "Value" : "1999-11-04",
        "Key" : "出生日期"
      }, {
        "ValueTranslation" : "No. 3 Damaiyu Street, Yuhuan county, Zhejiang province",
        "KeyTranslation" : "address",
        "Value" : "浙江省玉环县大麦屿街道3号",
        "Key" : "住址"
      }, {
        "ValueTranslation" : "Fujian Ningde, traffic police division, public security bureau",
        "KeyTranslation" : "license issuing unit",
        "Value" : "福建省宁德市公安局交通警察支队",
        "Key" : "发证单位"
      }, {
        "ValueTranslation" : "Chinese",
        "KeyTranslation" : "nationality",
        "Value" : "中国",
        "Key" : "国籍"
      }, {
        "ValueTranslation" : "2019-07-05",
        "KeyTranslation" : "date of first issue",
        "Value" : "2019-07-05",
        "Key" : "初次领证日期"
      }, {
        "ValueTranslation" : "C1",
        "KeyTranslation" : "class",
        "Value" : "C1",
        "Key" : "准驾车型"
      }, {
        "ValueTranslation" : "Women's",
        "KeyTranslation" : "sex",
        "Value" : "女",
        "Key" : "性别"
      }, {
        "ValueTranslation" : "2019-07-05至2025-07-05",
        "KeyTranslation" : "validity period",
        "Value" : "2019-07-05至2025-07-05",
        "Key" : "有效期限"
      } ]
    }
  }
}

错误码

HttpCode 错误码 错误信息 描述
400 10026 Failed to translate the certificate. Please check the parameters. 证件翻译失败,请检查提交的参数。
403 InvalidAccountStatus.ServiceUnavailable The service has not been activated. 服务未开通。
503 ServiceUnavailable An error occurred while processing your request. 服务内部错误。

访问错误中心查看更多错误码。