Unauthorized response code from REST POST web service call

  • 23 April 2015
  • 1 reply
  • 234 views

Hello, I'm having trouble with a POST REST web service call from workflow in 365. Using information from this post Updating list items using SharePoint 2013 workflow engine | Cambridge Technology Partners Blog and this post My SharePoint Insight: Using SharePoint REST services from workflow with POST method  I was able to successfully create a new document library in the current site using a REST call and Nintex Workflow. However, when I try to create a list in a sub site I get a response code of 'Unauthorized' and the message "Unauthorized - {"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."}}}"

 

My sub site inherits permissions from the parent where the workflow is running. Both sites have the feature enabled 'Workflows can use app permissions'. I am using the Call HTTP Web Service action but I have also tried using the Call Web Service action so I could specify credentials. It just suspends the workflow with the message 'Invalid text data'.

 

Here are my steps:

1. Build Dictionary - Request Headers

71197_pastedImage_2.png

 

2. Build Dictionary - Metadata

71198_pastedImage_3.png

 

3. Build Dictionary - Request Content

71199_pastedImage_4.png

4. Inside an App Step action - Call HTTP Web Service

71200_pastedImage_5.png

According to this post How to call a web service logged in as another user who's got the permissions to do it? In Nintex Workflow Office 365 this should work simply by wrapping the call web service action in an App Step.

 

I am having to use the REST service to create this document library because I specifically want to enable content types on it. I have been unsuccessful getting the SOAP UpdateList call to configure this and the CreateList call does not allow for additional parameters.

 

Any additional information would be greatly appreciated. Thanks!


1 reply

Yes, that was exactly it! I first made the mistake of copying the Nintex Workflow app identifier to the sub site instead of just the Workflow app identifier. Once I corrected that mistake it worked like a charm.

Thanks!!!

Reply