POST api/ListItem/CreateOrUpdate

Creates or updates a list item.

If a list item with the ListItemID or the specified IdentifierFieldValues exist the item is updated. If not, it is created.

Request Information

URI Parameters

None.

Body Parameters

Use either ListItemID or IdentifierFieldValues; only with updates

ListName is Required

FieldValues is Required

Use CreateSiteAfterListItemCreated with Create

WorkPoint365.WebAPI.Model.ListItemParameter
NameDescriptionTypeAdditional information
ListName

The name of the target list or business module

string

None.

ListItemID

The internal SharePoint ID of the item to be updated, recycled or checked for if it already exist

integer

None.

IdentifierFieldValues

Field values of the fields defined as keys of the item to updated or recycled or checked for if it already exist

Collection of WorkPoint365.WebAPI.Model.FieldValue

None.

FieldValues

Field values to be inserted or updated

Collection of WorkPoint365.WebAPI.Model.FieldValue

None.

CreateSiteAfterListItemCreated

Only used with ListItem/Create. Indicates if a site for the list item is to be created.

boolean

None.

Request Formats

application/json, text/json

Sample:
{
  "ListName": "sample string 1",
  "ListItemID": 1,
  "IdentifierFieldValues": [
    {
      "InternalFieldName": "sample string 1",
      "Value": {},
      "LookupListFieldNameKeys": [
        "sample string 1",
        "sample string 2"
      ]
    },
    {
      "InternalFieldName": "sample string 1",
      "Value": {},
      "LookupListFieldNameKeys": [
        "sample string 1",
        "sample string 2"
      ]
    }
  ],
  "FieldValues": [
    {
      "InternalFieldName": "sample string 1",
      "Value": {},
      "LookupListFieldNameKeys": [
        "sample string 1",
        "sample string 2"
      ]
    },
    {
      "InternalFieldName": "sample string 1",
      "Value": {},
      "LookupListFieldNameKeys": [
        "sample string 1",
        "sample string 2"
      ]
    }
  ],
  "CreateSiteAfterListItemCreated": true
}

application/xml, text/xml

Sample:
<ListItemParameter xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/WorkPoint365.WebAPI.Model">
  <CreateSiteAfterListItemCreated>true</CreateSiteAfterListItemCreated>
  <FieldValues>
    <FieldValue>
      <InternalFieldName>sample string 1</InternalFieldName>
      <LookupListFieldNameKeys xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
        <d4p1:string>sample string 1</d4p1:string>
        <d4p1:string>sample string 2</d4p1:string>
      </LookupListFieldNameKeys>
      <Value />
    </FieldValue>
    <FieldValue>
      <InternalFieldName>sample string 1</InternalFieldName>
      <LookupListFieldNameKeys xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
        <d4p1:string>sample string 1</d4p1:string>
        <d4p1:string>sample string 2</d4p1:string>
      </LookupListFieldNameKeys>
      <Value />
    </FieldValue>
  </FieldValues>
  <IdentifierFieldValues>
    <FieldValue>
      <InternalFieldName>sample string 1</InternalFieldName>
      <LookupListFieldNameKeys xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
        <d4p1:string>sample string 1</d4p1:string>
        <d4p1:string>sample string 2</d4p1:string>
      </LookupListFieldNameKeys>
      <Value />
    </FieldValue>
    <FieldValue>
      <InternalFieldName>sample string 1</InternalFieldName>
      <LookupListFieldNameKeys xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
        <d4p1:string>sample string 1</d4p1:string>
        <d4p1:string>sample string 2</d4p1:string>
      </LookupListFieldNameKeys>
      <Value />
    </FieldValue>
  </IdentifierFieldValues>
  <ListItemID>1</ListItemID>
  <ListName>sample string 1</ListName>
</ListItemParameter>

Response Information

Resource Description

Returns the internal SharePoint id of the created or updated ListItem

System.Net.Http.HttpResponseMessage
NameDescriptionTypeAdditional information
Version

System.Version

None.

Content

System.Net.Http.HttpContent

None.

StatusCode

System.Net.HttpStatusCode

None.

ReasonPhrase

string

None.

Headers

Collection of Object

None.

RequestMessage

System.Net.Http.HttpRequestMessage

None.

IsSuccessStatusCode

boolean

None.