What is the default and maximum page size for Directory Role APIs.

linux-user 0 Reputation points
2024-03-12T10:56:56.1633333+00:00

I'm trying to integrate Directory Role API with another service.

Example: List Directory Roles
Ref: Optional Query Param

If $top is not supported with this API using, What is the default behavior from the server side for Directory Role API? Is it going to send all of the records in the response or it will paginate the response based on some default / maximum page size?

If the server paginate the response based on some default/max page size, will it send nextLink
in the response? If so then does it support skipToken?

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,447 questions
Active Directory
Active Directory
A set of directory-based technologies included in Windows Server.
6,244 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
20,629 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Harpreet Singh Matharoo 7,621 Reputation points Microsoft Employee
    2024-03-13T04:52:47.5+00:00

    Hello @linux-user ,

    Thank you for contacting Microsoft Azure QnA platform. I would like to confirm that most of the Graph API use the concept called pagination to manage the retrieval of large data sets. Same is the case with Directory Role API.

    List Directory Roles operation does not support the $top query parameter for pagination. Instead, it returns a default set of objects. At times the page length is defaulted to 999 items, This means that if there are more than 999 items, the API will return the first 1,000 roles in the initial response.

    If there are more roles to retrieve, the API includes an @odata.nextLink property in the response. This property contains a URL that you can use to retrieve the next page of results3. You should include the entire URL in the @odata.nextLink property in your request for the next page of results. More details about paging and @odata.nextLink property can be found on following document: https://learn.microsoft.com/en-us/graph/best-practices-concept#pagination

    The @odata.nextLink URL value contains a $skiptoken query parameter. The $skiptoken is an opaque value that points to the next page of results. You should not try to extract the $skiptoken value and use it in a different request.

    User's image

    Please note that the behavior of APIs can vary, and it’s always a good idea to refer to the specific API documentation for the most accurate and up-to-date information. In this case, you may refer to the Microsoft Graph documentation for more details.

    I hope this answer helps to resolve your issue. Please "Accept the answer" if the information helped you. This will help us and others in the community as well.