Lists Batch Unsubscribe

130 views
Skip to first unread message

Jordan Slappendel

unread,
Jan 30, 2014, 10:55:46 PM1/30/14
to mailchimp-...@googlegroups.com
Hi Group,

I am trying to use the lists batch unsubscribe to remove emails from lists:

I am using the following code:

Verb = POST
Message = 
{
    "apikey": "api key here",
    "id": "list id here",
    "batch": [
 {
            "email": {
                "email": "email here",
                "euid": "euid here",
                "leid": "leid here"
            }
 }
  ],
    "delete_member": false,
    "send_goodbye": false,
    "send_notify": false
}

Header = Content-Type:application/xml;charset=UTF-8;action="http://2.0/lists/batch-unsubscribe", connection="keep-alive"

The response I am getting is = 
<?xml version="1.0" encoding="utf-8"?>
<result type="dict"><success_count type="integer">0</success_count><error_count type="integer">1</error_count><errors type="array"><value type="dict"><code type="integer">232</code><error type="string">There is no record of the email address "Array" in your account</error><email type="dict"><email type="dict"><email type="string">email here</email><euid type="string">euid here</euid><leid type="string">leid here</leid></email></email></value></errors></result>


I have run my JSON code through jsonlint.com and it validates fine. I have checked, double checked and triple check the email address is in the list I am trying to remove it from....

Any ideas?

Thanks and have a great weekend.


Jordan
Maxim Software

Brian

unread,
Feb 1, 2014, 8:03:46 PM2/1/14
to mailchimp-...@googlegroups.com
Hey there Jordan!

You're so close! Your email arrays in your batch-unsubscribe call just needs a bit of tweaking! Currently it is:

"batch": [
   
{
       
"email": {
           
"email": "email here",
           
"euid": "euid here",
           
"leid": "leid here"
       
}
   
}
],


and it should be:

"batch": [
   
{
       
"email": "example email",
       
"euid": "example euid",
       
"leid": "example leid"
   
},
   
{
       
"email": "example email",
       
"euid": "example euid",
       
"leid": "example leid"
   
}
],

As you can see, you basically need to remove that extra email line from your JSON.

-Brian
Reply all
Reply to author
Forward
0 new messages