-
Notifications
You must be signed in to change notification settings - Fork 142
Requesting OneDrive Quota #97
Comments
Added to the list for documentation requests. Essentially, quota details are returned on the Drive object and the Size property of an includes the size of the item itself and any children within it. Here are some examples of accessing these values: Get quota details for a drive var drive = client.Drive.Request().GetAsync();
var quotaRemaining = drive.Quota.Remaining;
var quotaTotal = drive.Quota.Total;
var quotaUsed = quotaTotal - quotaRemaining; Get space used by appfolder var appRoot = await client.Drive.Special.AppRoot.Request().GetAsync();
var appRootSize = appRoot.Size; |
Thank you very much for the answer. When you add this to documentation, may I suggest two slight changes:
|
When I try to get the Drive quota, the Quota facet is coming back as null. If it makes a difference, my client is just requesting access to its app folder, and is using the following permission scopes: Should I be able to see the quota, or do I need to request another permission for that? With the upcoming quota changes for OneDrive itself, I expect a lot of users will be running into quota issues. I'd like to be able to detect these in advance, so I can inform the users before failing to upload. |
Okay, as a follow-up... Adding the scope "onedrive.readonly" is sufficient to make quota information appear. Hopefully this won't make anything look suspect to a user, when the app really only needs access to its own app folder. |
Thank you for reaching out and for your patience. This SDK is being officially deprecated. See #259 for more information |
Can we have example code in samples to show the following:
The text was updated successfully, but these errors were encountered: