cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to return manager property via web service office 365

Jump to solution

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.

2014-08-07_10-29-20.jpg

However you always seem to get an

Response Content:
{"odata.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."}}}

even when running the workflow as an admin.

Labels: (2)
Tags (1)
0 Kudos
Reply
17 Replies
Workflow Hero

Re: How to return manager property via web service office 365

Jump 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.

These example all work fine in a Napa all or Content Editor web part, but not when injecting the javascript into a Nintex O365 form
http://www.vrdmn.com/2013/07/sharepoint-2013-get-userprofile.html
http://www.vrdmn.com/2013/11/set-userprofile-picture-using-net.html

https://www.nothingbutsharepoint.com/sites/eusp/Pages/SharePoint-2013-User-Profile-Properties-throug...

Dan StollPatrick HoschVadim Tabakman‌ - Any insight into this? for both JavaScript on a Nintex form or REST API in a workflow task for query details of the User Profile Service?

Reply
Not applicable

Re: How to return manager property via web service office 365

Jump to solution

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.

Reply
Not applicable

Re: How to return manager property via web service office 365

Jump to solution

Hi guys,

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?

cheers

0 Kudos
Reply
Not applicable

Re: How to return manager property via web service office 365

Jump to solution

Hi Mate, did you figure this out?

Im really struggling with this too

0 Kudos
Reply
Workflow Hero

Re: How to return manager property via web service office 365

Jump to solution

Hi Dee,

I'm looking into this at the moment.  As soon as I have a working example, I'll post it on here.

cheers,

Vadim

Reply
Not applicable

Re: How to return manager property via web service office 365

Jump to solution

Hi Dee,

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:

<AppPermissionRequests>

<AppPermissionRequest Scope="http://sharepoint/social/tenant" Right="Read" />

<AppPermissionRequest Scope="http://sharepoint/content/tenant" Right="Write" />

</AppPermissionRequests>

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.

Cheers,

Ben

0 Kudos
Reply
Not applicable

Re: How to return manager property via web service office 365

Jump to solution

Hi Vadim Tabakman,

did you have the chance to look at this? What do you think about the approach suggested by Ben Ide?

cheers,

Michele

0 Kudos
Reply
Workflow Hero

Re: How to return manager property via web service office 365

Jump to solution

Hi Michele,

at this stage, Bens suggestion would be the way to do it, until we release built in functionality to get the Manager token.

cheers,

Vadim

0 Kudos
Reply
Highlighted
Workflow Hero

Re: How to return manager property via web service office 365

Jump to solution

Emily Billing​, Ben Ide can you mark this as the Correct answer?

0 Kudos
Reply