GetBucketTrash
Updated at:2025-11-03
API description
This API retrieves the bucket trash status and returns the current trash directory name, which defaults to .trash. The user must be the owner of the source bucket with FULL_CONTROL permission and also the owner of the target bucket.
Request
-
Request syntax
GET /?trash HTTP/1.1
Host: .bj.bcebos.com Date: Date
Authorization: AuthorizationString
-
Request headers
No special header parameters
-
Request elements
None
Response
| Name | Description |
|---|---|
| trashDir | The trash path name, with a length limit. Optional. It defaults to .trash if empty. |
The response results are explained as follows:
| Result | http status | error code | Description |
|---|---|---|---|
| Succeeded | 200 | - | - |
| The bucket does not exist | 404 | NoSuchBucket | - |
| The trash function is disabled | 404 | NoSuchTrashDirectory | - |
| No permission | 403 | AccessDenied | Only the bucket owner with FULL_CONTROL permission can perform this operation. |
Example
-
Request example
Plain Text1GET /?trash HTTP/1.1 2Host: bucket.bj.bcebos.com 3x-bce-date: date 4Authorization: AuthorizationString -
Response example
Plain Text1HTTP/1.1 200 OK 2x-bce-request-id: 4db4b34d-653d-4d9a-b49b-3049ca786409 3Date: Wed, 31 May 2017 08:34:40 GMT 4Content-Length: request-body-length 5Content-Type: application/json; charset=utf-8 6Server: BceBos 7Connection: keep-alive 8{ 9"trashDir": ".trash/" 10}
