Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
70 lines (52 sloc) 2.32 KB

REST API: GET unsubscribes (Publisher destination)

You can retrieve the statistics per emailing destination just like you would retrieve the statistics of a mailing. You can retrieve the unsubscribes for an emailing destination by sending an HTTP GET call to the following URL:

https://api.copernica.com/v2/publisher/destination/$id/unsubscribes?access_token=xxxx

Where the $id should be replaced with the ID of the emailing destination. This method also support the use of the fields parameter for the timestamp field.

Returned fields

The method returns a JSON object with several unsubscribes in the 'data' field. For each unsubscribe the following information is available:

  • ID: The ID of the unsubscribe.
  • timestamp: The timestamp of the unsubscribe.
  • source: The source of the unsubscribe: Either from a link or an email.
  • success: Whether the unsubscribe was successful or not.
  • emailing: The ID of the emailing.
  • destination: The ID of the destination.
  • profile: The ID of the profile.
  • subprofile: The ID of the subprofile (if applicable).

JSON example

A single unsubscribe might look something like this:

{  
   "ID":"1",
   "timestamp":"2011-11-09 12:42:35",
   "source":"link",
   "success":true,
   "emailing":"42341",
   "destination":"847259",
   "profile":"5063195",
   "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("publisher/destination/{$destinationID}/unsubscribes/"));

This example requires the REST API class.

More information

You can’t perform that action at this time.