How to work with custom list templates via REST API

%3CLINGO-SUB%20id%3D%22lingo-sub-7733%22%20slang%3D%22en-US%22%3EHow%20to%20work%20with%20custom%20list%20templates%20via%20REST%20API%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-7733%22%20slang%3D%22en-US%22%3E%3CP%3EUsing%20the%20modified%20PowerShell%20below%20I%20can%20see%20my%20custom%20list%20template.%20My%20questions%20are%2C%20how%20would%20I%20create%20that%20template%20via%20the%20REST%20API%20and%20how%20would%20I%20create%20new%20document%20libraries%20from%20it%20using%20the%20following%20link%20as%20an%20example%3F%20%26nbsp%3BNote%20that%20there%20is%20no%20DocumentTemplate%20ID%20when%20creating%20it%20through%20the%20UI.%20%26nbsp%3BThanks!%3C%2FP%3E%3CP%3E%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fmsdn.microsoft.com%2Fen-us%2Flibrary%2Foffice%2Fdn292552.aspx%3Ff%3D255%26amp%3Bmspperror%3D-2147217396%23Anchor_2%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fmsdn.microsoft.com%2Fen-us%2Flibrary%2Foffice%2Fdn292552.aspx%3Ff%3D255%26amp%3Bmspperror%3D-2147217396%23Anchor_2%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%24spSite.GetCustomListTemplates(%24spWeb)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EName%20%3A%20docs%3CBR%20%2F%3EInternalName%20%3A%20docs.stp%3CBR%20%2F%3EDescription%20%3A%3CBR%20%2F%3EBaseType%20%3A%20DocumentLibrary%3CBR%20%2F%3EFeatureId%20%3A%2000bfea71-e717-4e80-aa17-d0c71b360101%3CBR%20%2F%3EType_Client%20%3A%20101%3CBR%20%2F%3EType%20%3A%20DocumentLibrary%3CBR%20%2F%3EImageUrl%20%3A%20%2F_layouts%2F15%2Fimages%2Fitdl.png%3Frev%3D40%3CBR%20%2F%3EHidden%20%3A%20False%3CBR%20%2F%3EUnique%20%3A%20False%3CBR%20%2F%3EOnQuickLaunch%20%3A%20True%3CBR%20%2F%3EAllowsFolderCreation%20%3A%20True%3CBR%20%2F%3EIsCustomTemplate%20%3A%20True%3CBR%20%2F%3ENewPage%20%3A%3CBR%20%2F%3EEditPage%20%3A%3CBR%20%2F%3EDocumentTemplate%20%3A%3CBR%20%2F%3ESchemaXml%20%3A%3CBR%20%2F%3ECategoryType%20%3A%20Libraries%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-138682%22%20slang%3D%22en-US%22%3ERe%3A%20RE%3A%20How%20to%20work%20with%20custom%20list%20templates%20via%20REST%20API%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-138682%22%20slang%3D%22en-US%22%3E%3CP%3ESorry%20Paul%2C%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EUnless%20Microsoft%20has%20removed%20it%2C%20that%20is%20incorrect%3A%20Not%20only%20is%20your%20site%20not%20the%20Github%20site%2C%20but%20neither%20the%20site%20you%20linked%20too%2C%20nor%20the%20Github%20PNP%20site%2C%20contain%20information%20about%20remotely%20provisioning%20a%20list%20based%20off%20a%20custom%20template.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ELet%20me%20repeat%3A%26nbsp%3B%20Based%20off%20of%20a%20custom%20template.%26nbsp%3B%20This%20is%20something%20that%20I%20have%20been%20attempting%20to%20do%20for%20nearly%20two%20years%20now.%26nbsp%3B%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAs%20Patrick%20(OP)%20mentioned%20-%20it%20is%20possible%20to%20do%20this%20via%20CSOM%20but%20does%20not%20appear%20to%20be%20via%20SP%20REST%20API%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-8066%22%20slang%3D%22en-US%22%3ERE%3A%20How%20to%20work%20with%20custom%20list%20templates%20via%20REST%20API%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-8066%22%20slang%3D%22en-US%22%3EJuan%20Carlos%20is%20absolute%20right%20you%20can%20find%20more%20info%20here%20%3CA%20href%3D%22http%3A%2F%2Fdev.office.com%2Fpatterns-and-practices%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttp%3A%2F%2Fdev.office.com%2Fpatterns-and-practices%3C%2FA%3E%20kr%2C%20Paul%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-7965%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20work%20with%20custom%20list%20templates%20via%20REST%20API%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-7965%22%20slang%3D%22en-US%22%3E%3CP%3EThanks%20Jaun%20but%20I%20am%20not%20sure%20that%20its%20an%20option%20with%20the%20client%20just%20yet.%20%26nbsp%3BI%20know%20I%20can%20do%20this%20with%20the%26nbsp%3BMicrosoft.SharePoint.Client%20library%20but%20was%20wondering%20if%20there%20was%20a%20REST%20API%20option.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-7803%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20work%20with%20custom%20list%20templates%20via%20REST%20API%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-7803%22%20slang%3D%22en-US%22%3EMy%20advice%20here%20is%20avoid%20to%20use%20list%20templates%20and%20start%20using%20the%20remote%20provisioning%20pattern%20to%20provision%20your%20SharePoint%20artifacts.%20You%20can%20find%20lots%20of%20information%20about%20this%20concept%20in%20the%20PnP%20space%20at%20GitHub%3C%2FLINGO-BODY%3E
Highlighted
New Contributor

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

4 Replies
Highlighted
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
Highlighted

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.

Highlighted
Juan Carlos is absolute right you can find more info here http://dev.office.com/patterns-and-practices kr, Paul
Highlighted

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