Forum Discussion

Jack Huang's avatar
Jack Huang
Copper Contributor
Nov 07, 2018

Can't update other's sharepoint user profile by REST API even though I am already an administrator

I am trying to update other's user profile in our site, but I am not able to do it with "POST" REST call. Getting permission denied error. Even though I am already administrator of the site.

 

Here is the REST call I made: https://<sharepoint domain>.sharepoint.com/_api/SP.UserProfiles.PeopleManager/SetSingleValueProfileProperty

 

The error response is: { "error": { "code": "-2147024891, System.UnauthorizedAccessException", "message": { "lang": "en-US", "value": "Access denied. You do not have permission to perform this action or access this resource." } } }

 

I made the REST Call to Sharepoint by using Postman with the access token. 

  • Aravind Ganesan's avatar
    Aravind Ganesan
    Copper Contributor

    Jack Huang  Shanky1690 

     

    I too come across the same issue. In my case I tried with MS Flow as in below screenshot

     

     

    So, instead of using below URI, 

    https://<companyName>.sharepoint.com/_api/SP.UserProfiles.PeopleManager/SetSingleValueProfileProperty

    I used the below URI and able to update the Property successfully. And the account I used is Global Admin.

    https://<companyName>-admin.sharepoint.com/_api/SP.UserProfiles.PeopleManager/SetSingleValueProfileProperty

     

     

    Also, able to perform this action for UserProperties that are not set to 'Allow users to edit values for this property'

     

    Hope this is helpful!

  • Hi Jack Huang Site Admin permission is not enough to update other user profile properties.

     

    Either you need SharePoint Admin/Tenant Admin permission.

     

    Thanks,

    Jayakumar B.

    • Jack Huang's avatar
      Jack Huang
      Copper Contributor

      Hi,

       

      Thanks for your response!

       

      I am using Sharepoint Online, and I am global administrator in Office 365. Do you know how to check whether I am SharePoint Admin/Tenant Admin permission? And how to grant SharePoint Admin/Tenant Admin permission to me?

Resources