How would one format the rest uri to create a document set in SP?
The JSOM code below works fine, but I would prefer to use the REST in order to be able to call it from a workflow.
var dsresult = SP.DocumentSet.DocumentSet.create(context, parentFolder, "docsetfromjsom", docsetCtId);
I tried this format based on this MSDN article
var restQueryUrl = spAppWebUrl + "/_api/SP.AppContextSite(@target)/SP.DocumentSet.DocumentSet.create('serverrelativeurl','docsetname','ctid')?@target='spHostUrl'";
Tried other formats as well but none successful. In jsom you also need to include the context, but I am assuming that for the rest call you don't need to use it (i think). Anyone tried this before?
Thanks!
I've already answered a similar question at SharePoint StackExchange.
To summarize, it does not seem possible to create Document Set using SharePoint 2013 REST API since
SP.DocumentSet.DocumentSet.create
function is not accessible via REST. But you could utilize SharePoint 2010 REST API instead for that purpose.The following example demonstrates how to create a Document Set using SharePoint 2010 REST Interface:
Usage
Create Document Set named
Orders
in Documents library: