是否有一种方法可以递归地将子(孙子)的内容包含在Microsoft Graph中的一个请求中
我希望查询文件夹/foo/,并获取/foo/baar/的内容,例如/foo/baar/baz.txt。
IGraphServiceClient graphClient = GraphServiceClient
.builder()
.authenticationProvider(authProvider)
.buildClient();
IDriveItemCollectionPage children = graphClient
.drives("{drive-id}")
.items("{item-id}")
.children()
.buildRequest()
.expand("children")
.get();使用children展开查询将返回一个com.microsoft.graph.http.GraphFatalServiceException: Unexpected exception returned from the service.Error code: notSupported
这将大大提高我的要求的执行情况。
编辑:刚刚创建了一个特性请求:列出包括孙子女在内的子女
发布于 2020-03-01 02:04:38
expand不可能获得超过一个级别的文件。在Microsoft文档的已知问题部分中提到了这一点。
但是我们可以使用搜索递归地获取所有文件和文件夹。
使用Q=‘’(空查询搜索)搜索,这将返回搜索范围中的所有文件和文件夹。有关范围特定的搜索,请参阅此回答。您可以使用parentReference键来分类哪个文件属于哪个文件夹。
示例1:下面的查询检索根作用域中的所有文件和文件夹
https://graph.microsoft.com/v1.0/me/drive/root/search(q='')?$select=name,id,parentReference示例2:在根文件夹中的名为“temp”的文件夹中搜索
https://graph.microsoft.com/v1.0/me/drive/root:/temp:/search(q='doc')?$select=name,id,parentReference搜索的限制(截至目前)
https://stackoverflow.com/questions/60440298
复制相似问题