Skip to main content

CreatePdfTranslateTask

Create a PDF document translation task. Submit the task to start asynchronous translation.

Operation description

Before you use this operation, make sure that you fully understand the billing methods and pricing of Tongyi Dianjin. Prerequisites
  • Alibaba Cloud Model Studio and Tongyi Dianjin services are activated.
  • Obtain the workspaceId: Obtain the workspace identifier.

Debug

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

RAM authorization

The following table describes the authorization information of the API. You can use it in the Action element of a RAM policy statement to grant a RAM user or RAM role the permission to call this API. Details are as follows:
  • Action: the specific permission point.
  • Access level: the access level of each action. Valid values: Write, Read, or List.
  • Resource type: the resource types that support authorization for the operation. Details are as follows:
    • Required resource types are marked with a preceding asterisk (*).
    • For operations that do not support resource-level authorization, All Resources is used.
  • Condition key: the condition keys defined by the cloud service 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.
ActionAccess levelResource typeCondition keyDependent action
dianjin:CreatePdfTranslateTaskcreate
*All Resources
*
    None
None

Request syntax

POST /{workspaceId}/api/task/pdfTranslate HTTP/1.1

Request parameters

NameTypeRequiredDescriptionExample value
workspaceIdstringYes

Workspace ID

llm-ik******RVYCKzt
bodyobjectNo

Request body.

docIdstringYes

Document ID

873648346573245
knowledgestringNo

Knowledge: the domain knowledge referenced during translation

净利润 (Net Profit) 英文:Net Profit 中文:净利润(通常指扣除所有费用和税后的利润)
libraryIdstringYes

Document library ID

cjshcxxxx
modelIdstringYes

Model ID

qwen-plus
translateTostringNo

Target language: defaults to Chinese

中文

Response elements

NameTypeDescriptionExample value
object

ResultCode

costlong

Response time of the API

null
datastring

Response data. Returns the task ID. You can use this ID to query the task status and result.

3284627354
dataTypestring

Data type

null
errCodestring

Error code

0
messagestring

Error message

ok
requestIdstring

Request ID

5E3FBAF1-17AF-53B7-AF0A-CDCEEB6DE658
successboolean

Whether the request succeeded

true
timestring

Timestamp

2024-04-24 11:54:34

Examples

Success response JSON format
{
  "cost": 0,
  "data": 3284627354,
  "dataType": null,
  "errCode": 0,
  "message": "ok",
  "requestId": "5E3FBAF1-17AF-53B7-AF0A-CDCEEB6DE658",
  "success": true,
  "time": "2024-04-24 11:54:34"
}

Error codes

Visit the Error Center to view more error codes.