How to include delete files when querying files via api?

  • 1
  • Question
  • Updated 1 week ago
I need to download files in ShareFile, but I need to consider deleted files as well while in the recycle bin.

For not deleted files "GET /sf/v3/Items({id})/Download?redirect=false" works fine.
The ShareFile API documentation mentions "includeDeleted=false" so I tried add it to my initial url ("GET /sf/v3/Items({id})/Download?redirect=false&includeDeleted=true") but now for all requests made I got 404.

Do I need any special permission for querying archived files?

Thanks,

Gustavo

Photo of Gustavo

Gustavo

  • 8 Posts
  • 1 Reply Like

Posted 1 week ago

  • 1
Photo of Andy Berryman

Andy Berryman, Software Engineer

  • 27 Posts
  • 7 Reply Likes
You will have to restore the files from the recycle bin before you can download them.  You can still get the metadata for a file that is in the recycle bin by using the "includeDeleted" option.

-Andy
Photo of Gustavo

Gustavo

  • 8 Posts
  • 1 Reply Like
Oh I see. I thought that would be possible since on ShareFile documentation for downloading item content the url below is used:

/sf/v3/Items(id)/Download?includeallversions=false&includeDeleted=false

My guess was that using true on includeDeleted and/or true on includeallversions should give me the file I need.

Is that possible to restore the deleted file to a different folder other than its original folder?

Thanks,

Gustavo

(Edited)
Photo of Andy Berryman

Andy Berryman, Software Engineer

  • 27 Posts
  • 7 Reply Likes
No ... Restore will send the file/folder back to the parent folder where it was originally deleted.  If you desire for it to be somewhere else then you would need to restore it then move it.

-Andy