SharePoint Pals
 | Sign In
Using Nintex Workflow with SharePoint Rest Api
by Senthil Kumaresan 24 Sep 2015
SharePoint Architect
Today  :   25     Total  :    5363

Nintex workflows have powerful utilities that help to perform some of the tedious operations like batch updating content or configuration. One such action is the “Web Request”.

I had a scenario where I would need to disable content approval feature from some of the libraries in a set of sites that reside in site collections on different web applications. There are different approaches to do this. First is to write a PowerShell script. But writing a script is pretty easy but executing will take time as I had an environment where the SharePoint Farm is managed by a dedicated server team and I will have to wait to run the script on a change window. Second is to write a .Net Client Side Managed Code program to iterate across all the sites in site collection that reside in different web application which needs extensive coding to.

But there was even easier approach to use Nintex workflows for batch operations which I luckily had in my organization’s SharePoint On-Premises environment. With the introduction of Rest in SharePoint 2013, it is easier now to perform CRUD operations on SharePoint objects using the “Web Request” action in Nintex Workflows.

I had the list of SharePoint Site Url’s in a SharePoint List where I would need my workflow program to iterate through all the sites and remove content approval feature from a library on the site.

There are 2 categories of Http Methods to use in the web request action.

1. Get – Read operation to resources which the user defined in the web request action has rights to.

2. Post – Create, Update and Delete operations on resources which the user defined in the web request action has rights to.

a. For Update operation, A header X-HTTP-Method has to be set with value of MERGE

b. For Delete operation, A header X-HTTP-Method has to be set with value of DELETE

c. All Post operation requires a request digest token to validate post backs to SharePoint.

For my example, since I want to disable content approval for libraries in a set of sites, I would need to perform an update operation using the Post Http Method. I have designed the workflow so that it performs a “for each” loop action to iterate through list of sites and calls the rest service for each site and performs the update operation.

First, to perform a Post method you will need a request digest token.

To get a request digest token you will have a perform a post operation to the Rest Url https://<Site Url>/_api/ContextInfo and store the response in a variable


Use Query XML action to query the Digest token value from the Response xml and store it in a variable which is required for the Post operation.


After getting the digest token, I can now call the Post method to perform the update operation on the list properties to disable the content approval on the list using the web request action.


Note, I have modified the content type to “application/json;odata=verbose” since I am sending a Json request in the body of the web request.

Since this is an update operation, I have added 3 headers

1. X-HTTP_Method : MERGE

2. X-RequestDigest : <Digest token got earlier in a variable>

3. IF-MATCH : *

The IF-MATCH: * header is used to overwrite any changes that has already been changed on the server.

The body contains the Json input to perform the merge operation. For all SharePoint Rest API related info check msdn link

So it is pretty simple to perform any Batch CRUD operations using Nintex Workflows, Instead of writing a script.

blog comments powered by Disqus

SharePoint Pals

SharePoint Pals, a community portal for SharePoint developers, Administrators and End Users. Let's join hands and share the point together.
Read this on mobile


Angular Js Training In Chennai
Advanced Angular Js training with real world developer scenarios
Angular Js, Web Api and Ionic for .Net Developers
All in one client side application development for .Net developers
Angular Js For SharePoint Developers
Get ready for the future. Its no more just C#

Get Connected

SharePoint Resources

SharePoint 2013 and 2010 Web Parts
Free Web Parts with Source Code for SharePoint Community

SharePoint 2013 Books and Tutorials
Collection of free SharePoint 2013 books and tutorials (eBooks, pdfs)

Supported By

Contribute your article and be eligible for a one month Free Subscription for Plural Sight. The Author of the most popular New Article (published in the previous month) will be awarded with a Free One month Plural Sight Subscription. Article can be sent to in a word document.

Related Resources

Recent Tweets

Twitter October 23, 22:21
How to Add/Remove User Custom Actions (in Site Actions Menu) Programmatically using CSOM PNP in SharePoint -

Twitter October 21, 21:34
How to Add a JS Link Reference to the Display Form or Any other ASPX Programmatically using CSOM PNP in SharePoint -

Twitter October 20, 13:01
How to Add a JS Link Reference to the NewForm and EditForm Programmatically using CSOM PNP in SharePoint Office 365-

Twitter October 12, 12:15
How to Deploy Provider Hosted Apps (Add-Ins) by App Stapling in SharePoint Office 365 -

Twitter October 11, 13:39
How to Deploy Provider HostedApp programmatically using CSOM in SharePoint Office 365 Activating Developer Feature -

Follow us @SharePointPals
Note: For Customization and Configuration, CheckOutRecent Tweets Documentation