4

I'm attempting to use the Graph API to select all folders and files for a SharePoint location.

I can use the following call to get a list of all driveItems (folders and files) in a location:

/drives/{drive-id}/root/children

I can extend this call to make it so it returns only items with the "folder" facet, meaning I can select all driveItems that are folders in this location:

drives/{drive-id}/root/children?$filter=folder ne null

What I want now is to be able to extend the original call so that it selects all driveItems with the "file" facet only. e.g. something like:

/drives/{drive-id}/root/children?$filter=file ne null

However, my experience with the Graph explorer suggests that nothing is supported that will allow me to do this.

Can anyone tell me any possible method for doing this? Hopefully using some OData parameters on /drives rather than using sites/(siteId)/lists(listId)/items - if this method were to be used, how then could i filter out Document Sets from the results?

Marc LaFleur
  • 31,987
  • 4
  • 37
  • 63
L Bundy
  • 73
  • 4

0 Answers0