How to use HTTP Web Service action of SharePoint 2013 Designer to get UserProfiles?

Dear all,

I've tried several methods to get the user profile, but still in vain.

I do search the solutions from the forums and Google.

http://social.technet.microsoft.com/Forums/sharepoint/en-US/52ceba69-5019-4175-9b34-b9e06c3472bf/rest-query-from-workflow-return-unauthorized

Because the above link is still not work for me, I arise a question here.

Actually, I would like to get a user's manager, thus I use the rest api:

[%workflow content:current site URL%]_api/SP.UserProfiles.PeopleManager/GetMyProperties/extendedmanagers

However, I always get unauthorized error.

{"error":{"code":"-2147024891, System.UnauthorizedAccessException","message":{"lang":"zh-TW","value":" "}}}

Below screenshots are my web service settings.

1. Build a dictionary and set Authorization, Acception, Content-Type.

2. Call web service and set the RequestHeaders.

And, I can use the rest api in the browser to see my manager (logged in).

<d:ExtendedManagers>

<d:element>i:0#.f|membership|boss@aaa.tw</d:element>

<d:element>i:0#.f|membership|admin@aaa.tw</d:element>

</d:ExtendedManagers>

Could anybody help me to clarify this issue?

Thank you!

January 6th, 2014 9:25am

Hi Zuzu,

Please check if you have activated the site feature "Workflow can use app permissions" and grant full control permission to the workflow, here are some useful article related to this topic you can take a look, let us know your results.

http://www.sharepointblog.co.uk/2013/09/create-a-sharepoint-site-spweb-using-rest-in-spd-2013-workflow/

http://social.msdn.microsoft.com/Forums/sharepoint/en-US/cebafa68-05eb-45fb-93ff-11b838e77400/accessing-list-data-on-another-site-from-sharepoint-designer-workflow-using-http-web-service-action?forum=sharepointcustomization

http://msdn.microsoft.com/en-us/library/jj822159.aspx

Thanks

Free Windows Admin Tool Kit Click here and download it now
January 8th, 2014 12:20pm

Hi Daniel,

Thanks for your information, and I really grant the permission of app.

However, I still cannot get the user manager in SharePoint Designer 2013.

This time I try to develop SharePoint app from Visual Studio 2013 to get the user profile.

I create "App for SharePoint 2013" project and select "SharePoint-hosted".

But, I still got the authorization error when I call the web service: https://moviecaker-admin.sharepoint.com/_api/SP.UserProfiles.PeopleManager/GetMyProperties/extendedmanagers

Also upload my source code. https://db.tt/CZ21O8Hq

Thank you!


January 13th, 2014 1:28am

up.

same trouble in my workflow create with visual studio when i use httpsend i'h the error not authorized.

http://msdn.microsoft.com/en-us/library/jj822159.aspx

trouble on sharepoint.com, on my dev environnement sharepoint 2013 it's OK.

Free Windows Admin Tool Kit Click here and download it now
March 12th, 2014 1:38pm

Hi,

Did you find a solution. I'm also on SharePoint online O365 and I have exactly the same problem (from SharePoint Designer 2013)...

I try set cookie to header, app step with elevated permission to fullcontroll on site collection; but again and again Unauthorized...

I'm desperate... :o(

Thanks in advance !





  • Edited by JM-THEMIS Wednesday, April 23, 2014 3:59 PM
April 23rd, 2014 3:56pm

I'm in the same boat. I can make a call to the REST api from a workflow to a list and get a response of OK. If I try to get user profile information, however, I get "unauthorized". I followed the steps above to grant workflows app permissions but the result is the same. 
Free Windows Admin Tool Kit Click here and download it now
June 10th, 2014 5:44pm

Stuck in the same problem with visual studio, here is the uls error

Exception occured in scope Microsoft.Office.Server.UserProfiles.PeopleManager.ctor. Exception=System.UnauthorizedAccessException: Access Denied: This application does not have the required permissions to access profile information.   

at Microsoft.Office.Server.UserProfiles.UserProfileManager..ctor(UserProfileApplicationProxy userProfileApplicationProxy, Guid partitionID, Boolean IgnoreUserPrivacy, Boolean isWithinProfileSync, Boolean assumeProfileAdmin)   

at Microsoft.Office.Server.UserProfiles.UserProfileManager..ctor(UserProfileApplicationProxy userProfileApplicationProxy, Guid partitionID, Boolean IgnoreUserPrivacy, Boolean isWithinProfileSync)   

at Microsoft.Office.Server.UserProfiles.UserProfileManager..ctor(UserProfileApplicationProxy userProfileApplicationProxy, Guid partitionID, Boolean IgnoreUserPrivacy)   

at Microsoft.Office.Server.UserProfiles.ProfileLoader.get_UserProfileManager()   

at Microsoft.Office.Server.UserProfiles.ProfileLoader.EnsureUserProfile(Boolean bCreateIfNotExist)   

at Microsoft.Office.Server.UserProfiles.PeopleManager..ctor()   

at Microsoft.Office.Server.UserProfiles.PeopleManagerServerStub.InvokeConstructor(ClientValueCollection xmlargs, ProxyContext proxyContext)   

at Microsoft.SharePoint.Client.ServerStub.InvokeConstructorWithMonitoredScope(ClientValueCollection args, ProxyContext proxyContext)

I can see this issue posted like year ago so if any one solved it please help me , I appreciate this much.

April 9th, 2015 3:11am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics