Skip to main content
Question

API - get files from trashed folder

  • May 22, 2025
  • 3 replies
  • 24 views

Forum|alt.badge.img

Has anyone had success getting files from a trashed folder using the API? I'm following this documentation: https://developer.box.com/reference/get-folders-id-trash

Using the endpoint /folders/{folder_id}/trash/ based on the docs I expect to receive a list of files in the response that looks like the following:

"item_collection": {
    "entries": [
      {
        "id": 12345,
        "etag": 1,
        "type": "file",
        "sequence_id": 3,
        "name": "Contract.pdf",
        "sha1": "85136C79CBF9FE36BB9D05D0639C70C265C18D37",
        "file_version": {
          "id": 12345,
          "type": "file_version",
          "sha1": "134b65991ed521fcfe4724b7d814ab8ded5185dc"
        }
      }
    ]

However the actual response I'm seeing does not include this property. I tried including item_collection as part of the fields query parameter but that did not work either.

Any thoughts?

3 replies

Forum|alt.badge.img

Hi, 

It looks like our documentation is incorrect. The trash api doesn't let you look at the deleted files within a deleted folder. I will get the documentation updated. 

Thanks, 

Alex, Box Developer Advocate


Forum|alt.badge.img

Hi Alex,

How can i download all files in trashed directory folder named "ABC" using API?

 

Thanks


Forum|alt.badge.img

Hi. You cannot do that. You have to restore the folder -> then download. Thanks.