Search code examples
active-directoryazure-active-directorymicrosoft-graph-apiactive-directory-group

Paging the group member result


Microsoft graph API returns the correct result, but unable to perform the paging.

Is it possible with Microsoft Graph or Ad Graph?


Solution

  • This is possible in the Microsoft Graph. More info can be found in the documentation page for Paging Microsoft Graph data in your app.

    When getting the list of members, there's a @odata.nextLink property that represents the next page of results. For example, if you GET https://graph.microsoft.com/v1.0/groups/[group-id]/members the response looks like:

      { 
        "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#directoryObjects",
        "@odata.nextLink": "https://graph.microsoft.com/v1.0/groups/[group-id]/members?$skiptoken=X%2744537074070001000000000000000013233333100000000%27",
        "value": [...]    
      }
    

    You can now make another GET request to the value of the next link.