3

I am trying to get list of all user profiles using RestAPI in office 365, But could not find any method for it.

I can get property of any specific user successfully by following method:

/_api/SP.UserProfiles.PeopleManager/GetUserProfilePropertyFor(accountName=@v,propertyName='Name')?@v='" + encodeURIComponent(accountName) + "'"

But I want to get list of all user. Is it any method available using REST API?

2 Answers 2

2

Still this no API for retrieving all user profiles

You can get current user's profile

_api/SP.UserProfiles.PeopleManager/GetMyProperties

Or a particular user's profile by login name

/_api/SP.UserProfiles.PeopleManager/GetPropertiesFor(accountName=@v)?@v='i:0%23.f|membership|[email protected]'

BUT You can get available user profiles in a site

/_vti_bin/ListData.svc/UserInformationList
4
  • When I try to get UserInformationList using rest api, I get {"location":null} as a result Commented Jan 18, 2016 at 13:44
  • did you mean loaction is a managed property? Commented Jan 18, 2016 at 14:06
  • No, all I get this response only. I was expecting list of users Commented Jan 18, 2016 at 14:07
  • can re-check every thing? It is not expected Commented Jan 18, 2016 at 14:33
0

This is the endpoint that serves a list of all users in a site:

/_api/Web/SiteUsers

Here is the UserCollection resource reference:

https://msdn.microsoft.com/en-us/library/office/dn531432%28v=office.15%29.aspx#bk_UserCollection

Here is the overall REST API endpoints' reference:

https://msdn.microsoft.com/en-us/library/office/dn499819.aspx

2
  • /_api/Web/SiteUsers will return only available users in site! not all users Commented Jan 18, 2016 at 13:09
  • 2
    Thank you for your quick response. As much as I understood, siteusers and user profiles are different thing Commented Jan 18, 2016 at 13:09

Your Answer

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

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