I had a problem adding a ListItem to the specified folder when using the SharePoint 2013 REST api.
In the client object model, it will look like this:
var creationInfo = new SP.ListItemCreationInformation();
creationInfo.FolderUrl = "/Lists/MyList/MyFolder";
var item = list.addItem(creationInfo );
item.update();
ctx.executeQueryAsync(
Function.createDelegate(this, onSuccess),
Function.createDelegate(this, onFail));
But when I try to install FolderUrl through the recreation service
{ '__metadata' : { 'type': 'SP.Data.MyListListItem' }, 'Title': 'NewItemInFolder', 'FolderUrl': '/sites/example/Lists/MyList/MyFolder' }
I have 400 Bad Request
I also tried adding the ListItem to the List first and then updating FolderUrl, but that also didn't work.
How to add ListItem to a list folder in SharePoint using Rest-Api?
Edit:
{ '__metadata' : {
'type': 'SP.Data.MyListListItem',
'type': 'SP.Data.ListItemCreationInformation'
},
'Title': 'NewItemInFolder',
'FolderUrl': '/sites/example/Lists/MyList/MyFolder'
}
Now I tried to use both ListItemEntityTypeFullNameEntity from my list and ListItemCreationInformation, but I also received only 400 Bad Request.
And when I view the request using Fiddler, I see that SharePoint is now ignoring my Entity List type SP.Data.MyListItem