Skip to main content
Sitecore Documentation
  • Learn
  • Downloads
  • Changelog
  • Roadmap
PersonalizeCloud Portal
Sitecore Personalize developer documentation
  • Developing with Sitecore Personalize
    • Base URL
    • Response codes
        • Create a template
        • Retrieve templates
        • Retrieve a template
        • Update a template
        • Retrieve revisions
        • Retrieve a revision
        • Preview templates
        • Preview template code
  1. REST API Template
  1. Sitecore Personalize developer documentation
  2. REST APIs

Retrieve a revision of a template

GET /v3/templates/<templateRef>/revisions/<revisionRef>

AttributeTypeDescriptionExample
templateRefstringThe reference of the template.

If you do not know the template reference, first retrieve templates.
340ced1b-c9b7-43f0-9eec-2b9f0b7693fa
revisionrefstringThe reference of the revision.

If you do not know the revision reference, first retrieve revisions.
2
curl -X GET '<baseURL>/v3/templates/340ced1b-c9b7-43f0-9eec-2b9f0b7693fa/revisions/2' \
-H 'Authorization: Bearer <accessToken>' \
-H 'Accept: application/json'
{
    "clientKey": "pqsPERS3lw12v5a9rrHPW1c4hET73GxQ",
    "href": "<baseURL>/v3/templates/340ced1b-c9b7-43f0-9eec-2b9f0b7693fa",
    "ref": "340ced1b-c9b7-43f0-9eec-2b9f0b7693fa",
    "name": "Alert bar template UPDATED",
    "description": "Alert bar template WEB - UPDATED",
    "modifiedByRef": "zwxCA58jwLzfeU2mNGgalCpoJzNVYOJl@clients",
    "modifiedAt": "2023-07-12T11:`26:14`.695138Z",
    "revision": 2,
    "archived": false,
    "friendlyId": "alert_bar_template_1",
    "type": "WEB",
    "status": "DRAFT",
    "templateElements": [
        {
            "id": "html",
            "template": "<div id=\"test\">My updated HTML</div>"
        },
        {
            "id": "css",
            "template": "#test {text-transform: uppercase}"
        },
        {
            "id": "js",
            "template": "insertHTMLBefore(\"body\");\n\nconst testDiv = document.querySelector(\"#test\");\ntestDiv.insertAdjacentHTML(\"afterbegin\", \"<p>Hello from JavaScript</p>\")"
        },
        {
            "id": "freemarker",
            "template": "{}"
        }
    ],
    "render": true,
    "defaultTemplate": false,
    "tags": [],
    "customTemplate": true
}
If you have suggestions for improving this article, let us know!

© Copyright , Sitecore A/S or a Sitecore affiliated company.
All rights reserved.

Privacy policySitecore Trust CenterTerms of use
PersonalizeCloud Portal