0

It could return the emails associated with "status": "pending" or just the number of accounts with status pending for that list. I'm just interested in knowing how many signups fall off as a result of the double opt in process.

I was able to test in the MailChimp API playground for a limited number of members, but not sure how to do the request for the full list. Thank you!!

1 Answers1

0

If you only want to know how many members with pending status in a certain list, then you can do so by making a GET request to the following endpoint as described here:

/lists/{list_id}/members

Change {list_id} to the id of your list and set the status query string parameter to pending. You will get a response containing total_items field and the value is what you're looking for.

ekad
  • 14,436
  • 26
  • 44
  • 46
  • Thanks so much - the issue is resolved! Originally it was just returning 10 results but then I read that with the latest API you have to pass in count and offset parameters to get more results beyond 10. Anyway this is what I ran `curl -H "Authorization: apikey myAPIKeyHere" https://us7.api.mailchimp.com/3.0/lists/myListIDHere/members‌​?status=pending` then whatever parameters for the section of the list I wanted. – Jacqueline Boltik Jan 12 '17 at 04:38
  • Yes you're right. You should utilize the `count` and `offset` parameters if you want to get all of the pending emails. That also depends on how many total records indicated by the `total_items` in the response body. – ekad Jan 12 '17 at 04:40
  • I celebrated too soon `total_items` is not working for the count... perhaps I am not requesting it properly. If you know offhand the proper way with curl I'd really appreciate it, but if not no worries you've already been a huge help. – Jacqueline Boltik Jan 12 '17 at 05:03
  • Your original request: `curl -H "Authorization: apikey myAPIKeyHere" https://us7.api.mailchimp.com/3.0/lists/myListIDHere/members‌​‌​?status=pending` is fine. You'll get 10 results, but you'll also get `total_items` in the response body, and that's what you need for making the second request in order to get all of the pending emails. For example if the `total_items` says 100, then you should make the same request again, but with `count` parameter set to 100. The response will contain 100 results and you can enumerate through the `members` field in the response body. – ekad Jan 12 '17 at 05:13
  • For some reason when I run `curl -H "Authorization: apikey myAPIKeyHere" https://us7.api.mailchimp.com/3.0/lists/myListIDHere/members‌​‌​‌​?status=pending` I get the response of total_items and 10 email addresses as expected, but when I add count to the query string with the `total_items` returned in the first query to that original request, I get a response that has 0 total items, and 0 emails in the response. I've tried doing the query a few different ways, but all have come up empty. Anyway appreciate your help so far and no worries if you don't have further ideas but thought I would ask. – Jacqueline Boltik Jan 16 '17 at 03:44
  • took chatting with mailchimp help but it turns out the shell was truncating the query after the & - so they were only getting the offset, not the count parameter. Adding quotes fixed the issue [more info here](http://stackoverflow.com/questions/9100099/why-is-curl-truncating-this-query-string) – Jacqueline Boltik Jan 16 '17 at 08:41