Skip to content
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
Cannot retrieve contributors at this time

REST API: GET content (Publisher destination)

You can retrieve the content per emailing that is sent to the destination. You can retrieve this with the HTTP GET call to the following URL:$id/content/$type?access_token=xxx

Where the $id should be replaced with the ID of the emailing destination. As optional paramater you could add the type (html, amp, text or subject) of the content. When you want to retrieve multiple content types you could combine those with html+text+subject. When there is no type specified, all types are returned.

Returned fields

The method returns a JSON object with the following values:

  • html: the HTML conent of the mailing, van de mailing, if requested;
  • text: the text conent of the mailing, van de mailing, if requested;
  • amp: the AMP conent of the mailing, van de mailing, if requested;
  • subject: the subject of the mailing, if requested;

JSON example

The JSON for a single click looks somewhat like this:

    "html": "<b>HTML content</b>",
    "text": "Text content",
    "subject": "This is a test mailing"

PHP example

This script demonstrates how to use this API method:

// dependencies

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

// set the type
$parameters = array(
    'type'    =>  ‘html+test+subject’

// execute the call
print_r($api->get("publisher/destination/{$destinationID}/content/", $parameters));

This example requires the REST API class.

More information