You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

SharePoint Graph API按文件夹名称过滤查询Drive Items返回空值问题求助

SharePoint Graph API按文件夹名称过滤查询Drive Items返回空值问题求助

我现在遇到个棘手的问题:我需要获取SharePoint文件夹的Drive Item ID,这样才能往这个文件夹里上传文件。其中一个SharePoint站点完全正常,但另一个站点返回的结果总是空的,有没有大佬知道这是为啥啊?

我用的Graph API GET请求格式是这样的:

https://graph.microsoft.com/v1.0/sites/{site-id}/drives/{drive-id}/Items?$filter= Name eq '{foldername}'

这里的site-id和drive-id都是我之前通过其他查询获取到的正确ID。

在正常的那个站点上,我能收到这样的响应(我需要从中提取id字段):

{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#sites('{site-id}')/drives('{drive-id}')/items",
"value": [
{
"@odata.etag": ""{guid},2"",
"createdDateTime": "2024-09-02T12:41:17Z",
"eTag": ""{guid},2"",
"id": "{driveitemid}",
...
}
]
}

但在出问题的站点上,返回的value数组就是空的——明明那个文件夹确实存在啊!有没有人遇到过类似情况,或者能给点排查方向?

备注:内容来源于stack exchange,提问作者Sigrun

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.15 14:28:07