Error when calling "Update User"

Occasional Contributor

I am trying to update users' profiles projects and skills attributes:

 

calling:

https://graph.microsoft.com/v1.0/users/me@xxx.com

with body:

{"pastProjects": ["a","b" ]}

 

...works fine....

 

but calling: 

https://graph.microsoft.com/v1.0/users/someone-else@xxx.com

with body:

{"pastProjects": ["a","b" ]}

 

returns

 

{
"error": {
"code": "-1, Microsoft.Office.Server.Directory.DirectoryObjectUnauthorizedAccessException",
"message": "Attempted to perform an unauthorized operation.",
"innerError": {
"date": "2021-04-21T15:20:09",
"request-id": "xxx",
"client-request-id": "xxx"
}
}

 

I know that there is a note in the documentation that says these fields are not accessible to the application and require delegated permissions: could someone tell me if there is another way of doing this?

 

0 Replies