« Back to Documentation OverviewlistAbuseReports – v1.3
listAbuseReports(string apikey, string id, int start, int limit, string since)
Get all email addresses that complained about a given campaign
| Parameters | mcapi_listAbuseReports.php| 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 |
the total of all reports and the specific reports reports this page
| int | total | the total number of matching abuse reports
| | array | data | the actual data for each reports, including:
| string | date | date/time the abuse report was received and processed
| | string | email | the email address that reported abuse
| | string | campaign_id | the unique id for the campaign that report was made against
| | string | type | an 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
<?php
// Include the MailChimp API code. Do Not Edit This!
require_once 'inc/MCAPI.class.php';
require_once 'inc/config.inc.php'; //contains apikey
$api = new MCAPI($apikey);
$reports = $api->listAbuseReports($listId);
if ($api->errorMessage!=''){
echo "\tCode=".$api->errorCode."\n"; echo "\tMsg=".$api->errorMessage."\n"; } else {
foreach($reports as $rpt){
echo $rpt['date']." - ".$rpt['email']." - "; echo $rpt['campaign_id']." - ".$rpt['type']."\n"; }
}
?>