Get Available Site Templates in SharePoint using REST API

Syntax

http://<Site Url>/_api/web/getavailablewebtemplates(lcid, doincludecrosslanguage)
http://<Site Url>/_api/web/getavailablewebtemplates(lcid)

lcid - The REST API returns the site template based on the specified LCID.
doincludecrosslanguage – weather to include language neutral site template. default value “false”

  1. Fetch all available site templates based on the Language code: 1033

    https://sharepointsite/_api/web/GetAvailableWebTemplates(lcid=1033,doincludecrosslanguage=true)

    https://sharepointsite/_api/web/GetAvailableWebTemplates(1033)

  2. Fetch available site template based on the template category. Ex: “Collaboration”

    https://sharepointsite/_api/web/GetAvailableWebTemplates(1033)?$filter=(DisplayCategory%20eq%20'Collaboration')

    Returns the collection of Site Templates, categorized as “Collaboration”

  3. Fetch the visible site templates

    https://sharepointsite/_api/web/GetAvailableWebTemplates(1033)?$filter=(isHidden%20eq%20false)

  4. Fetch the hidden site templates

    https://sharepointsite/_api/web/GetAvailableWebTemplates(1033)?$filter=(isHidden%20eq%20true)

  5. Fetch the site template based on the name:

    https://sharepointsite/_api/web/GetAvailableWebTemplates(1033)/getbyname('STS')

    Returns the “Team Site” properties

Cheers :)

Ebook Download
View all
Learn
View all