Dear Team,
I am creating a Folder in SharePoint List using rest API. I have followed along the below URL and was able to create a folder.
https://info.paitgroup.com/blog/sharepoint-rest-api-and-lists-with-folders
Now the Problem is the folder is getting created with ID_000 format.
Following is the code I have used.
return $.ajax({
url: requestUri,
type: "POST",
contentType: "application/json;odata=verbose",
data: JSON.stringify({"__metadata": { type: "SP.Data." + listname + "ListItem" },
Title: folderName,
FileLeafRef: folderName,
FileRef: folderName, // No effect here
FileSystemObjectType: SP.FileSystemObjectType.folder,
ContentTypeId: "0x0120"
}),
headers: {"accept": "application/json;odata=verbose","X-RequestDigest": data.d.GetContextWebInformation.FormDigestValue
}
});Let me know if you need any more info.
Thanks,
Pavan.