Box Developer Documentation

Join BoxWorks 2024 to discover what's possible with content and AI!

Register now!

Get trashed folder

get
https://api.box.com/2.0
/folders/:folder_id/trash

Retrieves a folder that has been moved to the trash.

Please note that only if the folder itself has been moved to the trash can it be retrieved with this API call. If instead one of its parent folders was moved to the trash, only that folder can be inspected using the GET /folders/:id/trash API.

To list all items that have been moved to the trash, please use the GET /folders/trash/items API.

Request

bearer [ACCESS_TOKEN]
application/json

Path Parameters

stringin pathrequired
12345

The unique identifier that represent a folder.

The ID for any folder can be determined by visiting this folder in the web application and copying the ID from the URL. For example, for the URL https://*.app.box.com/folder/123 the folder_id is 123.

The root folder of a Box account is always represented by the ID 0.

Query Parameters

string arrayin queryoptional
id,type,name

A comma-separated list of attributes to include in the response. This can be used to request fields that are not normally returned in a standard response.

Be aware that specifying this parameter will have the effect that none of the standard fields are returned in the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested.

Response

application/jsonTrashed Folder

Returns the folder that was trashed, including information about when the it was moved to the trash.

application/jsonClient error

Returns an error if the folder can not be found directly in the trash.

Please note that a HTTP 404 is also returned if any of the folder's parent folders have been moved to the trash.

In that case, only that parent folder can be inspected using the GET /folders/:id/trash API.

application/jsonClient error

An unexpected client error.

get
Get trashed folder
You can now try out some of our APIs live, right here in the documentation.
Log in

Request Example

cURL
curl -i -X GET "https://api.box.com/2.0/folders/4353455/trash" \
     -H "authorization: Bearer <ACCESS_TOKEN>"
TypeScript Gen
await client.trashedFolders.getTrashedFolderById(folder.id);
Python Gen
client.trashed_folders.get_trashed_folder_by_id(folder.id)
.NET Gen
await client.TrashedFolders.GetTrashedFolderByIdAsync(folderId: folder.Id);
Swift Gen (Beta)
try await client.trashedFolders.getTrashedFolderById(folderId: folder.id)
Python
folder = client.folder(folder_id='22222')
folder_from_trash = client.trash().get_item(folder)
print(f'Folder ID is {folder_from_trash.id} and name is {folder_from_trash.name}')
.NET
BoxFolder trashedFolder = await client.FoldersManager.GetTrashedFolderAsync("22222");
Node
client.folders.getTrashedFolder('22222')
	.then(trashedFolder => {
		/* trashedFolder -> {
			type: 'folder',
			id: '22222',
			sequence_id: '1',
			etag: '1',
			name: 'Old Files',
			created_at: '2013-05-06T22:37:30-07:00',
			modified_at: '2013-05-06T22:39:08-07:00',
			description: '',
			size: 18482,
			path_collection: 
			{ total_count: 1,
				entries: 
				[ { type: 'folder',
					id: '1',
					sequence_id: null,
					etag: null,
					name: 'Trash' } ] },
			created_by: 
			{ type: 'user',
				id: '33333',
				name: 'Example User',
				login: 'user@example.com' },
			modified_by: 
			{ type: 'user',
				id: '33333',
				name: 'Example User',
				login: 'user@example.com' },
			trashed_at: '2013-05-29T09:37:13-07:00',
			purged_at: null,
			content_created_at: '2013-05-06T22:37:30-07:00',
			content_modified_at: '2013-05-06T22:39:08-07:00',
			owned_by: 
			{ type: 'user',
				id: '33333',
				name: 'Example User',
				login: 'user@example.com' },
			shared_link: null,
			folder_upload_email: null,
			parent: 
			{ type: 'folder',
				id: '0',
				sequence_id: null,
				etag: null,
				name: 'All Files' },
			item_status: 'trashed' }
		*/
	});

Response Example

{
  "id": "123456789",
  "type": "folder",
  "content_created_at": "2012-12-12T10:53:43-08:00",
  "content_modified_at": "2012-12-12T10:53:43-08:00",
  "created_at": "2012-12-12T10:53:43-08:00",
  "created_by": {
    "id": "11446498",
    "type": "user",
    "login": "ceo@example.com",
    "name": "Aaron Levie"
  },
  "description": "Legal contracts for the new ACME deal",
  "etag": "1",
  "folder_upload_email": "null",
  "item_status": "trashed",
  "modified_at": "2012-12-12T10:53:43-08:00",
  "modified_by": {
    "id": "11446498",
    "type": "user",
    "login": "ceo@example.com",
    "name": "Aaron Levie"
  },
  "name": "Contracts",
  "owned_by": {
    "id": "11446498",
    "type": "user",
    "login": "ceo@example.com",
    "name": "Aaron Levie"
  },
  "parent": {
    "id": "12345",
    "type": "folder",
    "etag": "1",
    "name": "Contracts",
    "sequence_id": "3"
  },
  "path_collection": {
    "entries": [
      {
        "type": "folder",
        "id": "123456789",
        "sequence_id": "null",
        "etag": "null",
        "name": "Trash"
      }
    ],
    "total_count": 1
  },
  "purged_at": "2012-12-12T10:53:43-08:00",
  "sequence_id": "3",
  "shared_link": "null",
  "size": 629644,
  "trashed_at": "2012-12-12T10:53:43-08:00"
}