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

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|xx@siteurl.onmicrosoft.com'

BUT You can get available user profiles in a site

/_vti_bin/ListData.svc/UserInformationList
  • When I try to get UserInformationList using rest api, I get {"location":null} as a result – Ubiquitous Developers Jan 18 '16 at 13:44
  • did you mean loaction is a managed property? – Atish Dipongkor - MVP Jan 18 '16 at 14:06
  • No, all I get this response only. I was expecting list of users – Ubiquitous Developers Jan 18 '16 at 14:07
  • can re-check every thing? It is not expected – Atish Dipongkor - MVP Jan 18 '16 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

  • /_api/Web/SiteUsers will return only available users in site! not all users – Atish Dipongkor - MVP Jan 18 '16 at 13:09
  • 2
    Thank you for your quick response. As much as I understood, siteusers and user profiles are different thing – Ubiquitous Developers Jan 18 '16 at 13:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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