简体   繁体   中英

How do I create files in an AppFolder in OneDrive for Business using the Microsoft Graph API?

I have a custom Azure AD App, "Microsoft Graph Test", with the Files.ReadWrite.AppFolder delegated permission. Based on the Graph API Reference for special folders , I believe that GET https://graph.microsoft.com/v1.0/me/drive/special/approot should be creating an AppFolder for my app if it doesn't already exist. However, when I execute the request (using the Graph Explorer from the Excel Graph Sample ) I see a 401 Unauthorized response.

If I give the app the Files.ReadWrite scope, the same command results in a 200 OK result that creates a folder in OneDrive for Business at Apps/Microsoft.Azure.AgregatorService .

Based on this, I have two questions:

  1. What Microsoft Graph operations does the Files.ReadWrite.AppFolder scope enable?
  2. How can I create and access an AppFolder using the Files.ReadWrite.AppFolder scope?

The Files.ReadWrite.AppFolder scope is invalid and shouldn't be used. I've opened a bug to get the documentation fixed to remove this reference. Right now through Microsoft Graph you need to request Files.ReadWrite permissions to use app folders.

I'm investigating the issue where the app folder name was created as AgregatorService instead of your app's actual name.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM