Forum Discussion

Patrick Larocca's avatar
Patrick Larocca
Copper Contributor
Aug 26, 2016

How to work with custom list templates via REST API

Using the modified PowerShell below I can see my custom list template. My questions are, how would I create that template via the REST API and how would I create new document libraries from it using the following link as an example?  Note that there is no DocumentTemplate ID when creating it through the UI.  Thanks!


https://msdn.microsoft.com/en-us/library/office/dn292552.aspx?f=255&mspperror=-2147217396#Anchor_2

 

$spSite.GetCustomListTemplates($spWeb)

 

Name : docs
InternalName : docs.stp
Description :
BaseType : DocumentLibrary
FeatureId : 00bfea71-e717-4e80-aa17-d0c71b360101
Type_Client : 101
Type : DocumentLibrary
ImageUrl : /_layouts/15/images/itdl.png?rev=40
Hidden : False
Unique : False
OnQuickLaunch : True
AllowsFolderCreation : True
IsCustomTemplate : True
NewPage :
EditPage :
DocumentTemplate :
SchemaXml :
CategoryType : Libraries

  • My advice here is avoid to use list templates and start using the remote provisioning pattern to provision your SharePoint artifacts. You can find lots of information about this concept in the PnP space at GitHub
    • Patrick Larocca's avatar
      Patrick Larocca
      Copper Contributor

      Thanks Jaun but I am not sure that its an option with the client just yet.  I know I can do this with the Microsoft.SharePoint.Client library but was wondering if there was a REST API option.

    • Josh Vader's avatar
      Josh Vader
      Copper Contributor

      Sorry Paul,

       

      Unless Microsoft has removed it, that is incorrect: Not only is your site not the Github site, but neither the site you linked too, nor the Github PNP site, contain information about remotely provisioning a list based off a custom template.

       

      Let me repeat:  Based off of a custom template.  This is something that I have been attempting to do for nearly two years now.  

       

      As Patrick (OP) mentioned - it is possible to do this via CSOM but does not appear to be via SP REST API

Resources