Ich habe mein Problem gelöst. Was ich getan habe, um das gewünschte Ergebnis zu erzielen, ist unten, wenn es anderen hilft.
$firstofmonth = date("Y-m-01"); // Date from when you want the count to begin
$arr = array();
$ch = curl_init();
$url = "https://" . $server . "api.mailchimp.com/3.0/reports?since_send_time=" . $firstofmonth;
curl_setopt($ch, CURLOPT_USERPWD, 'apikey:' . $api_key);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Authorization: Basic ' . $auth
));
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_URL,$url);
$result=curl_exec($ch);
curl_close($ch);
$results = json_decode($result, true);
$reports = $results['reports'];
$emails_sent = 0;
foreach ($reports as $row){
$emails_sent += $row['emails_sent'];
}
$arr[] = array
(
"emailssent" => $emails_sent
);
echo json_encode($arr);