« Back to Documentation Overview

listAbuseReports – v1.2

 listAbuseReports(string apikey, string id, integer start, integer limit, string since)

Get all email addresses that complained about a given campaign

Section
List Related
mcapi_listAbuseReports.php
Parameters
apikey a valid API Key for your user account. Get by visiting your API dashboard
id the list id to pull abuse reports for (can be gathered using lists())
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 500, upper limit set at 1000
since optional - pull only messages since this time - use YYYY-MM-DD HH:II:SS format in GMT
Returns
array reports the abuse reports for this campaign
Returned Fields
stringdatedate/time the abuse report was received and processed
stringemailthe email address that reported abuse
stringcampaign_idthe unique id for the campaign that reporte was made against
stringtypean internal type generally specifying the orginating mail provider - may not be useful outside of filling report views

Examples (1)

download example code

[1] mcapi_listAbuseReports.php

  1. <?php
  2.  
  3. // Include the MailChimp API code. Do Not Edit This!
  4. require_once 'inc/MCAPI.class.php';
  5. require_once 'inc/config.inc.php'; //contains apikey
  6.  
  7. $api = new MCAPI($apikey);
  8.  
  9. $reports = $api->listAbuseReports($listId);
  10.  
  11. if ($api->errorMessage!=''){
  12. echo "Unable to run listAbuseReports()!\n";
  13. echo "\tCode=".$api->errorCode."\n";
  14. echo "\tMsg=".$api->errorMessage."\n";
  15. } else {
  16. foreach($reports as $rpt){
  17. echo $rpt['date']." - ".$rpt['email']." - ";
  18. echo $rpt['campaign_id']." - ".$rpt['type']."\n";
  19. }
  20. }
  21.  
  22. ?>
  23.