REST API: GET template (Marketing Suite)

You can use the REST API to retrieve a summary of an emailing template with an HTTP GET call to the following URL:$id

Where $id should be replaced with the ID of the emailing template you want summarized.

Returned fields

The method returns a JSON object containing the following information:

  • id: The ID of the template.
  • name: The name of the template.
  • from_address: The from address for the template. Array containing a 'name' and 'email' field.
  • subject: The template subject.
  • type: The template type ('json' or 'html').
  • archived: Whether or not the template is archived.
  • directory: The directory in which the template is located (if any).

JSON example

The JSON will look something like this:

   "name":"Theme: conference",
   "subject":"Infinity conference",

PHP example

The script below demonstrates how to use this API method. Don't forget to replace the ID in the URL before executing the call.

// dependencies

// change this into your access token
$api = new CopernicaRestAPI("your-access-token", 4);

// execute the call

This example requires the REST API class

More information