Landing Page Template Endpoint Reference
Landing Page Templates are a parent resource and dependency for individual Marketo landing pages. Landing pages derive the skeleton of their content from the parent template.
Landing Page Template Types
Marketo has two types of Landing Page Templates, free form and guided. Free form landing page templates provide a loosely structured editing experience for pages derived from them. Guided templates provide a heavily structured experience, where element types and locations can be restricted at the template level. For more information on the differences, see this document.
Query
Landing Page Templates support the standard query types for assets of by id, by name, and browsing. These endpoints return metadata for the templates. Retrieving the HTML content of templates must be done on a per-template basis via its id.
Create and Update
Templates are created as empty assets with associated metadata. When creating a template, a name, and folder must be included, along with an optional description, templateType and enableMunchkin parameter. templateType may be either freeform or guided and defaults to freeForm. For differences between the types, see the Guided vs. Free Form section. enableMunchkin defaults to false, and when enabled will prevent Munchkin tracking from being performed on any child landing pages of the template.
1 |
POST /rest/asset/v1/landingPageTemplates.json |
1 |
Content-Type: application/x-www-form-urlencoded |
1 |
name=New LPT - PHP&folder={"id":12,"type":"Folder"} |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
{ "success": true, "warnings": [], "errors": [], "requestId": "11b7#14dfe1e3bcf", "result": [ { "id": 286, "name": "assetAPITest", "description": "test", "createdAt": "2015-06-16T20:45:03Z+0000", "updatedAt": "2015-06-16T20:45:03Z+0000", "url": "https://app-devlocal1.marketo.com/#LT286B2ZN12", "folder": { "type": "Folder", "value": 12, "folderName": "Templates" }, "status": "draft", "workspace": "Default" } ] } |
Content for the template must be populated separately via the Update Landing Page Template Content endpoint.
Update Metadata
Metadata for landing page templates can be updated via the Update Landing Page Template Metadata endpoint. Name, description and the enableMunchkin setting may be updated this way.
Update Content
Content in Landing Page Templates is made as a destructive update to the entirety of the HTML content. The content must be passed as multipart/form-data, with the only parameter being named content.
1 |
POST /rest/asset/v1/landingPageTemplate/286/content.json |
1 2 3 4 5 6 7 8 9 10 11 12 13 |
content-type: multipart/form-data; boundary=--------------------------435851813185237176536801 ----------------------------435851813185237176536801 Content-Disposition: form-data; name="content"; filename="content.txt" Content-Type: text/plain <html> <head> </head> <body> <div>Placeholder Content</div> </body> </html> ----------------------------435851813185237176536801-- |
1 2 3 4 5 6 7 8 9 10 11 |
{ "success": true, "warnings": [], "errors": [], "requestId": "7516#14e0dc60bbc", "result": [ { "id": 286 } ] } |
Clone
Marketo provides a simple method for cloning a Landing Page Templates. This is an application/x-www-url-formencoded POST request.
The id path parameter specifies the id of the source Landing Page Template to clone.
The name parameter is used to specify the name of the new Landing Page Template.
The folder parameter is used to specify the parent folder where new Landing Page Template will reside. This is in the form of an embedded JSON object containing id and type.
The optional description parameter is used to describe the new Landing Page Template.
1 |
POST /rest/asset/v1/landingPageTemplate/{id}/clone.json |
1 |
Content-Type: application/x-www-form-urlencoded |
1 |
name=Standard Template Clone&folder={"type": "Folder", "id": 732} |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
{ "success": true, "errors": [], "requestId": "dee6#1683e9fd410", "warnings": [], "result": [ { "id": 61, "name": "Standard Template Clone", "createdAt": "2019-01-11T20:34:48Z+0000", "updatedAt": "2019-01-11T20:34:48Z+0000", "url": "https://app-abm.marketo.com/#LT61B2ZN732", "folder": { "type": "Folder", "value": 732, "folderName": "Test LP Template Clone" }, "status": "draft", "workspace": "Default", "templateType": "freeForm", "enableMunchkin": true } ] } |
Approval
Landing Page Templates follow the standard draft-approved model, where there can be a draft version and/or an approved version. Whenever updates are applied to a template, they are always applied to the draft version first, and will only be seen live when the template has been approved.
For a template to be approved it must conform to the rules for its type, either guided of free form. For more information on the requirements for creating and approving templates of their respective types, see their respective creation documents:
Delete
To delete a template, it must be out of use and unapproved, meaning that no child landing page may reference it. Landing Page Templates with embedded social buttons may not be deleted with this API.