如何获取Office365 OneDrive中包含的所有项目

问题描述:

我想通过一个rest API调用来获取office365 onedrive文件夹中包含的所有文件和文件夹,有什么选择吗?

I want to get all the files and folders contained inside a office365 onedrive folder in one rest API call, is there any option to do it?

没有特定的API调用来检索驱动器的平面表示形式.但是,可以使用驱动器的搜索方法来达到类似的效果. .

There isn't a specific API call to retrieve a flat representation of a Drive. You can achieve a similar effect however using the drive's search method.

只需传递一个空的查询字符串,它将返回每个文件的元数据(无论其目录如何):

Simply pass an empty query string and it will return metadata for each file (regardless of it's directory):

https://graph.microsoft.com/v1.0/me/drive/root/search(q='')