« Back to Documentation OverviewcampaignBounceMessages – v1.2
campaignBounceMessages(string apikey, string cid, integer start, integer limit, string since)
Retrieve the full bounce messages for the given campaign. Note that this can return very large amounts
of data depending on how large the campaign was and how much cruft the bounce provider returned. Also,
message over 30 days old are subject to being removed
| Parameters | mcapi_campaignBounceMessages.php| apikey | a valid API Key for your user account. Get by visiting your API dashboard |
| cid | the campaign id to pull bounces for (can be gathered using campaigns()) |
| start | optional - for large data sets, the page number to start at - defaults to 1st page of data (page 0) |
| limit | optional - for large data sets, the number of results to return - defaults to 25, upper limit set at 50 |
| since | optional - pull only messages since this time - use YYYY-MM-DD format in GMT (we only store the date, not the time) |
| Returns | | array |
bounces the full bounce messages for this campaign |
| Returned Fields | string | date | date/time the bounce was received and processed | string | email | the email address that bounced | string | message | the entire bounce message received |
Examples (1)
download example code
[1] mcapi_campaignBounceMessages.php
<?php
/**
This Example shows how to retrieve full Bounce Message data associated with a
campaign and do some basic error checking.
**/
require_once 'inc/MCAPI.class.php';
require_once 'inc/config.inc.php'; //contains apikey
$api = new MCAPI($apikey);
$msgs = $api->campaignBounceMessages($campaignId);
if ($api->errorCode){
echo "\tCode=".$api->errorCode."\n"; echo "\tMsg=".$api->errorMessage."\n"; } else {
foreach($msgs as $msg){
echo $msg['date']." - ".$msg['email']."\n"; }
}
?>