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

99封情书 提交于 2019-12-09 16:48:46

问题


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?


回答1:


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




回答2:


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": "xxx@example.com",
        "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.




回答3:


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"
        }
    ],


来源:https://stackoverflow.com/questions/33959652/finding-cleaned-bounced-email-addresses-for-a-mailchimp-campaign-or-list

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!