tencent cloud

Smart Media Hosting

Favorite

PDF
Modo Foco
Tamanho da Fonte
Última atualização: 2026-01-07 10:49:16

Introduction

This document provides API introduction related to favorite and example code.

Favorite Files/Directories

Feature Description

For favorite files/directories.

Sample Code

try{
let result = await SMHFavoriteApis.favorite({
libraryId:"libraryId",
spaceId:"spaceId",
path:'path'
});
}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. Please refer to Create Media Library.
String
Yes
spaceId
Space ID, see Create Tenant Space
String
Yes
inode
File directory ID, can be a file or directory
String
No
path
File directory path. Choose either this or the inode parameter. If both inode and path are specified, inode takes precedence.
String
No

View Specified Space Favorite List

Feature Description

View specified space favorite list.

Sample Code

try{
let result = await SMHFavoriteApis.listFavorite({
libraryId:"libraryId",
spaceId:"spaceId",
orderBy:SMHFileListOrderBy.favoriteTime,
orderByType:SMHOrderByType.asc,
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. Please refer to Create Media Library.
String
Yes
spaceId
Space ID, see Create Tenant Space
String
Yes
marker
List paginated identification in sequence
String
No
limit
Number limit for locally listed items when paginating in sequence, defaults to 20
String
No
page
Pagination code, defaults to first page, optional parameter, cannot be used with marker and limit parameters
Number
No
pageSize
Page size, defaults to 20, optional parameter, cannot be used with marker and limit parameters
Number
No
orderBy
sorting field, sorted by favoriteTime (default), currently only support sorting by favoriteTime
SMHFileListOrderBy
No
orderByType
sorting method, asc for ascending, desc for descending
SMHOrderByType
No
withPath
whether to return the path, true for return, false for do not return (default)
Bool
No

Deleting a Specified Space Favorite

Feature Description

Delete specified space favorite.

Sample Code

try{
let result = await SMHFavoriteApis.cancelFavorite({
libraryId:"libraryId",
spaceId:"spaceId",
path:'path'
});
}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. Please refer to Create Media Library.
String
Yes
spaceId
Space ID, see Create Tenant Space
String
Yes
inode
File directory ID, can be a file or directory
String
No
path
File directory path. Choose either this or the inode parameter. If both inode and path are specified, inode takes precedence.
String
No

Ajuda e Suporte

Esta página foi útil?

comentários