0

I try to create a new document library in my subsite by via workflow.

Any one know if the SharePoint REST API can perform this action? Please guide.

I using SharePoint Online and SharePoint Designer 2013.

0
$.ajax({
    url: _spPageContextInfo.webAbsoluteUrl +"/_api/web/lists",
    type: "POST",
    contentType: "application/json;odata=verbose",
    body: "{ '__metadata': { 'type': 'SP.List' }, 'AllowContentTypes': true, 'BaseTemplate': 101,
             'ContentTypesEnabled': true, 'Description': 'My list description', 'Title': 'Test title' }",
    headers: {
        "Accept": "application/json;odata=verbose",
        "X-RequestDigest": $("#__REQUESTDIGEST").val(),
    },
    success: function (data) {

    },
    error: function (err) {
        console.log(err);
    },
});

Your code should be somethign like the code above, where

'BaseTemplate': 101,

Is the template of document library (full list of template)

0

Yes you can create SharePoint Library using Rest API. Please read this article

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.