Is it possible to return the manager property via the web service action in office 365? The reason I ask is there is a known bug Error message when you connect an InfoPath form to a SharePoint Online web service: "An error occurr... . In short the loopback issue seen in previous builds of SharePoint, but you cant turn it off as its in the cloud.
I'm presume you would need to pass in the url http://siteurl/_api/SP.UserProfiles.PeopleManager/GetUserProfilePropertyFor(accountName=@v,propertyName='LastName')?@v='domain\username' to the url section.
However you always seem to get an
denied. You do not have permission to perform this action or access this
even when running the workflow as an admin.
Solved! Go to Solution.
I have been investigating how to query the user profile service in Office 365 recently also, but using Nintex cannot get it to work, getting the same Access Denied response above.
I can create a Napa app and give it the permissions to "read" the user profile service and I can return all the user profile properties required using the examples linked below. If I set the napa app permissions to "no access" to the user profile service I get the same Access Denied, which leads me to thinking the Nintex app doesn't have permission to query the User Profile Service in SPO.
I wonder if it has something to do with needing to first save out the x-RequestDigest which you get when you call http://server/web/doclib/forms/_api/contextinfo And then calling the UserProfile method with the digest value in the header. I know you need to do this when using any of the REST services in NWF2013 on-premises (anything in /_api/).
No idea if this applies to O365 in general. I've not done much at all with O365 NWF.
I would really really love to know the status on this. Nintex forms for O365 do not contain the action to pull the users manager.
Has anyone worked out any code, or any way to pull from the user profile service into Nintex forms?
I've been trying to find a solution to this problem for the past few days and I think I've found something. There were a few different things I had to do to get it working so I thought I'd list them all here.
I took the advice from Kevin Annfield and made a request to the '_api/contextinfo' web service to get the 'FormDigestValue' which I then used in the request header of my subsequent request to the user profile service.
Including the 'X-RequestDigest' value is enough to call other web scoped REST services within the same site as the workflow but with the User Profile Service I was still getting an unauthorised error.
I then looked at the permissions that the app has and found that it was missing the permissions to call the user profile service. The different app permissions are listed here 'http://msdn.microsoft.com/en-us/library/office/fp142383(v=office.15).aspx'
I found that granting the 'Nintex Workflow for Office 365' and standard SharePoint 'Workflow' app permissions to read from the user profile service fixed the issue. Here's an example of the permissions XML that I used:
<AppPermissionRequest Scope="http://sharepoint/social/tenant" Right="Read" />
<AppPermissionRequest Scope="http://sharepoint/content/tenant" Right="Write" />
Here's a link that details how to update the app's permissions: http://msdn.microsoft.com/en-us/library/office/fp142383(v=office.15).aspx#Perm_manage
Hopefully this is enough information for you to get your workflow working.
at this stage, Bens suggestion would be the way to do it, until we release built in functionality to get the Manager token.