Help Center/KooDrive/API Reference(Carrier)/API/File Operations/Obtaining the Online Preview Link of a Shared File
Updated on 2026-02-12 GMT+08:00

Obtaining the Online Preview Link of a Shared File

Function

Obtain the link for online preview of a shared file.

URI

GET /koodrive/ose/v1/files/preview/share/{shortcode}

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

shortcode

Yes

String

Definition:

Share a short link.

Constraints:

N/A

Range:

N/A

Default Value:

N/A

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

fileId

Yes

String

Definition:

File ID.

Constraints:

N/A

Range:

N/A

Default Value:

N/A

kdstoken

Yes

String

Definition:

Short link verification code, which is returned by the API for querying sharing details.

Constraints:

N/A

Range:

N/A

Default Value:

N/A

parentFolder

No

String

Definition:

Parent directory ID.

Constraints:

N/A

Range:

N/A

Default Value:

N/A

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Traceid

No

String

Definition:

Service trace ID, which contains 58 bits.

Constraints:

N/A

Range:

The value contains 58 bits.

Default Value:

N/A

language

No

String

Definition:

Language code.

Constraints:

The value must comply with the internationalization specifications. For example, en_us indicates English (United States).

Range:

The value must comply with the internationalization specifications.

Default Value:

en-US

X-Hw-Agentname

Yes

String

Definition:

Carrier name.

Constraints:

N/A

Range:

N/A

Default Value:

N/A

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

code

Integer

Response code.

msg

String

Response message.

link

String

File online preview link.

Example Requests

Obtain the preview link of a file using the short link sharing code 2dert45454.

GET /koodrive/ose/v1/files/preview/share/2dert45454

Example Responses

Status code: 200

Response to the request for obtaining the file online preview link.

{
  "link" : "https://xxxxxxx.obs.cn-north-4.myhuaweicloud.com/***********?response-content-disposition=attachment%3B%20filename%2A%3DUTF-8%27%27b112599cf0a74e7798fe9bd7e6725010.pdf&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20250924T093847Z&X-Amz-SignedHeaders=host&X-Amz-Expires=3600&X-Amz-Credential=*************SA%2F20250924%2Fnorth-4%2Fs3%2Faws4_request&X-Amz-Signature=*******",
  "code" : 0,
  "msg" : "Success."
}

Status Codes

Status Code

Description

200

Response to the request for obtaining the file online preview link.