3

Is it possible to check whether the email is already in a list or not via the new MailChimp API v3.0?

I know I can make a post request to the lists/{list_id}/members/ endpoint that returns a 400 Bad Request error if the email is in the list. This is ok and it helps, but it does subscribe the email as well if it is not in there already.

My main goal is not to subscribe just to check.

ekad
  • 14,436
  • 26
  • 44
  • 46
rolandsaven
  • 143
  • 2
  • 9

1 Answers1

20

The ID of the user is the MD5 hash of their email address. So make a call to /3.0/lists/<list_id>/members/<email_md5> -- if that returns a 404, the user isn't on your list. If you get a 200, the resulting object has a status field that will tell you whether the user is subscribed or not.

TooMuchPete
  • 4,583
  • 2
  • 17
  • 21
  • Oh thank you so much! Really wanted to just comment a thanks, but I know stackoverflow doesn't like that. So for anyone who wants to test this and play around with the api, I recommend using the "Postman" plugin for chrome, and http://www.miraclesalad.com/webtools/md5.php for generating the MD5 of the email. That's how I test it out. – Steven Rogers Jun 01 '15 at 21:54