REST API v3: GET template directory (Marketing Suite)

You can use the REST API to retrieve information of a template directory with an HTTP GET call to the following URL:

https://api.copernica.com/v3/ms/directory/$id?access_token=xxxx

Where $id should be replaced with the ID of the template directory.

Returned fields

The method returns a JSON object containing the following information:

  • parentID: The ID of the parent template directory.
  • name: The name of the directory (if any).

JSON example

The JSON will look something like this:

{  
   "parentID":"",
   "name":"ExampleFolder",
}

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
require_once('copernica_rest_api.php');

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

// execute the call
print_r($api->get("ms/directory/{$id}"));

This example requires the REST API class

More information