BulkRestore throws permission denied exception

  • 1
  • Problem
  • Updated 1 year ago
  • (Edited)
Using the ShareFile Java SDK 3.1.5 I get an SFServerException while trying to restore documents using the bulkRestore method: 

apiClient.items().bulkRestore(new ArrayList<>(Collections.singletonList(itemId))).execute(); 

The following exception is thrown when passing a documentId as itemId:
com.citrix.sharefile.api.exceptions.SFServerException: Authorization failed: Item.You are not authorized to perform this operation.

However, this works perfectly when passing a folderId. Why is this? Is it intended?

Photo of Camilla Stenberg

Camilla Stenberg

  • 1 Post
  • 0 Reply Likes

Posted 1 year ago

  • 1
Photo of Nick Nicholls

Nick Nicholls, Software Engineer

  • 23 Posts
  • 2 Reply Likes
By documentId, you are referring to a ShareFile File Id?
In general, that should be fine. Do you still have access (upload/download/delete) to the folder that the deleted item was originally uploaded to?
If you want to rule out any auth issues, you can create a new folder, upload a file to it, delete the file, and then restore it. If that still doesn't work, then we can try some other things.