REST API v4: GET destinations (MS mailing)
You can retrieve the destinations for an emailing by sending an HTTP GET call to the following URL:
https://api.copernica.com/v4/draganddrop/emailing/$id/destinations
Where the $id
should be replaced with the ID of the emailing. This method
also support the use of the fields parameter
for the timestampsent field.
Optional parameters
- Unsubscribed: Set to 'true' for retrieving the unsubscribed destinations.
Returned fields
The method returns a JSON object with several destinations under the 'data' property. For each destination the following information is available:
- ID: Unique ID of the destination.
- mailing: ID of the mailing sent to this destination.
- timestampsent: Timestamp of sending to the destination.
- profile: Profile ID of the destination.
- subprofile: Subprofile ID of the destination.
JSON example
The destination might look something like this:
{
"ID":"783919",
"timestampsent":"2015-06-08 13:53:45",
"profile":"9033832",
"subprofile":null,
"mailing":"466"
}
PHP example
This script demonstrates how to use this API method:
// dependencies
require_once('CopernicaRestAPI.php');
// change this into your access token
$api = new CopernicaRestAPI("your-access-token", 4);
// execute the call
print_r($api->get("draganddrop/emailing/{$emailingID}/destinations/"));
This example requires the REST API class.