Updated on 2026-02-12 GMT+08:00

Obtaining Download Links

Function

Obtain the download links of files.

URI

POST /koodrive/ose/v1/files/download

Request Parameters

Table 1 Request header parameters

Parameter

Mandatory

Type

Description

Authorization

Yes

String

Definition:

Access token. Token authentication is used to call KooDrive APIs. A token indicates the permission. When an API is called, the token is added to the request header to obtain the operation permission. For details about how to obtain an access token, see the corresponding developer guide. The format is Bearer+{access_token}.

Constraints:

N/A

Range:

N/A

Default Value:

N/A

X-Traceid

No

String

Definition:

Message log trace ID.

Constraints:

The value contains letters, digits, and underscores (_). The length is 58 bytes.

Range:

N/A

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-User-Id

Yes

String

Definition:

User ID on KooDrive, which is used for app authentication.

Constraints:

N/A

Range:

N/A

Default Value:

N/A

X-Date

Yes

String

Definition:

Date, which is used for app authentication. The format is yyyyMMdd'T'HHmmss'Z'.

Constraints:

The time must be within 15 minutes from the current time and cannot be later than the current time.

Range:

N/A

Default Value:

N/A

x-hw-share-folder-id

No

String

Definition:

ID of the shared folder. If this request header is passed, the current operation is performed in the shared folder.

Constraints:

N/A

Range:

N/A

Default Value:

N/A

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

containerId

Yes

String

Definition:

Space ID.

Constraints:

N/A

Range:

N/A

Default Value:

N/A

fileIds

Yes

Array of strings

Definition:

File ID list.

Constraints:

The list length is less than or equal to 100.

Range:

N/A

Default Value:

N/A

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

code

Integer

Response code.

msg

String

Response information.

batchCode

Integer

Response code.

  • 0: partially successful.

  • 1: all successful.

  • 2: all failed.

downloads

Array of DownloadInfoResponse objects

Download link information.

Table 4 DownloadInfoResponse

Parameter

Type

Description

fileId

String

File ID.

fileName

String

File name.

url

String

Download link.

code

String

Response code of a single download record.

msg

String

Response message of a single download record.

Example Requests

Obtains the download links of files.

POST /koodrive/ose/v1/files/download

Authorization:Bearer+10f88*********4791e9ff

{
  "containerId": "IAADfsBFCO6WtAtuA9add2fea594e4e75b8feb8474ef236",
  "fileIds": [
    "Fn1bTLIOomJkTCAe9DEVBRY4U6IkuqkMZ"
  ]
}

Example Responses

Status code: 200

Response to the request for obtaining the file download links.

{
  "downloads" : [ {
    "fileId" : "Fn1bTLIOomJkTCAe9DEVBRY4U6IkuqkMZ",
    "url" : "https://b10-obs-ykj-uat-01.obs.cidc-rp-2006.joint.cmecloud.cn/5e3fc0c5d4fa45338f44db7177579c2c087?response-content-disposition=attachment%3B%20filename%3D%22%25E5%258F%2591%25E7%25A5%25A81.pdf%22&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20231227T072939Z&X-Amz-SignedHeaders=host&X-Amz-Expires=3600&X-Amz-Credential=MKRISPBZAJWFHNBJ5WLB%2F20231227%2Fcidc-rp-2006%2Fs3%2Faws4_request&X-Amz-Signature=9d06798af17e2f1082b720f43af29a32b3154da4ddeee4f10025a758b599728a",
    "fileName" : "Invoice 1.pdf",
    "code" : "0",
    "msg" : "success"
  } ],
  "batchCode" : 1,
  "code" : 0,
  "msg" : "Success."
}

Status Codes

Status Code

Description

200

Response to the request for obtaining the file download links.