Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

Office 365 Files REST API - Get direct children in the root of the default document library

$
0
0

I'm trying to work with Office 365 Files REST API which works just fine except one thing that I'm struggling with.

What I need for my application is to make an explorer like browse capability for OneDrive for business Document Library.

My problem is that I don't know how to get the direct children in the root of the Document library

The API request GET ../_api/files will retrieve all files and folders in the default document library, including files and folders from sub-directories.

What I need is basically the functionality of the API request GET ../_api/files(<folder_path>)/Children that works also for the root folder of the Document library. The problem is that I couldn't find a way set <folder_path> as the root folder. 

I found out that the API call ../_api/web/getfolderbyserverrelativeurl(<folder_server_relative_path>)/Folders and _api/web/getfolderbyserverrelativeurl(<folder_server_relative_path>)/Files works as expected resulting the only the direct children of the root folder if the folder_server_relative_path is the path of the document library. The problem with this API call is that it's requires server relative path of the (default) document library (which i don't have) and the result has a different schema compared to the ../_api/files REST API call.

Can somebody help me with this problem?


David



Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>