Skip to content

Latest commit



70 lines (45 loc) · 2.1 KB

File metadata and controls

70 lines (45 loc) · 2.1 KB

REST API: GET destination/message body (Marketing Suite)

You can retrieve the message body sent to a destination with an HTTP GET call to the URL corresponding to the desired output format. The URL always included the $id, which is the unique string that identifies a message.

Depending on the format the output looks different. MIME includes all the headers for example, while text only shows the plain text. Include the desired type in the URL. The default return format is HTML.

Note: The terms 'destination' and 'message' can be used interchangeably in this article, including the code examples.


HTML stands for HyperText Language Markup/internet markup. To retrieve the HTML message body you can send a request to the following URL:$id/body

or the following URL:$id/body/html


Mime is the internet standard for email. To retrieve the email in MIME format you can send the request to the following URL:$id/body/mime


It's also possible to request the message body in plain text. The corresponding URL for this request is:$id/body/text

PHP example

To request the message body you can use a script like the one below:

// import the helper class

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

// retrieve the message body in the default format (HTML in this case)

// retrieve the message body in HTML

// retrieve the message body in MIME format

// retrieve the message body in text format

The example above requires the CopernicaRestApi class.

More information