Does ListPermissions API return all the permissions in a single API call?

User123098 41 Reputation points
2024-01-10T09:07:54.2166667+00:00

Hi Team,

Does ListPermissions API return all the permissions on a drive item in a single API call or only a certain number of permissions are returned in response and we need to issue paginated API calls to retrieve all permissions?

If all permissions are not returned in a single call, what is the max page size supported and how we get the next page token?

Thanks!!

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,992 questions
{count} votes

Accepted answer
  1. CarlZhao-MSFT 45,021 Reputation points
    2024-01-11T07:51:23.44+00:00

    Hi @User123098

    It returns 200 permission objects per page by default. If your result set is greater than 200, it will automatically paginate. It will also return you an '@odata.nextLink' for getting the next page of data.

    However, you can also use the $top query parameter to specify the number of permission objects returned per page, up to a maximum of 1000.

    GET /me/drive/items/{item-id}/permissions?$top=999
    

    Hope this helps.

    If the reply is helpful, please click Accept Answer and kindly upvote it. If you have additional questions about this answer, please click Comment.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

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