Quantcast
Channel: Developing Apps for SharePoint 2013 forum
Viewing all articles
Browse latest Browse all 8089

Create folder within a list via REST API

$
0
0

Hi,

I wanted to create a folder within a simple list by using the SharePoint Online REST API, but was not able yet to do so. I tried a lot of stuff to get it work, but it seems it is simply not possible

Basically I trigger the list by this URL: 

https://<Base URL>/_api/Web/Lists/getByTitle('Custom%20List')/items

and this POST Body:

{ "__metadata":{"type":"SP.Data.Custom_x0020_ListListItem"},"Title":"Test Folder", "ContentTypeId":"0x0120003323C8FB37825245827DCD274481C888"}

This creates a list item in my List 'Custom List' visible as Folder. Its Title is of course Test Folder, but the folder path is not /Custom%20List/Test%20Folder/ as I would suppose, but it is /Custom%20List/33_.00

I tried also the following body without success:

{ "__metadata":{"type": "SP.ListItemCreationInformation" },"FolderUrl":"/Custom List/Test Folder/","UnderlyingObjectType":1, "LeafName":"Test Folder"}

SharePoint return the following Error Message: "Es wurden inkompatible Typarten gefunden. Der Typ "SP.ListItemCreationInformation" hat die Art "Complex", es wird aber "Entity" erwartet."

Does somebody know, how to successfully create a folder within a simple list (NOT a library!)?

Thanks in advance!


Viewing all articles
Browse latest Browse all 8089

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>