Forum Discussion
Jack Huang
Nov 07, 2018Copper Contributor
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 GanesanCopper Contributor
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!
- Carlos Andrés Oviedo GibbonsCopper Contributor
Aravind Ganesan Thank you!, It's work for me!
- Jayakumar BalasubramaniamCopper Contributor
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 HuangCopper 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?
- Jayakumar BalasubramaniamCopper Contributor
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