3

I am building an SSIS package to communicate with the Mailchimp API and batch subscribe/unsubscribe emails to certain lists. The calls are sent fine and the job is started, every response I sent returns an error with a message of

<email> is already a list member.  Use PUT to insert or update list members

My problem is I am sending the request with a PUT Method, my sample call body is below.

{
    "operations": 
    [
        {
            "method": "PUT",
            "path":"lists/d09d88d1bd/members/71743C40CBFB64DC556CB4457DA012AE",
            "body":"{\"email_address\":\"email\",\"status\":\"unsubscribed\"}"
        }
    ]
}

I am getting the same error whether I make the API call straight from my SSIS package or if I use Postman REST Client.

ekad
  • 14,436
  • 26
  • 44
  • 46
plantpowerjames
  • 375
  • 2
  • 10
  • 22
  • Looks like you doing batch operations. So am I, and I am getting the same error on a few users. In a batch of about 3000 I got this error on 11 users. ... Did you find out what causes the error? – PeterKA Jan 21 '16 at 20:16
  • No I never got to the bottom of it unfortunately – plantpowerjames Feb 02 '16 at 13:38

1 Answers1

8

I had the same issue as well and it was because I did not convert the email address to lowercase before applying md5 to get the subscriber_hash.

The update method takes a subscriber id which is the md5 hash of the lowercase version of the email address.

According to the documentation, subscriber_hash refers to 'The MD5 hash of the lowercase version of the list member’s email address.'

http://developer.mailchimp.com/documentation/mailchimp/reference/lists/members/

jyek
  • 1,081
  • 9
  • 19
  • Thank you. The error message was weird and had no relation to the actual probelm. Your suggestion fixed the issue! – Preetham Reddy Jan 21 '17 at 05:20
  • I thought it would be something to do with case but couldn't figure out what was going on as both my imported and the existing emails had exactly the same case. Didn't realise the subscriber hash referred to a lowercase version! Lifesaver! – Sinister Beard May 31 '17 at 11:09