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 Resourcesis 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.
| Action | Access level | Resource type | Condition key | Dependent action |
|---|---|---|---|---|
| dianjin:CreatePdfTranslateTask | create | *All Resources * |
| None |
Request syntax
Request parameters
| Name | Type | Required | Description | Example value |
|---|---|---|---|---|
| workspaceId | string | Yes | Workspace ID | llm-ik******RVYCKzt |
| body | object | No | Request body. | |
| docId | string | Yes | Document ID | 873648346573245 |
| knowledge | string | No | Knowledge: the domain knowledge referenced during translation | 净利润 (Net Profit) 英文:Net Profit 中文:净利润(通常指扣除所有费用和税后的利润) |
| libraryId | string | Yes | Document library ID | cjshcxxxx |
| modelId | string | Yes | Model ID | qwen-plus |
| translateTo | string | No | Target language: defaults to Chinese | 中文 |
Response elements
| Name | Type | Description | Example value |
|---|---|---|---|
| object | ResultCode | ||
| cost | long | Response time of the API | null |
| data | string | Response data. Returns the task ID. You can use this ID to query the task status and result. | 3284627354 |
| dataType | string | Data type | null |
| errCode | string | Error code | 0 |
| message | string | Error message | ok |
| requestId | string | Request ID | 5E3FBAF1-17AF-53B7-AF0A-CDCEEB6DE658 |
| success | boolean | Whether the request succeeded | true |
| time | string | Timestamp | 2024-04-24 11:54:34 |
Examples
Success response
JSON format