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

3

7

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

Deathful answered 27/11, 2015 at 14:35 Comment(0)
P
4

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

Pedagogics answered 12/10, 2016 at 21:38 Comment(1)
This endpoint has bad performance, It will take approximately 10 seconds per 10.000 members in a listCrossly
O
1

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.

Octuple answered 9/4, 2019 at 9:37 Comment(0)
G
1

Since soft bounce will not change status inside the list(audience), to get soft bounce email from the list without specific campaign, you can use

GET lists/{list-id}/members/{subscriber_hash}/activity

This endpoint will only return for single email(contact), so you need to iterate through all email(contact) in the list.

Sample response:

"activity": [
        {
            "action": "bounce",
            "timestamp": "2019-05-01T23:02:26+00:00",
            "type": "soft",
            "campaign_id": "xxxxxxxxxx",
            "title": "Xxxx Xxxxxxx"
        },
        {
            "action": "sent",
            "timestamp": "2019-05-01T23:00:00+00:00",
            "type": "regular",
            "campaign_id": "xxxxxxxxxx",
            "title": "Xxxx Xxxxxxx"
        }
    ],
Gio answered 16/5, 2019 at 1:47 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.