I am using this code to get all properties for just myself (current user). But how can I change this so that I can get the same data but for all the users in SharePoint?

var oldurl = _spPageContextInfo.webAbsoluteUrl + "/_api/SP.UserProfiles.PeopleManager/GetMyProperties";

    url : oldurl,
    type : "GET",
    //data: JSON.stringify(theData),
    headers: requestHeaders,
        var f = JSON.stringify(data);
  • were you able to figure this out? when you get siteusers you get a lot of old users that were removed from the directory and presumably don't have access anymore too. – fei0x Oct 2 '19 at 18:36

If you want to get all users of site then

_spPageContextInfo.webAbsoluteUrl + "/_api/Web/SiteUsers"

If You want to display information of User in site then

_spPageContextInfo.webAbsoluteUrl + "/_api/Web/SiteUserInfoList"

Display particular user information then

_spPageContextInfo.webAbsoluteUrl + "/_api/web/GetUserById("+UserID+")"

But in your case if you want to get all user's properties then you need to loop through and get user profile. You can also use CSOM by which you can get all user and Groups.

You can use this method to retrieve particular property of user (Reference)

SP.UserProfiles.PeopleManager.getUserProfilePropertyFor(accountName, propertyName)

You can get the idea from this Answer how to retrieve all user properties.

I got the reference from this Article

| improve this answer | |

That can be specified by the URL that you use:

  1. Get all properties of current user:

  2. Get all properties of Specific User:

    For Office 365/SharePoint Online:


    For SharePoint 2013 On-Premise:

| improve this answer | |
  • 3
    I knew this but is there one for like getPropertiesForAllUsers? Like how can I get this without making a ton of requests? – omega Jul 6 '15 at 21:54
  • 2
    Robert, as per the msdn documentation there should be no, accountName= parameter in the GetPropertiesFor method call. msdn.microsoft.com/en-us/library/office/… But when I try calling the endpoint without one I get an error. Your way it works. Where did you learn you need to add the accountName=@v parameter? It's a little dicomforting if the official documentation is wrong. – Molotch Dec 17 '16 at 17:32

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.