Add the power of the Box AI API to your custom apps at Content Cloud Summit on May 15

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.