Hi Allagadda,
I believed you are using one of the endpoint as below link to loop through the list of permissions info for each files, right? Potentially this endpoint /sites/{siteId}/drive/items/{itemId}/permissions
https://learn.microsoft.com/en-us/graph/api/driveitem-list-permissions?view=graph-rest-1.0&tabs=http
There are couple of approaches that can be done to improve the performance of getting info about permission for each item.
- Query Parameters - This will help you achieve multiple tasks such as limiting the amount of data returned by requests to Microsoft Graph such as controlling how many fields are returned for each record, how many records are returned, also filtering and searching for wanted information.
- Reduce traffic with batched requests - Use batch requests Microsoft Graph to execute multiple requests and return the grouped results for each request in a single response. Batching doesn't reduce the number of requests, but it does reduce the number of HTTP round trips your application requests to Microsoft Graph.
More details refer to this link https://learn.microsoft.com/en-us/training/modules/optimize-data-usage/
More info regarding batches request - https://learn.microsoft.com/en-us/graph/json-batching Hope this helps.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".