使用Microsoft Graph API从SharePoint Online获取文件

问题描述 投票:0回答:1

学习图形API时,我试图使用Microsoft Graph API从SharePoint文档库中获取文件。

我首先尝试从Documents访问https://graph.microsoft.com/v1.0/sites/tenant.sharepoint.com中的文件

通过执行此GET请求:

https://graph.microsoft.com/v1.0/sites/tenant.sharepoint.com/drive/root:/Test:/children

一切正常,然后我尝试从同一租户中的另一个站点访问文档。我告诉自己,遵循Microsoft文档时,这是相同的途径。

我首先发出了一个测试请求,以确保我可以首先访问我的网站;这是我所做的;

https://graph.microsoft.com/v1.0/sites/tenant.sharepoint.com:/sites/ObserveTestSite

执行该查询时,我收到了200 OK响应。

然后我尝试访问驱动器Documents,这是我所做的;

https://graph.microsoft.com/v1.0/sites/tenant.sharepoint.com:/sites/ObserveTestSite:/drive

再次一切正常。

然后我使用root关系,后跟目录名称,然后是children关系;这是我的要求:

https://graph.microsoft.com/v1.0/sites/mediametrie.sharepoint.com:/sites/ObserveTestSite:/drive/root:/Test:/children

但是执行该命令时,我得到了Bad Request - 400 - 96ms

请帮助。

谢谢

sharepoint microsoft-graph microsoft-graph-files
1个回答
0
投票
© www.soinside.com 2019 - 2024. All rights reserved.