Nov 07 2018 08:03 AM
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.
Nov 07 2018 10:01 PM
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.
Nov 07 2018 10:07 PM
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?
Nov 07 2018 10:21 PM
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.
Thanks,
Jayakumar B
Nov 07 2018 10:29 PM
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?
Nov 07 2018 10:33 PM
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
Nov 07 2018 10:53 PM
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
May 24 2019 08:36 PM
Jun 28 2019 06:10 AM - edited Jun 28 2019 06:12 AM
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!