Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Finding cleaned/bounced email addresses for a MailChimp campaign or list

I'd like to automate the gathering of unsubscribe and cleaned email accounts for a given campaign.

In the API playground, I see all the methods available on the List entity.

Unsubscribes

I see that it's in the LIST API GET reports/xxxxxx/unsubscribed

Cleaned

Where can I find the cleaned/bounced emails from a list or campaign? I know I can see the count of bounced in various places, but I'd like to find the email addresses that actually bounced, and the first and last names of the list member. Basically I'd like the API same as the 'export cleaned to csv' available on the website.

How can I use the MailChimp 3.0 API to do this?

methods on a list

like image 474
p.campbell Avatar asked Nov 27 '15 14:11

p.campbell


People also ask

Do cleaned contacts count in Mailchimp?

Cleaned contacts don't count toward audience limits and cannot be archived. Cleaned contacts can be deleted but we recommend you keep them in your audience to avoid bounces.

Can you resubscribe cleaned contacts in Mailchimp?

If you've manually unsubscribed contacts from your email marketing, you can resubscribe them. Contacts who unsubscribe themselves will need to resubscribe through your signup form.


2 Answers

You can do

GET lists/list_id/members?status=unsubscribed

to get unsubscribed users

GET lists/list_id/members?status=cleaned

to get cleaned/bounced users

like image 173
Ruslan Migory Avatar answered Oct 14 '22 11:10

Ruslan Migory


For the bounced emails in a specific campaign you need to do this:

GET /3.0/reports/campaign_id/email-activity

and iterate though all recipients in the campaign, manually locating actions with type=bounce.

    {
        "email_address": "[email protected]",
        "activity": [
            {
                "action": "bounce",
                "type": "hard",
                "timestamp": "2019-04-08T00:00:00+00:00"
            }
        ]
    },

Unfortunately MailChimp has very bad performance on this endpoint, approximately 25 seconds to return activity for a campaign with 500 recipients.

like image 21
Henrik Høyer Avatar answered Oct 14 '22 09:10

Henrik Høyer