Jump to content
Welcome to our new Citrix community!
  • 0

How do I restore a root-level folder?


Steve Perkins1709163258

Question

2 answers to this question

Recommended Posts

  • 0

Hi Steve,

 

To provide some quick and detailed information on Recycle Bins, deleted items are going to show up in three (3) different Recycle Bin locations unless permanently deleted or deleted > 45 days ago. First will be the deleting users personal Recycle Bin (the one they see in the left hand navigation menu), second will be the personal Recycle Bin of the user that owns the structure the item resided in, and lastly the Recycle Bin of the parent folder itself when accessing the More Options menu. However, if it's a root level folder then that last of those won't apply as there is no parent folder. It's important to understand that while these are all titled "Recycle Bin" they are separate locations that display different items based on the aforementioned criteria(who, how, and where an item was deleted). 

 

That said, if you want to completely disregard Recycle Bins all together and restore via API, you just need to know the Item IDs to be restored and separate them by commas, surrounded by quotes, and have a leading and trailing bracket as shown below.

["FolderID1","FolderID2","FileID1","FileID2"]

The fact that you're getting a Bad Request response indicates this format is not being followed or a value that isn't a valid ItemID is being passed through. Because otherwise I would expect to see an Unauthorized or Not Found response depending on the scenario. The EventID field in a Usage Report should be exactly what you need, however, you can also use the Get Children endpoint and for an expired root level folder specify your AccountID as the parent and IncludeDeleted=true. And if you need to find your AccountID you can use the Get Account Preferences endpoint. I've listed references and examples of each of these below.

 

Get Children: https://api.sharefile.com/docs/resource?name=Items

Endpoint: /sf/v3/Items(id)/Children

Example: https://companyname.sf-api.com/sf/v3/Items(a7fa0e69-a048-2124-c13f-488e59cdda25)/Children?includeDeleted=true

 

Get Account Preferences: https://api.sharefile.com/docs/resource?name=Accounts

Endpoint: /sf/v3/Accounts/Preferences

Example: https://companyname.sf-api.com/sf/v3/Accounts/Preferences

 

Let me know if you have any questions!

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...