语种识别API说明文档。
1、字符长度限制5000,调用接口QPS限制50;如有扩展需求,请与我们联系,钉钉群号:23369411
2、请确保在使用该接口前,已充分了解通用版翻译产品的收费方式和价格
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
| 名称 | 类型 | 是否必选 | 示例值 | 描述 |
|---|---|---|---|---|
| Action | String | 是 | GetDetectLanguage | 系统规定参数。取值:GetDetectLanguage。 |
| SourceText | String | 是 | 你好 | 待识别的语种 |
返回数据
| 名称 | 类型 | 示例值 | 描述 |
|---|---|---|---|
| DetectedLanguage | String | zh | 识别成功的语种 |
| RequestId | String | 0C5EC1EC-1A06-4D60-97E6-4D41350945E4 | 请求ID |
公共请求参数参见《RPC 调用机制》公共请求参数组装方案
示例
请求示例
http(s)://[Endpoint]/?Action=GetDetectLanguage
&<公共请求参数>
正常返回示例
XML格式
HTTP/1.1 200 OK
Content-Type:application/xml
<GetDetectLanguageResponse>
<RequestId>0C5EC1EC-1A06-4D60-97E6-4D41350945E4</RequestId>
<DetectedLanguage>zh</DetectedLanguage>
</GetDetectLanguageResponse>
JSON格式
HTTP/1.1 200 OK
Content-Type:application/json
{
"GetDetectLanguageResponse" : {
"RequestId" : "0C5EC1EC-1A06-4D60-97E6-4D41350945E4",
"DetectedLanguage" : "zh"
}
}
错误码
| HttpCode | 错误码 | 错误信息 | 描述 |
|---|---|---|---|
| 101 | 10001 | The request has timed out. | 请求超时 |
| 102 | 10002 | A system error occurred. | 系统错误 |
| 103 | 10003 | An error occurred while decoding the URL. Verify that the specified URL is encoded. | 原文解码失败,请检查原文是否UrlEncode |
| 104 | 10004 | Some required parameters are missing. | 参数缺失 |
| 105 | 10005 | The specified language pair is not supported. | 语项不支持 |
| 106 | 10006 | An error occurred while detecting the language. | 语种识别失败 |
| 107 | 10007 | An error occurred while translating. | 翻译失败 |
| 108 | 10008 | The specified string is too long. | 字符长度过长 |
| 199 | 19999 | An unknown error occurred. | 未知异常 |
| 400 | System.ParameterError | Some required parameters are missing. | 参数错误 |
| 503 | System.Error | A system error occurred. | 系统错误 |
| 503 | Internal.Error | The internal service connection timeout, please try again later. | 后端服务超时,请稍后重试 |
访问错误中心查看更多错误码。