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

Batch Deletion

PDF
フォーカスモード
フォントサイズ
最終更新日: 2026-01-07 11:03:08

Introduction

This document provides the API overview for deleting directories or files in batches and SDK sample code.
API
Operation Description
Batch delete directories or files

Batch Delete Catalog or File

Feature Overview

Delete directories or files in batches.
When projects are replicated asynchronously in large numbers, return HTTP 202 Accepted. When projects are replicated synchronously in small numbers, return HTTP 200 OK (all execution successful) or HTTP 207 Multi-Status (part or all execution failed).

Example Code

Start batch deletion
try {
//Files or folders to delete in batches
val items: List<BatchDeleteItem> = listOf(
BatchDeleteItem(
//File or directory path
"filePath",
//whether to permanently delete
true
),
BatchDeleteItem("dirPath", false)
)
//return batch operation result
//if it is synchronously return: get result content directly from batchResponse.result
//If it is asynchronously returned: need to call the Query Task API to obtain the result content (generally poll the query job until the task result is queried)
val batchResponse: BatchResponse = smh.batchDelete(
items = items
)
} catch (e: Exception) {
e.printStackTrace()
}
Query job For detailed usage, refer to asynchronous processing.

ヘルプとサポート

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

フィードバック