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

Each emailing is tracked, which allows Copernica to provide you with emailing statistics. Deliveries are one of these statistics. You can retrieve all deliveries for a specific destination by sending an HTTP GET call to the following URL:

https://api.copernica.com/v2/ms/destination/{$destinationID}/deliveries?access_token=xxxx

This method also support the use of the fields parameter for the timestamp field.

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

Returned fields

The method returns a JSON object with several deliveries. For each delivery the following information is available:

  • ID: The ID of the delivery.
  • mailing: The ID of the mailing.
  • timestamp: The timestamp of delivery.
  • attempts: Number of attempts made before the delivery.
  • destination: The ID of the destination that was delivered to.
  • profile: The ID of the profile that was delivered to.
  • subprofile: The ID of the subprofile that was delivered to.

JSON example

A single delivery might look something like this:

{  
   "ID":"1",
   "mailing":"33",
   "timestamp":"2014-11-06 13:43:17",
   "attempts":1,
   "destination":"312",
   "profile":null,
   "subprofile":null
}

PHP example

This script demonstrates how to use this API method:

// dependencies
require_once('copernica_rest_api.php');

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

// execute the call
print_r($api->get("ms/destination/{$destinationID}/deliveries"));

This example requires the REST API class.

More information