我正在尝试使用JavaScript中的Excel Graph API来更新存储在SharePoint中的Excel文件。从我看到的信息中,我需要文档的OneDrive ID。
https://graph.microsoft.com/ {version} / me / drive / items / {id} / workbook /
我从SpHttpClient获得了所有SharePoint元数据,如何获得OneDrive ID?
最后感谢Toni Pohl弄明白了这个>
如果您拥有SharePoint URL,只需将/ list替换为/ drives即可获得OneDrive内容。
https://graph.microsoft.com/v1.0/sites/xxxx.sharepoint.com:/sites/yyyy:/lists?$select=name,id https://graph.microsoft.com/v1.0/sites/xxxx.sharepoint.com:/sites/yyyy:/drives?$select=name,id
获取
{ "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#Collection(microsoft.graph.list)(name,id)", "value": [ { "@odata.etag": "\"57583463-1579-4237-a909-2f99727b188a,5\"", "id": "57583463-1579-4237-a909-2f99727b188a", "name": "Shared Documents" }, { "@odata.etag": "\"4c00f5ba-2e73-475a-b027-ae1597bf16ab,7\"", "id": "4c00f5ba-2e73-475a-b027-ae1597bf16ab", "name": "DocumentTemplates" }, ] } { "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#drives(name,id)", "value": [ { "id": "b!5V21gHgALUSQCeWNdx-VSP8SCmeUW3dHqSOlJMbYv2RjNFhXeRU3QqkJL5lyexiK", "name": "Documents" }, { "id": "b!5V21gHgALUSQCeWNdx-VSP8SCmeUW3dHqSOlJMbYv2S69QBMcy5aR7AnrhWXvxar", "name": "DocumentTemplates" }, ] }
[为了哭泣,微软!!!为什么没有对此进行记录。