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

Recycle Bin

PDF
Mode fokus
Ukuran font
Terakhir diperbarui: 2026-01-07 10:49:14

Introduction

This document provides an introduction to relevant APIs for the recycle bin and example code.

Listing Recycle Bin Projects

Feature Description

Listing Recycle Bin Projects.

Sample Code

try{
let result = await SMHRecycledApis.listRecycled({
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. Please refer to Create Tenant Space
String
No
marker
Identification used for sequential listing with pagination, cannot be used with both page and page_size parameters
String
No
limit
Limited number of locally listed projects for sequential pagination, cannot be used with both page and page_size parameters
String
No
page
pagination code, default first page, optional parameter, cannot be used with both marker and limit parameters
Number
No
pageSize
page size, default 20, optional parameter, cannot be used with both marker and limit parameters
Number
No
orderBy
Sorting field: name for sort by name, modificationTime for sort by modification time, size for sort by file size, removalTime for sort by removal time, remainingTime for sort by remaining time
SMHFileListOrderBy
No
orderByType
Sorting method, asc for ascending, desc for descending
SMHOrderByType
No

Restoring a Specified Recycle Bin Project

Feature Description

Restore the designated recycle bin project.

Sample Code

try{
let result = await SMHRecycledApis.restoreRecycledObject({
libraryId:"libraryId",
spaceId:"spaceId",
recycledItemId:312
})
}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. Please refer to Create Tenant Space
String
No
recycledItemId
Recycle Bin Project ID
Number
Yes
conflictResolutionStrategy
Handling method when path conflict, default is ask
ask: returns HTTP 409 Conflict and error code SameNameDirectoryOrFileExists when conflicts with
rename: automatically renames the file when conflicts with
overwrite: returns HTTP 409 Conflict and error code SameNameDirectoryOrFileExists when the target is a directory, otherwise overwrites the existing file
SMHConflictResolutionStrategy
No
restorePathStrategy
Restoration project source path processing method, defaults to originalPath
originalPath: restore to original path, error will be reported if original path does not exist
fallbackToRoot: restore to original path, fall back to root directory if original path does not exist
SMHRestorePathStrategy
No

Batch Recovering Specified Recycle Bin Projects

Feature Description

Batch recover designated recycle bin projects.

Sample Code

try{
let result = await SMHRecycledApis.batchRestoreRecycledObject({
libraryId:"libraryId",
spaceId:"spaceId",
restorePathStrategy:SMHRestorePathStrategy.fallbackToRoot,
recycledItemIds:[1,2,3,4]
})
}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. Please refer to Create Tenant Space
String
No
recycledItemIds
Batch recover the collection of recycledItemId
Array
Yes
restorePathStrategy
Restoration project source path processing method, defaults to originalPath
originalPath: restore to original path, error will be reported if original path does not exist
fallbackToRoot: restore to original path, fall back to root directory if original path does not exist
SMHRestorePathStrategy
No

Deleting a Specified Recycle Bin Project

Feature Description

Delete the specified Recycle Bin project.

Sample Code

try{
let result = await SMHRecycledApis.deleteRecycledObject({
libraryId:"libraryId",
spaceId:"spaceId",
recycledItemId:312
})
}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. Please refer to Create Tenant Space
String
No
recycledItemId
Recycle Bin Project ID
Number
Yes

Batch Deleting Specified Recycle Bin Projects

Feature Description

Delete specified Recycle Bin projects in batches.

Sample Code

try{
let result = await SMHRecycledApis.batchDeleteRecycledObject({
libraryId:"libraryId",
spaceId:"spaceId",
recycledItemIds:[1,2,3,4]
})
}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. Please refer to Create Tenant Space
String
No
recycledItemIds
Batch delete the collection of recycledItemId
Array
Yes

Empty Recycle Bin

Feature Description

Empty the recycle bin.

Sample Code

try{
let result = await SMHRecycledApis.clearRecycled({
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. Please refer to Create Tenant Space
String
No

Viewing Recycle Bin File Detail

Feature Description

View file details in the Recycle Bin.

Sample Code

try{
let reuslt = await SMHRecycledApis.fileDetail({
libraryId:"libraryId",
spaceId:"spaceId",
recycledItemId:312
})
}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. Please refer to Create Tenant Space
String
No
recycledItemId
Recycle Bin Project ID
Number
Yes

Previewing Recycle Bin Projects

Feature Description

Query file information by file ID.

Sample Code

try{
let reuslt = await SMHRecycledApis.preview({
libraryId:"libraryId",
spaceId:"spaceId",
recycledItemId:312
})
}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. Please refer to Create Tenant Space
String
No
recycledItemId
Recycle Bin Project ID
Number
Yes
type
The preview method for document files: if set to "pic", preview the document homepage in JPG format; otherwise, preview it in HTML format.
SMHPreviewType
No
size
Scaling of image or video cover size. For related notes, see API description.
String
No
scale
Proportional scaling percentage for image or video cover. This parameter is valid only when Size is not specified.
String
No
widthSize
Scaling width for image or video cover. The height is scaled proportionally when not specified. This parameter is valid only when neither Size nor Scale is provided.
String
No
heightSize
Scaling height for image or video cover. The width is scaled proportionally when not specified. This parameter is valid only when neither Size nor Scale is provided.
String
No
frameNumber
Number of frames in a GIF file, frame processing targeting GIFs. This parameter is valid only when previewing GIF files.
String
No

Bantuan dan Dukungan

Apakah halaman ini membantu?

masukan