I'm using

$query_params = json_decode('{"aggregated_by": "day", "limit": 500, "start_date": "2023-08-08", "end_date": "2023-08-08", "offset": 1}');

...

$response = $sg->client->stats()->get(null, $query_params);

to successfully retrieve my global stats (how many bounces etc), but how do I get the actual recipient email addresses for bounced and spam reported emails so that I can flag them as not to be contacted in my database? All that I'm seeing is:

 [{"date":"2023-08-08","stats":[{"metrics":{"blocks":0,"bounce_drops":0,"bounces":1,"clicks":0,"deferred":0,"delivered":1,"invalid_emails":0,"opens":0,"processed":2,"requests":2,"spam_report_drops":0,"spam_reports":0,"unique_clicks":0,"unique_opens":0,"unsubscribe_drops":0,"unsubscribes":0}}]}]

My preference is to use the Event API rather than Webhook, as I only want to get the stats when I poll for them weekly, not have my server deal with them in real time.

Thank you.

0

There are 0 best solutions below