GetImageTranslateTask
Tongyi Multimodal Translation: Getting image translation results
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.
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 resourcesis 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.
| Operation | Access level | Resource type | Condition key | Dependent action |
|---|---|---|---|---|
| anytrans:GetImageTranslateTask | none | *All resources * |
| None |
Request syntax
POST /anytrans/translate/image/get HTTP/1.1
Request parameters
| Name | Type | Required | Description | Example value |
|---|---|---|---|---|
| workspaceId | string | Yes | The ID of the workspace. | llm-kqtrcpdee4xm29xx |
| taskId | string | Yes | The ID of the image translation task. | 2746f4be-cff2-465e-a2c6-12bff30ce0f9 |
Response parameters
| Name | Type | Description | Example value |
|---|---|---|---|
| object | Schema of Response | ||
| code | string | The response status code. | success |
| message | string | The response message. | success |
| requestId | string | The request ID, used to trace API calls. | 377A48D7-7CFA-53F9-8CA2-14FE3F2774B6 |
| success | boolean | Whether the API call is successful. | true |
| httpStatusCode | string | The HTTP status code. | 200 |
| synchro | boolean | Whether the request is synchronous. | true |
| data | object | The returned data. | |
| traceId | string | The trace ID. | 213e391517328463424251152ec9fb |
| translation | object | The translation result. | |
| angle | long | The rotation angle of the image. | 0 |
| width | long | The width of the image after rotation. | 800 |
| height | long | The height of the image after rotation. | 800 |
| orgWidth | long | The width of the original image. | 800 |
| orgHeight | long | The height of the original image. | 800 |
| boxesCount | long | The number of text blocks. | 13 |
| boundingBoxes | array<object> | The list of text block details. | |
| boundingBoxes | object | Text block details. | |
| upLeft | object | The position of the upper-left corner. | |
| x | long | The x-coordinate. | 10 |
| y | long | The y-coordinate. | 66 |
| upRight | object | The position of the upper-right corner. | |
| x | long | The x-coordinate. | 328 |
| y | long | The y-coordinate. | 69 |
| downLeft | object | The position of the lower-left corner. | |
| x | long | The x-coordinate. | 9 |
| y | long | The y-coordinate. | 145 |
| downRight | object | The position of the lower-right corner. | |
| x | long | The x-coordinate. | 327 |
| y | long | The y-coordinate. | 148 |
| confidence | float | The label confidence. The value ranges from 0 (lowest confidence) to 1 (highest confidence). | 0.99 |
| text | string | The source-language text of the text block recognized in the image. | 修护头皮 |
| direction | long | The text direction. 0 indicates horizontal and 1 indicates vertical. | 0 |
| tableId | long | The ID of the table that the text block belongs to. If the text block is not in a table, the value is -1. | 1 |
| tableCellId | long | The ID of the cell that the text block belongs to. If the text block is not in a table, the value is -1. | 1 |
| translation | object | The translation result. | { "en": "Restore Scalp Health" } |
| tableInfos | array<object> | The list of table information. | |
| tableInfos | object | Table information. | |
| tableId | long | The source table ID. | 1 |
| xCellSize | long | The cell length in the horizontal direction. | 50 |
| yCellSize | long | The cell length in the vertical direction. | 50 |
| cellInfos | array<object> | The list of cell information. | |
| cellInfos | object | Cell information. | |
| tableCellId | long | The cell ID. | 1 |
| text | string | The text to be translated in the image text block. | 活动价 |
| xsc | long | The index of the cell where this cell starts in the horizontal direction. | 1 |
| xec | long | The index of the cell where this cell ends in the horizontal direction. | 2 |
| ysc | long | The index of the cell where this cell starts in the vertical direction. | 3 |
| yec | long | The index of the cell where this cell ends in the vertical direction. | 1 |
| pos | array<object> | The list of cell positions. | |
| pos | object | The cell position. | |
| x | long | The x-coordinate. | 33 |
| y | long | The y-coordinate. | 11 |
Examples
Normal response example
JSON format
{
"code": "success",
"message": "success",
"requestId": "377A48D7-7CFA-53F9-8CA2-14FE3F2774B6",
"success": true,
"httpStatusCode": 200,
"synchro": true,
"data": {
"traceId": "213e391517328463424251152ec9fb",
"translation": {
"angle": 0,
"width": 800,
"height": 800,
"orgWidth": 800,
"orgHeight": 800,
"boxesCount": 13,
"boundingBoxes": [
{
"upLeft": {
"x": 10,
"y": 66
},
"upRight": {
"x": 328,
"y": 69
},
"downLeft": {
"x": 9,
"y": 145
},
"downRight": {
"x": 327,
"y": 148
},
"confidence": 0.99,
"text": "修护头皮",
"direction": 0,
"tableId": 1,
"tableCellId": 1,
"translation": {
"en": "Restore Scalp Health"
}
}
],
"tableInfos": [
{
"tableId": 1,
"xCellSize": 50,
"yCellSize": 50,
"cellInfos": [
{
"tableCellId": 1,
"text": "活动价",
"xsc": 1,
"xec": 2,
"ysc": 3,
"yec": 1,
"pos": [
{
"x": 33,
"y": 11
}
]
}
]
}
]
}
}
}
Error codes
| HTTP status code | Error code | Error message |
|---|---|---|
| 400 | IdempotentParameterMismatch | The 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 time | Change summary | Operation |
|---|
No change history yet.