2017-07-14 62 views
1

對於OneDrive個人或企業,OneDrive中可能只有一個文件夾,我的應用有權訪問OneDrive,而無法訪問所有OneDrive。目前,我正在向用戶請求訪問所有Onedrive並手動設置此權限,但如果用戶不是特定的OneDrive應用程序,用戶通常不喜歡授予所有OneDrive的訪問權限。我可以在OneDrive中創建應用程序文件夾嗎?我不希望應用訪問OneDrive的所有

我覺得我已經閱讀了有關AppFolder權限,但我找不到支持文檔或正在使用的示例。

回答

2

您正在尋找的權限是Files.ReadWrite.AppFolder,它在file permissions category中有記錄。

說明:Have full access to the application's folder (preview)(Preview) Allows the app to read, create, update, and delete files in the application's folder.

一旦應用程序有此權限的訪問令牌,你的應用程序文件夾位於https://graph.microsoft.com/v1.0/me/drive/special/approot/

從這一點上傳,下載和列出文件就像其他任何文件夾一樣。例如,使用GET https://graph.microsoft.com/v1.0/me/drive/special/approot/children完成在該文件夾中列出項目。

上傳文件:

PUT https://graph.microsoft.com/v1.0/me/drive/special/approot:/foo.txt:/content

相關問題