GetImageTranslateTask

Updated at:

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.

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:GetImageTranslateTasknone
*All resources
*
    None
None

Request syntax

POST /anytrans/translate/image/get HTTP/1.1

Request parameters

NameTypeRequiredDescriptionExample value
workspaceIdstringYes

The ID of the workspace.

llm-kqtrcpdee4xm29xx
taskIdstringYes

The ID of the image translation task.

2746f4be-cff2-465e-a2c6-12bff30ce0f9

Response parameters

NameTypeDescriptionExample value
object

Schema of Response

codestring

The response status code.

success
messagestring

The response message.

success
requestIdstring

The request ID, used to trace API calls.

377A48D7-7CFA-53F9-8CA2-14FE3F2774B6
successboolean

Whether the API call is successful.

true
httpStatusCodestring

The HTTP status code.

200
synchroboolean

Whether the request is synchronous.

true
dataobject

The returned data.

traceIdstring

The trace ID.

213e391517328463424251152ec9fb
translationobject

The translation result.

anglelong

The rotation angle of the image.

0
widthlong

The width of the image after rotation.

800
heightlong

The height of the image after rotation.

800
orgWidthlong

The width of the original image.

800
orgHeightlong

The height of the original image.

800
boxesCountlong

The number of text blocks.

13
boundingBoxesarray<object>

The list of text block details.

boundingBoxesobject

Text block details.

upLeftobject

The position of the upper-left corner.

xlong

The x-coordinate.

10
ylong

The y-coordinate.

66
upRightobject

The position of the upper-right corner.

xlong

The x-coordinate.

328
ylong

The y-coordinate.

69
downLeftobject

The position of the lower-left corner.

xlong

The x-coordinate.

9
ylong

The y-coordinate.

145
downRightobject

The position of the lower-right corner.

xlong

The x-coordinate.

327
ylong

The y-coordinate.

148
confidencefloat

The label confidence. The value ranges from 0 (lowest confidence) to 1 (highest confidence).

0.99
textstring

The source-language text of the text block recognized in the image.

修护头皮
directionlong

The text direction. 0 indicates horizontal and 1 indicates vertical.

0
tableIdlong

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
tableCellIdlong

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
translationobject

The translation result.

{ "en": "Restore Scalp Health" }
tableInfosarray<object>

The list of table information.

tableInfosobject

Table information.

tableIdlong

The source table ID.

1
xCellSizelong

The cell length in the horizontal direction.

50
yCellSizelong

The cell length in the vertical direction.

50
cellInfosarray<object>

The list of cell information.

cellInfosobject

Cell information.

tableCellIdlong

The cell ID.

1
textstring

The text to be translated in the image text block.

活动价
xsclong

The index of the cell where this cell starts in the horizontal direction.

1
xeclong

The index of the cell where this cell ends in the horizontal direction.

2
ysclong

The index of the cell where this cell starts in the vertical direction.

3
yeclong

The index of the cell where this cell ends in the vertical direction.

1
posarray<object>

The list of cell positions.

posobject

The cell position.

xlong

The x-coordinate.

33
ylong

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 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.