Skip to main content

GetDocumentUrl

Retrieve a download URL for a document. The URL expires after 1 hour.

Operation description

Prerequisites
  • Alibaba Cloud Model Studio and Tongyi Dianjin have been activated.
  • The workspaceId has been obtained: obtain the workspace identifier.

Debug

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

RAM authorization

The following table describes the authorization information for this 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. Details are as follows:
  • Action: 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 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 have the permissions of all dependent actions for the operation to succeed.
ActionAccess levelResource typeCondition keyDependent action
dianjin:GetDocumentUrlget
*All Resources
*
    None
None

Request syntax

GET /{workspaceId}/api/library/document/url HTTP/1.1

Request parameters

NameTypeRequiredDescriptionExample value
workspaceIdstringYes

Path parameter. The workspace ID.

llm-xxxxx
documentIdstringYes

The document ID.

12681367362

Response parameters

NameTypeDescriptionExample value
object

ResultCode

costlong

The time spent.

null
datastring

The returned data, which is the document download URL. The URL expires in 1 hour.

https://path_to_file
dataTypestring

The data type.

null
errCodestring

The error code.

0
messagestring

The error message.

ok
requestIdstring

The request ID.

66249B43-8C2B-5EE7-AE78-B382306621C6
successboolean

Indicates whether the operation is successful.

true
timestring

The timestamp.

2024-01-01 00:00:00

Examples

Success response JSON format
{
  "cost": 0,
  "data": "https://path_to_file",
  "dataType": null,
  "errCode": 0,
  "message": "ok",
  "requestId": "66249B43-8C2B-5EE7-AE78-B382306621C6",
  "success": true,
  "time": "2024-01-01 00:00:00"
}

Error codes

Visit the Error Center to view more error codes.