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

Spatial Operations

PDF
フォーカスモード
フォントサイズ
最終更新日: 2026-01-07 10:49:15

Introduction

This document provides API introduction related to space as well as example code.

Listing Space Homepage Content

Feature Description

Listing space homepage content.

Sample Code

try {
let result = await SMHSpaceApis.listSpaceHomeFile({
libraryId:"libraryId",
spaceId:"spaceId",
filter:SMHDirectoryFilter.onlyDir,
limit:'5'
});
}catch (e) {
// Exception handling
}

Parameter Description

Request parameters.
Description
Type
Required or Not
libraryId
Media Library ID, obtained after creating a media library in 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
marker
Identification for sequential pagination. Input this parameter when paginating.
String
No
limit
Limit on the number of projects listed locally for sequential pagination
String
No
filter
Filtering Methods (leave empty to return all, onlyDir for folders only, onlyFile for files only)
SMHDirectoryFilter
No
category
Customized file categories. Users can modify file categories through the file API or predefine classification information based on file suffix.
String
No
withPath
whether to return path
Bool
No

Query Tenant Space Size

Feature Description

Used for querying tenant space size.

Sample Code

try {
let result = await SMHSpaceApis.getSpaceSize({
libraryId:"libraryId",
spaceId:"spaceId"
});
}catch (e) {
// Exception handling
}

Parameter Description

Request parameters.
Description
Type
Required or Not
libraryId
Media Library ID, obtained after creating a media library in 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
Yes

Space File Number Statistics

Feature Description

Statistics for the number of files in space.

Sample Code

try {
let result = await SMHSpaceApis.getSpaceFileCount({
libraryId:"libraryId",
spaceId:"spaceId"
});
}catch (e) {
// Exception handling
}

Parameter Description

Request parameters.
Description
Type
Required or Not
libraryId
Media Library ID, obtained after creating a media library in 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
Yes

Setting Tenant Space Speed Limit

Feature Description

Used to set the speed limit for tenant space.

Sample Code

try {
let result = await SMHSpaceApis.setSpaceTrafficLimit({
libraryId:"libraryId",
spaceId:"spaceId",
downloadTrafficLimit:102400
});
}catch (e) {
// Exception handling
}

Parameter Description

Request parameters.
Description
Type
Required or Not
libraryId
Media Library ID, obtained after creating a media library in 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
Yes
downloadTrafficLimit
Download speed limit for space, data type, range 100KB/s - 100MB/s, unit Byte. Input -1 to cancel the limit.
Number
Yes

Listing Tenant Space Information List

Feature Description

Lists tenant space information.

Sample Code

try {
let result = await SMHSpaceApis.listSpace({libraryId:"libraryId"});
}catch (e) {
// Exception handling
}

Parameter Description

Request parameters.
Description
Type
Required or Not
libraryId
Media Library ID, obtained after creating a media library in the media hosting console. See Create Media Library
String
Yes
marker
Identification for sequential pagination, i.e., the nextMarker field returned by the previous request.
String
No
limit
Limit on the number of items listed locally for sequential pagination, defaults to 1000, cannot exceed 1000
String
No

Batch Query Listing Tenant Space Capacity Information

Feature Description

Used for batch querying tenant space capacity info.

Sample Code

try {
let result = await SMHSpaceApis.listSpaceUsage({
libraryId:"libraryId",
spaceIds:"spaceId"
});
}catch (e) {
// Exception handling
}

Parameter Description

Request parameters.
Description
Type
Required or Not
libraryId
Media Library ID, obtained after creating a media library in the media hosting console. See Create Media Library
String
Yes
spaceIds
Space List, separated by commas, for example space1,space2
String
Yes

ヘルプとサポート

この記事はお役に立ちましたか?

フィードバック