I need to enum directories and documents in SP 2013. I need only those the user works with (no system or web files) To get initial lists omitting non-user ones I inquire
/_api/Web/Lists?$filter=BaseType+eq+1 and Hidden+eq+false and IsPrivate+eq+false and IsCatalog+eq+false
Than - what to do better? I have 2 options:
Get
/_api/Web/Lists(guid'GUID')/Items
, chose those withFileSystemObjectType eq 0
for files andFileSystemObjectType eq 1
for folders, and then arrange folders into tree using relative paths (e.g. for folder1="/A/B" and folder2="/A/B/C" assume that folder2 lays inside folder1)
PS: filtering with neither/_api/Web/Lists(guid'GUID')/Items?$filter=FileSystemObjectType eq 0
nor/_api/Web/Lists(guid'GUID')/Items?$filter=FileSystemObjectType+eq+0
does not work for meGet
/_api/Web/Lists(guid'GUID')/RootFolder
and continue navigating with
/_api/Web/GetFolderByServerRelativeUrl(FOLDER_PATH)/Folders
,
/_api/Web/GetFolderByServerRelativeUrl(FOLDER_PATH)/Files
and
/_api/Web/GetFileByServerRelativeUrl(FOLDER_PATH)
Any other option?
2-nd is easier but I doubt if there can be some non-user files inside the folders. If not - I would prefer 2.
Thank you