I am trying to get a user's line manager in a workflow in a SharePoint online site collection.

I have followed the exact steps here and and also running with App Step -elevated permissions- as you can see in screenshot. I have already gave trust to Workflow on appinv.aspx following the steps here.


Rest call URL is something like this: https://mycompanyname.sharepoint.com/sites/forms/_api/SP.UserProfiles.PeopleManager/GetUserProfilePropertyFor(accountName=@v,propertyName='Manager')?@v=%27i:0%23.f%7Cmembership%7CMYACCOUNT%27

With this URL I CAN access the response from browser, and get the line manager.

However in the workflow, no matter what I did it's erroring.

  {"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 logged the 'Dictionary'(Headers) and it looks like it's adding an extra / in there:



enter image description here

this dictionary is looking like this in Workflow.

enter image description here

I really don't understand why the Rest call is working in browser, and not working inside the workflow. As I said I have already given FullControl to Workflow app in appinv.aspx.

I am also unable to understand why it adds the extra "\" into the Request Header (Headers/ dictionary)

Please help! If GetUserProfilePropertyFor cannot be called like this, let me know so this torture ends.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.