Back to Documentation Overview

campaignBounceMessages

public static 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

Section:
Campaign Stats
Parameters:
apikey a valid API Key for your user account. Get by calling login()
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

  1. <?php
  2. /**
  3. This Example shows how to retrieve full Bounce Message data associated with a
  4. campaign and do some basic error checking.
  5. **/
  6. require_once 'inc/MCAPI.class.php';
  7. require_once 'inc/config.inc.php'; //contains apikey
  8.  
  9. $api = new MCAPI($apikey);
  10.  
  11. $msgs = $api->campaignBounceMessages($campaignId);
  12.  
  13. if ($api->errorCode){
  14. echo "Unable to run campaignBounceMessages()!\n";
  15. echo "\tCode=".$api->errorCode."\n";
  16. echo "\tMsg=".$api->errorMessage."\n";
  17. } else {
  18. foreach($msgs as $msg){
  19. echo $msg['date']." - ".$msg['email']."\n";
  20. echo substr($msg['message'],0,150)."\n\n";
  21. }
  22.  
  23. }
  24.  
  25. ?>
  26.  
Add New Note User Contributed Notes for campaignBounceMessages
No notes, yet... Will you be the first??