Easy. There are plenty post regarding this classic scenario, such as:
http://www.cleverworkarounds.com/2014/02/05/tips-for-using-spd-workflows-to-talk-to-3rd-party-web-services/
https://www.credera.com/blog/technology-insights/microsoft-solutions/sharepoint-2013-online-accessing-user-profile-properties-in-a-designer-workflow/
https://www.c-sharpcorner.com/article/get-user-profile-properties-data-in-sharepoint-designer-2013-workflow/
The solutions are all similar.
- Grant permission to workflow
<AppPermissionRequest Scope="http://sharepoint/social/tenant" Right="Read" />
</AppPermissionRequests>
- Build the Request Header dictionary variable.
Accept String application/json;odata=verbose
Content-Type String application/json;odata=verbose
Authorization String
- Build the RESTful API URL.
- Get the value from ResponseContent by path "d/GetUserProfilePropertyFor"
Easy! But, I still got authorization issue:
{"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."}}}
After bumping head on wall for hours, it turns out that Microsoft fixed a previous bug: we don't need to overwrite "Authorization" in request header anymore......
Without it, everything works well.
No comments:
Post a Comment