Skip to content

Get templates list

Templates collection allows retrieving a list of templates (e.g. headers, footers) available in the system, using HTTP GET method. This information can be used e.g. when sending newsletters using API.

Request data format

Request URL parameters:

Element/attributeTypeNotes
apiKeystringYour API key, required for authentication. Required.
typestringType of templates to return. Optional. If omitted, all templates will be returned.
Valid template types are:
Header
Footer

Examples:

https://api.esv2.com/v2/Api/Templates?apiKey=YOUR_API_KEY_HERE

https://api.esv2.com/v2/Api/Templates?apiKey=YOUR_API_KEY_HERE&type=Footer

Response

Response Data element:

Element/attributeTypeNotes
Templatesarray[complex]Array of Template elements.

Template element children:

Element/attributeTypeNotes
IdintTemplate identifier.
TypestringTemplate type. One of:
Header
Footer
NamestringTemplate name.

Examples

Request:

GET https://api.esv2.com/v2/Api/Templates?apiKey=test_api_key1 HTTP/1.1
Accept-Encoding: gzip,deflate
Host: api.esv2.com
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)

Response:

HTTP/1.1 200 OK
Cache-Control: private
Content-Type: text/xml; charset=utf-8
Server: Microsoft-IIS/7.5
X-AspNetMvc-Version: 5.1
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Wed, 05 Mar 2014 13:19:51 GMT
Content-Length: 345

<ApiResponse xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <Data>
    <Templates>
      <Template>
        <Id>1</Id>
        <Type>Footer</Type>
        <Name>Default EN footer</Name>
      </Template>
      <Template>
        <Id>2</Id>
        <Type>Footer</Type>
        <Name>Default PL footer</Name>
      </Template>
      <Template>
        <Id>3</Id>
        <Type>Header</Type>
        <Name>My custom header</Name>
      </Template>
      <Template>
        <Id>4</Id>
        <Type>Header</Type>
        <Name>Some other header</Name>
      </Template>
    </Templates>
  </Data>
</ApiResponse>
On this page
To top