我想获取文档库中“Forms”文件夹的属性,但收到 404 NotFound。
GET https://graph.microsoft.com/v1.0/drives/b!PQz7QSyZm0-bePWjkO6mFndUpviN2NFGq-vEw0NG40IxzH03FdAMSbRgePxu7s5Z/items/01BL4KB4V6Y2GOVW7725BZO354PWSELRRZ:/Forms
404 NotFound
{
"error": {
"code": "itemNotFound",
"message": "The resource could not be found.",
"innerError": {
"date": "2023-05-29T08:25:45",
"request-id": "2cef83cf-70f6-46dd-aa2e-390f6b58370c",
"client-request-id": "365f9753-726c-e908-8844-b9acca7778a9"
}
}
}
但是,如果我尝试创建“Forms”文件夹,我将收到 400 BadRequest
POST https://graph.microsoft.com/v1.0/drives/b!PQz7QSyZm0-bePWjkO6mFndUpviN2NFGq-vEw0NG40IxzH03FdAMSbRgePxu7s5Z/items/01BL4KB4V6Y2GOVW7725BZO354PWSELRRZ/children
{
"name": "Forms",
"folder": {}
}
400 BadRequest
{
"error": {
"code": "invalidRequest",
"message": "Name is reserved for list forms folder.",
"innerError": {
"date": "2023-05-29T08:27:37",
"request-id": "5756c48e-1d9f-4bdd-8a02-f598cd69d257",
"client-request-id": "1234c89f-58b2-60b3-7fe8-f1c5ec2eaefd"
}
}
}
如何获取“Forms”文件夹?
--
文档库的网址是
https://xxxxx.sharepoint.com/sites/wen-public/Shared%20Documents
,以及文档库中的项目
在文档库中创建“Forms”文件夹将获得 HTTP 400,获取“Forms”文件夹将获得 HTTP 404。
--
尝试将端点中的
drive
替换为site
GET https://graph.microsoft.com/v1.0/sites/41fb0c3d-992c-4f9b-9b78-f5a390eea616,f8a65477-d88d-46d1-abeb-c4c34346e342/drive/root/children
HTTP 200 // responded 11 folders in the screenshot above
-
GET https://graph.microsoft.com/v1.0/sites/41fb0c3d-992c-4f9b-9b78-f5a390eea616,f8a65477-d88d-46d1-abeb-c4c34346e342/drive/root://:/children
HTTP 200 // responded 11 folders in the screenshot above
-
GET https://graph.microsoft.com/v1.0/sites/41fb0c3d-992c-4f9b-9b78-f5a390eea616,f8a65477-d88d-46d1-abeb-c4c34346e342/drive/root:/General:/children
HTTP 200
-
GET https://graph.microsoft.com/v1.0/sites/wen-public/drive/root/children
HTTP 400
{
"error": {
"code": "invalidRequest",
"message": "Invalid hostname for this tenancy",
"innerError": {
"date": "2023-05-30T09:43:13",
"request-id": "37d3b218-2372-438b-8a35-eb31370db4d8",
"client-request-id": "42e91019-d248-ae6f-0447-51411e57e792"
}
}
}
-
GET https://graph.microsoft.com/v1.0/sites/41fb0c3d-992c-4f9b-9b78-f5a390eea616,f8a65477-d88d-46d1-abeb-c4c34346e342/drive/root:/Forms:/children
HTTP 404
{
"error": {
"code": "itemNotFound",
"message": "The resource could not be found.",
"innerError": {
"date": "2023-05-30T09:46:00",
"request-id": "1081e9eb-128d-47ce-a9ec-2295612e3a4e",
"client-request-id": "bca1e92e-5361-5717-a1f0-457f2f7ddc07"
}
}
}
您找到解决问题的方法/解决方案了吗?我这里也有完全相同的情况。我想要使用 MS Graph 获取“Forms”文件夹。
非常感谢您的帮助!