1

I am using Azure AD graph api to get all users of the organization. Using following get request to get all users

https://graph.windows.net/contoso.com/users?api-version=1.6

I am able to retrieve users using paging with the help of parameter $skiptoken

Is it possible to fire multiple such GET request without using $skiptoken and each GET request will return 1000 users.

For example
GET req 1 will retrieve users from 1 to 999

GET req 2 will retrieve users from 1000 to 1999

GET req 3 will retrieve users from 2000 to 2999

In short, I want to execute those requests over multiple threads instead of going sequentially when "$skiptoken" is used.

sagar
  • 1,900
  • 5
  • 30
  • 45

1 Answers1

1

You cannot achieve that in other ways.

According to your question, I think we can filter users with $top,like this:

Request:

GET https://graph.windows.net/myorganization/users?$orderby=displayName&$top=999&api-version=1.6

It returns a list of the first 999 users ordered by their display name.

However, it cannot filter the next 1000-1999 users just by the API when you filter top 1999 users, you need to filter by yourself. Because AAD Graph API doesn't support the option like $skip.

But in this way, you can find the which user is the 1000th user and get the rest part users .

For more details about Supported queries, filters, and paging option in Azure AD Graph API, you can refer to this document.

You can also post your idea in this UserVoice Page. The Azure AD Team will review it.

Hope this helps!

Wayne Yang
  • 9,016
  • 2
  • 20
  • 40
  • Thanks for your response. "But in this way, you can find the which user is the 1000th user and get the rest part users" - Did you mean, if I know displayname of 1000th user then I can fetch next 1000 user after him ? How ? – sagar Mar 14 '18 at 11:15
  • Hi,@sagar. That's the point. It cannot do via API. I don't know your what your scenario is. You need to find the 999th user's displayname and read the rest data which starts with 1000 user by yourself. **e.g**. Copy data to text and find the `displayname` by `find`. Though it's a tough way... – Wayne Yang Mar 14 '18 at 11:26
  • 1
    @sagar You can't get entities in parallel like that sadly, only sequentially, as you probably already did. – juunas Mar 14 '18 at 19:18