SharePoint 2013 workflow REST API unauthorized error

When we write a workflow that calls SharePoint or non-SharePoint HTTP (REST) web service from SharePoint workflow, "Authorization: Bearer" is added to HTTP header by default, which may sometimes result in "401 Unauthorized" error response.

Following workaround can be followed to avoid this error.

Add "Authorization" field set with empty string ("") in a "RequestHeader" property of "Call HTTP Web Service" action in case of SharePoint designer workflow and "HttpSend" action in case of Visual studio workflow.

In case of SharePoint on-premise, we also need to grant full access to workflow service account (given while configuring workflow manager) at web application level (Web application --> User Policy).

Comments

Popular posts from this blog

Switch from Classic to Claims Authentication in SharePoint 2010

How to query list data using web service