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

Retrieve HTML Format Document Preview

PDF
포커스 모드
폰트 크기
마지막 업데이트 시간: 2026-01-07 14:15:04

Description

To obtain HTML format document preview.
Note:
Return files in HTML or JPG format for preview.
If the file is not a previewable document type, it will redirect to the file's download link.

Request

Request Example

GET /api/v1/file/{LibraryId}/{SpaceId}/{FilePath}?preview&history_id={HistoryId}&purpose={Purpose}&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 through the Media Hosting console. See 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. See create tenant space
String
No
FilePath
Complete file path, such as foo/bar/file.docx. See view file details
String
Yes
HistoryId
Historical version ID, used to obtain file content of different versions. If not specified, defaults to the latest version. See query historical version list
String
No
Type
Document preview method. If set to "pic", preview the document homepage in jpg format; otherwise, preview in html format.
String
No
AccessToken
Access token. For Public Read Media Library or tenant space, this parameter is not specified; otherwise, you must specify this parameter. Please see Generate Access Token
String
No
UserId
User identity recognition. When the access token has admin permission and the user identity recognition during token application is empty, it is used to temporarily assign user identity. For details, see Generate Access Token API.
String
No

Request Body

This request does not have a request body.

Response

Response code

Successful retrieval, returns HTTP 200 OK.
Redirect, return HTTP 302 Found, response header Location contains a URL that can be used directly to show or download the file.

Response Body

The response body contains the preview file content.


도움말 및 지원

문제 해결에 도움이 되었나요?

피드백