Skip to main content
Skip table of contents

API: Rest Get All Templates

The Get Templates commands allow you to return the content of a template specified by ID or name.  This command returns the template id, name, subject line, Plain Text body, and HTML body of each template.  

GET /templates

https://[siteurl]/rest/templates

Request Body Parameters

The Get Template command requires only the URI call. No additional fields are required in the JSON.    

Request Body Example

Using Get Templates:

curl --request GET \
--url 'https://mail.mydomain.com/rest/templates' \
--header 'authorization: Basic bXlBY2NvdW50Onh5enB3ZDEyMw==' \
--header 'accept: application/vnd.whatcounts-v1+json' \
--header 'content-type: application/json' \
--include

Response Body

SUCCESS

The Get Template commands do not explicitly return a Success code.  Instead, it outputs the template data.  Use the Output Format argument to return the results in a specific format. 

JSON
{
    "skip": 0,
    "max": 0,
    "id": 321,
    "realmId": 123,
    "name": "Template",
    "description": "",
    "subject": "This is a subject line.",
    "createdDate": "Mar 03, 2025 16:47:32 PM",
    "updatedDate": "Mar 03, 2025 16:49:38 PM",
    "deletedFlag": false,
    "templateFolderId": 0,
    "permissionMask": "0",
    "templateInherited": false,
    "templateDataPlaintext": "%%DISPLAY_MSG%% click to open email in browser",
    "templateDataHtml": "<html>\r\n\t<head>\r\n\t\t<title></title>\r\n\t</head>\r\n\t<body>\r\n\t\tThis is an <strong>HTML</strong> test</body>\r\n</html>\r\n",
    "templateDataMobile": "",
    "templateDataWap": "",
    "templateDataAvantgo": "",
    "templateReplaceFields": "",
    "templateNotes": "",
    "templateDataAol": "",
    "templateDataXml": "<unicode>0</unicode><encode_base64>0</encode_base64><utf_charset>  </utf_charset><encode_quoted>0</encode_quoted>",
    "status": "",
    "plainHasRelational": false,
    "htmlHasRelational": false,
    "createdBy": "Template",
    "createdById": 0,
    "templateLibraryId": 0,
    "templateLayoutId": 0,
    "templateSize": 112,
    "templateProductLayoutId": 0,
    "isLiveIntentEnabled": false,
    "liveIntentContentId": 0,
    "productLayoutName": "",
    "valid": true
}

FAILURE

A Get Template command will fail for several reasons.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.