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

Copper Contributor

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/SetSingleValueProfileP...

 

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. 

9 Replies

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.

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?

Go to the below URL

https://admin.microsoft.com/AdminPortal/Home#/users

 

Which will list you all the users's if you have enough permissions, then click on the username and you can find a popup opens from the left. Roles section will tell your permission on the tenant.

 

admin_roles.JPG

 

Thanks,

Jayakumar B

As you can see, I am already a global administrator. But I still can not edit other's sharepoint profile. Is there any other settings for administrator permission comes to your mind?

 

 

global-admin.png

 

You have enough permissions!!

 

Do you have issue with any specific user property or you are not able to update any of the properties of other user ?

 

Thanks,

Jayakumar B

Any of the properties.

 

If "Allow user to edit values for this property" is checked, then I can edit mine, but can't edit others (error code -2147024891, UnauthorizedAccessException, Access denied. You do not have permission to perform this action or access this resource).

 

If unchecked, I can't even update mine(error code 1, PropertyNotEditableException, Property Not Editable: This property can only be modified by an administrator.)

 

Below is the check box I mentioned in the sharepoint admin center

 

sharepoint-edit.png

Did you find a solution to this problem? I am also facing the same issue but no luck with solution

@Jack Huang  @Shanky1690 

 

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

 

userPropertyUpdate.PNG

 

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!