Method: files.emptyTrash
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
คำขอ HTTP
DELETE https://www.googleapis.com/drive/v3/files/trash
URL ใช้ไวยากรณ์การแปลงรหัส gRPC
พารามิเตอร์การค้นหา
พารามิเตอร์ |
enforceSingleParent (deprecated) |
boolean
เลิกใช้งานแล้ว: หากรายการไม่ได้อยู่ในไดรฟ์ที่แชร์และมีการลบระดับบนสุดสุดท้ายของรายการ แต่ไม่ได้ลบรายการนั้นเอง ระบบจะวางรายการไว้ใต้รูทของเจ้าของ
|
driveId |
string
หากตั้งค่าไว้ จะล้างข้อมูลในถังขยะของไดรฟ์ที่แชร์ที่ระบุ
|
เนื้อความของคำขอ
เนื้อหาของคำขอต้องว่างเปล่า
เนื้อหาการตอบกลับ
หากทำสำเร็จ เนื้อหาการตอบกลับจะเป็นออบเจ็กต์ JSON ที่ว่างเปล่า
ขอบเขตการให้สิทธิ์
ต้องใช้ขอบเขต OAuth ต่อไปนี้
https://www.googleapis.com/auth/drive
ขอบเขตบางอย่างถูกจำกัดและต้องมีการประเมินความปลอดภัยเพื่อให้แอปของคุณใช้ขอบเขตเหล่านั้นได้ ดูข้อมูลเพิ่มเติมได้ที่คู่มือการให้สิทธิ์
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-08-27 UTC
[null,null,["อัปเดตล่าสุด 2025-08-27 UTC"],[],[],null,["# Method: files.emptyTrash\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Query parameters](#body.QUERY_PARAMETERS)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nPermanently deletes all of the user's trashed files.\n\n### HTTP request\n\n`DELETE https://www.googleapis.com/drive/v3/files/trash`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Query parameters\n\n| Parameters ||\n|----------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `enforceSingleParent` **(deprecated)** | `boolean` Deprecated: If an item is not in a shared drive and its last parent is deleted but the item itself is not, the item will be placed under its owner's root. |\n| `driveId` | `string` If set, empties the trash of the provided shared drive. |\n\n### Request body\n\nThe request body must be empty.\n\n### Response body\n\nIf successful, the response body is an empty JSON object.\n\n### Authorization scopes\n\nRequires the following OAuth scope:\n\n- `https://www.googleapis.com/auth/drive`\n\nSome scopes are restricted and require a security assessment for your app to use them. For more information, see the [Authorization guide](/workspace/guides/configure-oauth-consent)."]]