Join the first BoxWorks Hackathon for Good - customers, partners, and the developer community are welcome to participate in the 48 hour Hack to benefit The Nature Conservancy.

Learn more and register!

Searching trash

Searching trash

By default, any content in the user's trash is ignored in the search results. To search the user's trash, the trash_content query parameter can be set to trashed_only.

curl -i -X GET "" \
     -H "Authorization: Bearer <ACCESS_TOKEN>"
long offsetValue = 0;
long limitValue = 10;

BoxSearch boxSearch = new BoxSearch(api);
BoxSearchParameters searchParams = new BoxSearchParameters();

PartialCollection<BoxItem.Info> searchResults = boxSearch.searchRange(offsetValue, limitValue, searchParams);
BoxCollection<BoxItem> results = await client.SearchManager
    .QueryAsync("sales", mdFilters: filters, trashContent: "trashed_only");
Python"sales", metadata_filters=metadata_search_filters, trash_content="trashed_only")
    trash_content: "trashed_only"
  .then(results => {
    // ...

Currently the API only supports searching for content not in the trash (non_trashed_only, default) or in the user's trash (trashed_only). It is currently not possible to search for items in both locations at once.