GetAsyncTranslate - 获取文本异步翻译任务

更新时间:
复制 MD 格式

获取文本异步翻译任务内容。

接口说明

通过 jobID 获取对应的异步任务翻译内容

调试

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

调试

授权信息

下表是API对应的授权信息,可以在RAM权限策略语句的Action元素中使用,用来给RAM用户或RAM角色授予调用此API的权限。具体说明如下:

  • 操作:是指具体的权限点。

  • 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。

  • 资源类型:是指操作中支持授权的资源类型。具体说明如下:

    • 对于必选的资源类型,用前面加 * 表示。

    • 对于不支持资源级授权的操作,用全部资源表示。

  • 条件关键字:是指云产品自身定义的条件关键字。

  • 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。

操作

访问级别

资源类型

条件关键字

关联操作

alimt:GetAsyncTranslate

none

*全部资源

*

无 无

请求参数

名称

类型

必填

描述

示例值

JobId

string

是

异步任务 ID。您调用 CreateAsyncTranslate 创建异步任务返回的 JobId

77056ab7-7be1-4c2a-91a1-f20f63894048

返回参数

名称

类型

描述

示例值

object

Schema of Response

RequestId

string

请求的唯一 id,用于后续排查问题使用

DC2DCCC9-C3DF-4F59-8D8E-78185729F16D

Code

integer

状态码

200

Message

string

返回信息。

ok

Data

object

数据内容

Status

string

任务状态

ready

TranslatedText

string

翻译内容

hello

WordCount

string

原文的字符数

2

DetectedLanguage

string

源语言传入 auto 时,语种识别后的源语言代码

zh

示例

正常返回示例

JSON格式

{
  "RequestId": "DC2DCCC9-C3DF-4F59-8D8E-78185729F16D",
  "Code": 200,
  "Message": "ok",
  "Data": {
    "Status": "ready",
    "TranslatedText": "hello",
    "WordCount": "2",
    "DetectedLanguage": "zh"
  }
}

错误码

HTTP status code

错误码

错误信息

描述

400 Parameter.SourceLangError Source languages are not supported. 源语种不支持。
400 Parameter.TargetLangError Target languages are not supported. 目标语种不支持。
400 System.AccountNotActivated The account has not activated the service. 账号没有开通服务
400 System.AccountNotActivatedOrInArrears The service is not activated or the account has an outstanding balance. 账号服务没有开通或者欠费
400 System.LanguageNotSupported The specified language pair is not supported. 该语向不支持
400 System.ParameterError Some required parameters are missing. 参数错误
400 System.StringTooLong The maximum length of the specified string is exceeded. 字符过长
500 System.Error A system error occurred. 系统错误
500 System.LanguageDetectError An error occurred while detecting the language. 语种识别错误
500 System.RequestTimeOut The request has timed out. 请求超时
500 System.SubServiceFailed Sub-account service failed. 子账号服务失败
500 System.TranslateError An error occurred while translating. 翻译错误
500 System.TranslateServiceCallFailed Failed to call the translation service. 翻译服务调用失败
500 System.unknownError An unknown error occurred. 未知错误
500 System.UrlDecodingError An error occurred while decoding the URL. Verify that the specified URL is encoded. URL编码错误
403 System.subNotPermission The sub-account is not authorized to perform the operation. 子账号没有权限
109 System.SubNotPermission The sub account is not authorized to perform the operation.

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

变更历史

更多信息,参考变更详情。