Preview documents. Retrieve document download links, types, and titles. Use this operation to preview documents.
Operation description
Prerequisites
- Alibaba Cloud Model Studio and Tongyi Gold services are activated.
- Obtain the workspaceId: Obtain the workspace identifier.
Try it now
You can directly run this API in OpenAPI Explorer, which saves you the trouble of calculating signatures. After the operation succeeds, 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 RAM users or RAM roles the permission to call this API. For more information, see the following descriptions:
- Action: the specific permission point.
- Access level: the access level of each action. Valid values: Write, Read, and List.
-
Resource type: the resource types that support authorization for the operation. For more information, see the following descriptions:
- For required resource types, an asterisk (*) is added before them.
- For operations that do not support resource-level authorization, All Resources is displayed.
- Condition key: the condition keys defined by the cloud service itself.
- Dependent action: other permissions required to successfully perform the operation. The caller must have the permissions of all dependent actions before the operation can succeed.
| Action | Access level | Resource type | Condition key | Dependent action |
|---|---|---|---|---|
| dianjin:PreviewDocument | get | *All resources * |
| None |
Request syntax
Request parameters
| Parameter | Type | Required | Description | Example value |
|---|---|---|---|---|
| workspaceId | string | Yes | Path parameter, workspace ID. | llm-xxxxx |
| documentId | string | Yes | Document ID. | 8326472354762354 |
Response elements
| Element | Type | Description | Example value |
|---|---|---|---|
| object | ResultCode | ||
| cost | long | Time consumed. | null |
| data | object | Returned data. | |
| previewType | string | Preview type. | |
| title | string | Document title. | test |
| uploadTime | string | Upload time. | 2024-01-01 00:00:00 |
| url | string | Document URL. | https://agi.alicdn.com/user/d0o/d3c1f50d-a6c2-49b3-b0c8-3e613c3f20ee_16872_3236784461.png |
| dataType | string | Data type. | null |
| errCode | string | Error code. | 0 |
| message | string | Error message. | ok |
| requestId | string | Request ID. | ff551395-1c8a-4f30-8ffd-ef7e87c70b4c |
| success | boolean | Indicates whether the request is successful. | true |
| time | string | Time. | 2024-04-24 11:54:34 |
Examples
Success response
JSON format