tencent cloud

Smart Media Hosting

Product Introduction
Product Overview
Feature Description
Product Strengths
Use Cases
Basic Concept
Purchase Guide
Quick Start
Create Media Library
Initiate request
Service Level API Document
History
Introduction
API Category
Making API Requests
PaaS Service APIs
Official Cloud Disk APIs
Data Types
Error Codes
Business Level API Document
Introduction
Access Token Operation API
Tenant Space Operation API
File Operation API
Directory or Album Operation API
Recycle Bin Operation API
Quota Operation API
Query Task Operation API
Search Operation API
Historical Version Operations API
Directory and File Batch Operation API
Collection Operation API
Error Codes
SDK Documentation
Android SDK
iOS SDK
HarmonyOS SDK
FAQs
Enterprise Network Disk
Product Introduction
Purchase Guide
Quick Start
FAQs
Service Level Agreement
Glossary

File Download Link and Info

PDF
Mode fokus
Ukuran font
Terakhir diperbarui: 2026-01-07 14:15:03

Description

To obtain the file download link and information.

Request

Request Example

GET /api/v1/file/{LibraryId}/{SpaceId}/{FilePath}?info&history_id={HistoryId}&content_disposition={ContentDisposition}&access_token={AccessToken}&user_id={UserId}

Request Parameter

Request parameters.
Description
Type
Required or Not
LibraryId
Media Library ID, obtained after creating a media library in the media hosting console. Please refer to Create Media Library.
String
Yes
SpaceId
Space ID. If the media library is in single-tenant mode, this parameter is fixed as hyphen (`-`); if the media library is in multi-tenant mode, you must specify this parameter. Please refer to Create Tenant Space.
String
No
FilePath
Complete file path, such as foo/bar/file.docx
String
Yes
HistoryId
Historical version ID, used to obtain file content of different versions. If not provided, defaults to the latest version. For retrieval, see View historical version list.
String
No
ContentDisposition
Used to set the Content-Disposition response header, supporting inline or attachment. If not provided, defaults to inline.
String
No
Purpose
Purpose, can be set to download or preview, to determine whether to add the file to the recently used file list. If set to preview, the file will be added to the recently used file list; otherwise, it will not.
String
No
AccessToken
Access token, see Generate Access Token
String
Yes
UserId
User identity recognition. When the access token corresponds to administrator permissions and the user identity recognition during the access token application is empty, it is used to temporarily specify user identity. For details, see Generate Access Token API.
String
No
TrafficLimit
Single-link download speed limit, range 100KB/s-100MB/s, Unit B
number
No
pre_check
Whether it is only used for verification of file preview and download, setting this parameter does not include cosUrl in the returned result.
String
No

Request Body

This request does not have a request body.

Response

Response code

Successfully obtained, returned HTTP 200 OK.

Response Body

application/json
Response body example:
{
"cosUrl": "https://xxx-1254105469.c0s.ap-guangzhou.myqcloud.com/xxx",
"cosUrlExpiration": "2021-02-02T08:21:47.000Z",
"availableCosUrls":["https://xxx-1254105469.c0s.ap-guangzhou.myqcloud.com/xxx"],
"type": "video",
"creationTime": "2021-02-01T08:21:47.000Z",
"modificationTime": "2021-02-01T08:21:47.000Z",
"contentType": "video/mp4",
"size": "60",
"eTag": "\\"b9f58108004f49103f23d3fdd6ff3876\\"",
"crc64": "33090853022223205",
"fileType":"powerpoint",
"previewByDoc": true,
"previewByCI": false,
"previewAsIcon": true,
"metaData": {
"x-smh-meta-foo": "bar"
}
"labels": ["animal", "elephant", "Asian elephant"]
"category": "video",
"localCreationTime": "2022-07-26T02:58:09.000Z",
"localModificationTime": "2022-07-26T02:58:09.000Z",
"versionId": 1
}
Response body field description:
Response Parameters
Description
Type
cosUrl
signed download link, with a signature validity period of about 2 hours. Download must be triggered within the validity period.
Array
cosUrlExpiration
signed link expiration time
String
availableCosUrls
download URL
String Array
type
File type
String
creationTime
Time of first upload completion
String
modificationTime
Last overwrite time of the file
String
contentType
media type
String
size
File size.
String
eTag
File eTag
String
crc64
File CRC64-ECMA182 check value
String
previewByDoc
whether wps can preview
Boolean
previewByCI
whether Wanxiang can preview
Boolean
previewAsIcon
whether the preview image can be used as an icon
Boolean
fileType
File type: excel, powerpoint, etc.
String
metaData
Metadata, if there is no metadata this field does not exist
String
labels
Simplified file tag list, specified when uploading or modifying files
Array
category
Customized file category
String
localCreationTime
File local creation time
String
localModificationTime
File local modification time
String
versionId
File version number
Int

Error Codes

This request operation has no special error messages. For common error messages, see Error Codes.

Bantuan dan Dukungan

Apakah halaman ini membantu?

masukan