Been searching through the internet for a couple of days to no avail but how do you create Asset Library with BaseTemplate = 851 in modern sites for Sharepoint Online via the REST API V1.0 endpoint? I am able to create Lists, Document libraries & Picture libraries with no issues but when I use BaseTemplateId = 851 the REST endpoint is not accepting the payload.
data = JSON.stringify({
"__metadata": {"type": "SP.List"},
"AllowContentTypes": true,
"BaseTemplate": 851,
"ContentTypesEnabled": true,
"Description": "My list description",
"Title": foldername
})
headers.append("Authorization", bearer)
headers.append("Content-Type", "application/json;odata=verbose")
headers.append("Accept", "application/json;odata=verbose")
headers.append("X-RequestDigest", formDigestValue)
const options = {
method: "POST",
headers: headers,
body: data
};
return fetch(folderPath + '/_api/web/lists', options)
.then(response => response.json())
.then(response => console.log(response))
BaseTemplate - 100, 101 & 109 are just working fine and I am able to create lists and document libraries. 851 is not working programmatically though I can create Assets Library manually ( I have activated Video and Rich Media Site Collection Features).
Any help here would be much appreciated! Thank you