Skip to content

Commit 55d1da6

Browse files
waldekmastykarzVesaJuvonen
authored andcommitted
Added documentation for the AddValidateUpdateItemUsingPath operation (SharePoint#1480)
1 parent ad9b18a commit 55d1da6

File tree

1 file changed

+81
-4
lines changed

1 file changed

+81
-4
lines changed

docs/sp-add-ins/working-with-lists-and-list-items-with-rest.md

Lines changed: 81 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,8 @@ Headers:
176176

177177
## Working with list items by using REST
178178

179+
### Retrieve all list items
180+
179181
The following example shows how to **retrieve** all of a list's items.
180182

181183
> [!NOTE]
@@ -190,7 +192,7 @@ headers:
190192
191193
```
192194

193-
<br/>
195+
### Retrieve specific list item
194196

195197
The following example shows how to **retrieve** a specific list item.
196198

@@ -226,7 +228,7 @@ The following XML shows an example of the list item properties that are returned
226228
</content>
227229
```
228230

229-
<br/>
231+
### Create list item
230232

231233
The following example shows how to **create** a list item.
232234

@@ -245,7 +247,82 @@ headers:
245247
content-length:length of post body
246248
```
247249

248-
<br/>
250+
### Create list item in a folder
251+
252+
Create list item in a folder.
253+
254+
```text
255+
POST /_api/web/lists/GetByTitle('Test')/AddValidateUpdateItemUsingPath
256+
```
257+
258+
#### URI Parameters
259+
260+
None
261+
262+
#### Request headers
263+
264+
| Header | Value |
265+
|--------|-------|
266+
|Accept|application/json;odata=nometadata|
267+
|Content-Type|application/json;odata=nometadata|
268+
|x-requestdigest|The appropriate digest for current site|
269+
270+
#### Request body
271+
272+
```json
273+
{
274+
"listItemCreateInfo": {
275+
"FolderPath": { "DecodedUrl": "https://contoso.sharepoint.com/lists/Test/Folder/SubFolder" },
276+
"UnderlyingObjectType": 0
277+
},
278+
"formValues": [
279+
{
280+
"FieldName": "Title",
281+
"FieldValue": "Item"
282+
}
283+
],
284+
"bNewDocumentUpdate": false
285+
}
286+
```
287+
288+
| Property | Description |
289+
|----------|-------|
290+
|listItemCreateInfo|Information about the list and folder where the item should be created|
291+
|listItemCreateInfo.FolderPath.DecodedUrl|Absolute URL of the folder where the item should be created|
292+
|listItemCreateInfo.UnderlyingObjectType|Type of item to create. For more information see [https://msdn.microsoft.com/en-us/library/microsoft.sharepoint.client.filesystemobjecttype(v=office.14).aspx](https://msdn.microsoft.com/en-us/library/microsoft.sharepoint.client.filesystemobjecttype(v=office.14).aspx)|
293+
|formValues|Array of field names and values to set on the newly created item|
294+
|bNewDocumentUpdate|Set to `false` to create a list item|
295+
296+
#### Responses
297+
298+
| Name | Type |Description|
299+
|--------|---------|-----------|
300+
|200 OK | Boolean |Success |
301+
302+
```json
303+
{
304+
"value": [
305+
{
306+
"ErrorMessage": null,
307+
"FieldName": "Title",
308+
"FieldValue": "Item",
309+
"HasException": false,
310+
"ItemId": 0
311+
},
312+
{
313+
"ErrorMessage": null,
314+
"FieldName": "Id",
315+
"FieldValue": "1",
316+
"HasException": false,
317+
"ItemId": 0
318+
}
319+
]
320+
}
321+
```
322+
323+
The `value` property contains the list of properties that have been set when creating the list item.
324+
325+
### Update list item
249326

250327
The following example shows how to **update** a list item.
251328

@@ -266,7 +343,7 @@ headers:
266343
content-length:length of post body
267344
```
268345

269-
<br/>
346+
### Delete list item
270347

271348
The following example shows how to **delete** a list item.
272349

0 commit comments

Comments
 (0)