3

There are over 10000 User Profiles.

So I want to get all user Profiles in single request with all user properties.

Is it possible to get multiple users in single request matching particular criteria?

I need to know what will be the best approach from the performance point of view? It can't afford to be slower.

Please suggest something.

1 Answer 1

2

There is no API to get all user profile in a single request. You need some filter and paging to get user profiles.

Using Search API

{site url}/_api/search/query?querytext='FirstName=A*'&startrow=0&rowlimit=100&sourceid='B09A7990-05EA-4AF9-81EF-EDFAB16C4E31'

In first request, above API will return you 100 profiles who have first name started with A. In second request startrow will be 100. This way you can get your all user profiles.

Using UserInformationList

You can get all user profiles under your current logged in site from below end-point. Make a GET request to the following URL.

/_vti_bin/ListData.svc/UserInformationList?$skip=0&$top=100

In next requests increment the value of $skip (previous + 100).

3
  • User Information list may not contain all users, I would say it's dangerous to rely on the user list. Dec 1, 2016 at 11:55
  • I also said that it does not contain. It contains all profiles of current site users. Dec 1, 2016 at 11:57
  • Should be 'FirstName:A*' instead of 'FirstName=A*' I think?
    – John Fouhy
    Oct 14, 2018 at 21:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.