jeudi 12 mars 2015

How to create a DocumentSet using REST Api



I have tried this:



var info = {
__metadata: { 'type': 'SP.DocumentSet' },
AllowContentTypes: true,
ContentTypesEnabled: true,
ContentTypeID: '0x0120D520',
Description: 'new documentset',
Title: 'new documentset',
}

$.ajax(
{
url: appweburl + "/_api/SP.AppContextSite(@target)/web/getFolderByServerRelativeUrl('/Shared Documents')?@target='" + hostweburl + "'",
type: "POST",
data: JSON.stringify(
{
'parameters': info
}
),
headers: {
"X-HTTP-Method": "POST",
"accept": "application/json;odata=verbose",
"content-type": "application/json;odata=verbose",
"X-RequestDigest": $("#__REQUESTDIGEST").val()
},
success: function (site) {
},
error: function (error) {
}







0 commentaires:

Enregistrer un commentaire