Retrieves a file that has been moved to the trash.
12345
The unique identifier that represent a file.
The ID for any file can be determined
by visiting a file in the web application
and copying the ID from the URL. For example,
for the URL https://*.app.box.com/files/123
the file_id
is 123
.
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.
Returns the file that was trashed, including information about when the it was moved to the trash.
Returns an error if the file is not in the trash.
An unexpected client error.
curl -X GET https://api.box.com/2.0/files/12345/trash \
-H 'Authorization: Bearer <ACCESS_TOKEN>'
BoxFile trashedFile = await client.FilesManager.GetTrashedAsync("11111");
String fileID = "9873459";
BoxTrash trash = new BoxTrash(api);
BoxFile.Info fileInfo = trash.getFileInfo(fileID);
file_to_retrieve = client.file(file_id='11111')
file_from_trash = client.trash().get_item(file_to_retrieve)
print('File ID is {0} and name is {1}'.format(file_from_trash.id, file_from_trash.name))
client.files.getTrashedFile('11111')
.then(trashedFile => {
/* trashedFile -> {
type: 'file',
id: '11111',
sequence_id: '2',
etag: '2',
sha1: '4bd9e98652799fc57cf9423e13629c151152ce6c',
name: 'Screenshot_1_30_13_6_37_PM.png',
description: '',
size: 163265,
path_collection:
{ total_count: 1,
entries:
[ { type: 'folder',
id: '1',
sequence_id: null,
etag: null,
name: 'Trash' } ] },
created_at: '2013-01-30T18:43:56-08:00',
modified_at: '2013-01-30T18:44:00-08:00',
trashed_at: '2013-02-07T10:49:34-08:00',
purged_at: '2013-03-09T10:49:34-08:00',
content_created_at: '2013-01-30T18:43:56-08:00',
content_modified_at: '2013-01-30T18:44:00-08:00',
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' },
owned_by:
{ type: 'user',
id: '33333',
name: 'Example User',
login: 'user@example.com' },
shared_link: null,
parent:
{ type: 'folder',
id: '0',
sequence_id: null,
etag: null,
name: 'All Files' },
item_status: 'trashed' }
*/
});