ShareFile API - How to return a treeview of a folder

  • 1
  • Question
  • Updated 6 days ago
Currently, the only way we've been able to retrieve all the children of a folders, are through recursively calling the API. This is a slow and cumbersome process and there's many folders deeply embedded. Is there an endpoint or quick way to retrieve the entire tree view of a folder, including all the children.
Photo of Calvin

Calvin

  • 5 Posts
  • 0 Reply Likes

Posted 2 weeks ago

  • 1
Photo of Keith Rachunok

Keith Rachunok

  • 10 Posts
  • 1 Reply Like
Calvin,

Recursion is the only way I've gotten to work.  There is a call Get TreeMode that sounds like it should but I've not gotten it to work nor seen an example.  It also appears that the API does not support the ODATA expand ($levels=max) or at least I couldn't figure out how to make that work either.  So, recursion.  One change I've made recently is to expand Childern, in c#, or -Navigation Children, in PowerShell, to get one additional level and then only select the needed fields to speed things up.
Photo of Calvin

Calvin

  • 5 Posts
  • 0 Reply Likes
I didn't realize you also reply to this post. I am already doing one layer expand Children. But it's extremely slow, since there's many folders and could be many layers. ShareFile should really optimize their endpoints.