Share via

Graph API - Clarification on DriveItem Permissions Resource Unit Cost Discrepancy

Frederik-8475 20 Reputation points
2024-10-23T10:29:07.0333333+00:00

Hello,

In working with the Graph API we have created a rate limiting application, which will throttle our MS Graph requests before we get 429 responses - which means we need to be aware of the resource unit costs of the requests we make.

Based on the documentation here I expected /drives/{drive-id}/items/{item-id}/permissions to have a resource unit cost of 5. However, upon testing this by making enough requests to receive responses with RateLimit headers, I saw the RateLimit-Remaining header value drop by 6 between requests. I feel this would indicate a cost of 6 resource units per request.

For the tests I made my requests through the Graph API .NET SDK (version 5.61.0) like so:

await graphServiceClient.Drives[driveId].Items[driveItemId].Permissions.GetAsync((config) =>
{
    config.QueryParameters.Top = PageSize;
});

Essentially my question is, what is the actual resource unit cost of /drives/{drive-id}/items/{item-id}/permissions ? And if my observations were correct, why would it be 6 instead of 5 considering what the documentation says?

Furthermore, I tried running the same tests, but adding Select to the config:

config.QueryParameters.Select = [nameof(Microsoft.Graph.Models.Permission.Id)];

This resulted in the same drop of 6 remaining resource units between requests, where I would now have expected to see a drop of 5 according to this documentation, stating that the $select query parameter should reduce resource unit cost by 1. Does this mean that the SharePoint Online resource unit costs are not affected by using the $select query parameter?

Microsoft Security | Microsoft Graph
0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.