Not applicable

Create List item using Web Request

Jump to solution

Hello,

I am in a great need of help regarding configuration of Web Request. Let me start from the beginning. I need to make Nintex workflow to create an item in a list named News (for example). Based on the full Nintex version experience I am going to use a Soap request to _vti_bin/lists.asmx   UpdateListItems.

So I add Web Request and try to configure it:

URL: https://site/subsite/_vti_bin/Lists.asmx

Method: SOAP 1.1

Soap action: http://schemas.microsoft.com/sharepoint/soap/UpdateListItems‌

Body:

<?xml version="1.0" encoding="utf-8"?>

<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">

    <soap:Body>

        <UpdateListItems xmlns="http://schemas.microsoft.com/sharepoint/soap/">

            <listName>News</listName>

            <updates>

    <Batch OnError="Return">

     <Method ID="1" Cmd="New">

      <Field Name="Title">Test</Field>

    </Batch>

            </updates>

        </UpdateListItems>

    </soap:Body>

</soap:Envelope>

As a result I get Error 400: bad Request.

I can't find any differences from Web Request action for O365 ... Don't understand what I am doing wrong

Tags (1)
0 Kudos
4 Replies
fhunth
Scout

Re: Create List item using Web Request

Jump to solution

Perhaps you could try it with the Sharepoint REST Services

0 Kudos
Not applicable

Re: Create List item using Web Request

Jump to solution

Hello Fernando,

i have tried and configured Web Request like this:

URL: https://site/subsite/_api/lists/getbytitle('News')/items‌

Method: POST (Content type: ‌application/x-www-form-urlencoded‌)

Body:

‌{  '_metadata':{'type':SP. listnameListItem},  'Title': 'MyItem'}‌

As a result I got:

Microsoft.SharePoint.SPExceptionThe security validation for this page is invalid and might be corrupted. Please use your web browser's Back button to try your operation again.

403.

0 Kudos
andrewg
Scout

Re: Create List item using Web Request

Jump to solution

Please refer to the following blog for more help. How to execute a REST API request with Nintex Workflow

0 Kudos
burked
Nintex Workflow Cloud Expert
Nintex Workflow Cloud Expert

Re: Create List item using Web Request

Jump to solution

Looking at the string, there is no </Method> tag which may be causing the error.  I was able to have this function using the body below:

<?xml version="1.0" encoding="utf-8"?>

<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">

    <soap:Body>

    <UpdateListItems xmlns="http://schemas.microsoft.com/sharepoint/soap/">

      <listName>ListName</listName>

      <updates>

  <Batch OnError="Continue">

  <Method ID="1" Cmd="New">

  <Field Name="ID">New</Field>

  <Field Name="Title">Test</Field>

  </Method>

  </Batch>

      </updates>

    </UpdateListItems>

    </soap:Body>

</soap:Envelope>