Using the API how can I check this? If I use the /api/2/folders/folderID I can see a <location> with contents start start with "Deleted items > ". Do I check this or is there a better way?
Using the API how can I check this? If I use the /api/2/folders/folderID I can see a <location> with contents start start with "Deleted items > ". Do I check this or is there a better way?
Ryan D'Souza. You could perhaps query the recycle bin to check if the folder you are looking for is in there?
GET .../files/?q="folderid={recyclebinfolderID} will give you list of files there
Interestingly the below folder endpoint gives me a 403 unless I use v1
3/folders/{recyclebinfolderID}/items - 403 error
1/folders/{recyclebinfolderID}/items - list of folders in recycle bin
Hope this helps
I had a concern for how to find the recycle bin id, but that is a good to know technique, thanks. The next part is, if the folder exists in the recycle bin, it may not necessarily be in the root of the bin, it could be in a nested folder, which means I would need to recursively travel down every folder in the bin to see if the target folder exists in it, right?
Hmm that is a fair point. That process sounds right but then again if you have the folder ID maybe checking its location is the best way forward? I haven't worked with the recycle bin much at all unfortunately.
I did ask the highq support team about that (checking the text in the location field in the response), and while it should work in almost all the cases, it wasn't necessarily designed for that. For example, if a person manually created a folder not in the recycle bin, but also calls it "Deleted items" and put the target folder in that, then it would result in a false positive.
I think a more efficient way for this is to check the parent folder id of the target folder, and keep repeating checking the parent folder id, until you hit the root which you then check if that is the recycle bin folder or not by comparing that recycle bin folder id.