我試圖通過Getting access without a user微軟圖形API - /光驅/根/兒童總是空的,即使我在有文件我onedrive
使用微軟圖形API來List Children我建立了我的網址,你會預計:
https://graph.microsoft.com/v1.0/edffcd1c-e5b2-42f2-b554-XXXXXXXXX/drive/root/children
凡edffcd1c-e5b2-42f2-b554-XXXXXXXXX
是誰我想列出文件的用戶ID。
然而,當我把這個我每次都得到一個空的結果:
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#drive/root/children",
"value": []
}
這是爲什麼?
更新:似乎這個API只是從Sharepoint帳戶...不是OneDrive帳戶返回文件。我已經可以從Sharepoint API本身訪問Sharepoint文件。有沒有辦法從Microsoft Graph API獲取OneDrive文件?
此網址https://dev.onedrive.com/README.htm似乎說明我們應該能夠做到這一點。
您是否試圖使用'userPrincipalName'而不是'id'?例如:'/ users/rgregg @ contoso.com/drive/root/children'。 –
是的,這只是讓它拋出一個錯誤「資源找不到該段」。我跟微軟談過......這個api只支持通過app-only用戶的sharepoint文件,我猜。總垃圾 –