Skip to main content

GetHtmlTranslateTask

Retrieves the result of an HTML translation task from Tongyi Multimodal Translation.

Debugging

You can run this API directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After a successful run, OpenAPI Explorer can automatically generate SDK code examples. Debug

Authorization information

The following table describes the authorization information of the API. You can use it in the Action element of a RAM permission policy statement to grant a RAM user or RAM role the permission to call this API. Details are as follows:
  • Operation: the specific permission point.
  • Access level: the access level of each operation. Valid values: Write, Read, or List.
  • Resource type: the resource types supported for authorization in the operation. Details:
    • Required resource types are marked with a preceding *.
    • For operations that do not support resource-level authorization, All resources is used.
  • Condition key: the condition keys defined by the cloud product itself.
  • Dependent action: other permissions required to successfully perform the operation. The caller must also have the permissions of the dependent actions for the operation to succeed.
OperationAccess levelResource typeCondition keyDependent action
anytrans:GetHtmlTranslateTasknone
*All resources
*
    None
None

Request syntax

POST /anytrans/translate/html/get HTTP/1.1

Request parameters

NameTypeRequiredDescriptionExample value
workspaceIdstringYes

The ID of the Model Studio workspace used for this request.

llm-kqtrcpdee4xm29xx
taskIdstringNo

The ID of the HTML translation task.

868c2fdd-96c2-4546-96d2-a259b8f35252

Response parameters

NameTypeDescriptionExample value
object

Schema of Response

codestring

The response status code.

success
messagestring

The response message.

success
requestIdstring

The request ID, used for tracing API calls.

04B53310-CB1A-14B4-AC85-26C154D8366A
successboolean

Whether the API call is successful.

true
httpStatusCodestring

The HTTP status code.

200
dataobject

The returned data.

translationstring

The translation result.

<!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="utf-8"/> <meta content="width=device-width, initial-scale=1.0" name="viewport"/> <title>My First Webpage</title> </head> <body> <h1>Welcome to my webpage!</h1> <p>This is a simple HTML page.</p> <p>Learning HTML is the first step to entering web development.</p> <a href="https://www.example.com"&gt;Click here to visit the sample website</a> </body> </html>
usageobject

The token usage.

inputTokenslong

The number of input tokens.

22
outputTokenslong

The number of output tokens.

19
totalTokenslong

The total number of tokens.

41

Examples

Normal response example JSON format
{
  "code": "success",
  "message": "success",
  "requestId": "04B53310-CB1A-14B4-AC85-26C154D8366A",
  "success": true,
  "httpStatusCode": 200,
  "data": {
    "translation": "<!DOCTYPE html>\n\n<html lang=\"zh-CN\">\n<head>\n<meta charset=\"utf-8\"/>\n<meta content=\"width=device-width, initial-scale=1.0\" name=\"viewport\"/>\n<title>My First Webpage</title>\n</head>\n<body>\n<h1>Welcome to my webpage!</h1>\n<p>This is a simple HTML page.</p>\n<p>Learning HTML is the first step to entering web development.</p>\n<a href=\"https://www.example.com\">Click here to visit the sample website</a>\n</body>\n</html>",
    "usage": {
      "inputTokens": 22,
      "outputTokens": 19,
      "totalTokens": 41
    }
  }
}

Error codes

HTTP status codeError codeError message
400IdempotentParameterMismatchThe request uses the same client token as a previous, but non-identical request. Do not reuse a client token with different requests, unless the requests are identical.
Visit the Error Center to view more error codes.

Change history

Change timeChange summaryOperation
No change history yet.