Unsubscribe by segment?

Sep 12, 2011 at 7:54 PM

I have a web service app that syncs my customer's database with their MailChimp list each night.  Right now for the unsubscribes, I just retreive the list of from MailChimp and update my database accordingly.  Now the customer wants to determine which of the list segments (they have four) the unsubscribe came from before further processing.  Is this possible? I haven't found a way to determine this yet.

My code for getting the unsubscribe list is below.  Thanks!

   private List<MCItem> getMCList()
            bool Encode = true;
            bool Validate = false;
            List<MCItem> lst = new List<MCItem>();

            listMembersInput input = new listMembersInput();
            input = LoadBaseInput<listMembersInput>(input, AccessType, OutType, MethodType, Encode, Validate);
            input.parms.apikey = apikey;
            input.parms.since = Convert.ToDateTime(lastrundate);
            input.parms.id = listid;
            input.parms.status = EnumValues.listMembers_status.unsubscribed;
            input.parms.limit = numrecs;
            listMembers cmd = new listMembers(input);
            listMembersOutput output = cmd.Execute();

            MCItem itm;
            foreach (listMembersResults ThisMember in output.result)
                itm = new MCItem();
                itm = getMCItem(ThisMember.email);     
            return lst;


Sep 12, 2011 at 7:58 PM

I forgot to mention, the only idea I have for this is to analyze the information in the listMemberActivity class for each unsubscriber, and see if I can figure it out based on what the last item sent to them was.  Seems a bit ugly though.  Thanks again!


Nov 15, 2011 at 11:45 AM
Edited Nov 15, 2011 at 11:48 AM

How do you retreive the list of from MailChimp and update your database accordingly....Can u send me the source code

Plz send me your reply as soon as possible

I have the following code for it.... 

But this code is not to update the db how to i do that and in this code my problem is in this link::


private void GetUnsubscribers(string apikey, string MailChimpCampaignID)        {
            campaignUnsubscribesInput input = new campaignUnsubscribesInput();            input.api_AccessType = PerceptiveMCAPI.EnumValues.AccessType.Serial;            input.api_CustomErrorMessages = true;            input.api_MethodType = PerceptiveMCAPI.EnumValues.MethodType.POST;            input.api_Validate = true;            input.api_OutputType = PerceptiveMCAPI.EnumValues.OutputType.XML;            input.parms.apikey = apikey;            input.parms.cid = MailChimpCampaignID;                        //input.parms.start = PageIndex;            //input.parms.limit = PageSize;
            campaignUnsubscribes unsubscribe = new campaignUnsubscribes();            campaignUnsubscribesOutput output = unsubscribe.Execute(input);
            Unsubscribers.AddRange(output.result.data);            //string unsubscriber = "0";            //foreach (string item in output.result.data)            //{            //    unsubscriber = output.result.data.ToString();            //}                        string unsubscribers = Unsubscribers.Count.ToString();                        Page.ClientScript.RegisterStartupScript(typeof(Page), "alert", "");            //Unsubscribers.Reverse();            //dlUnsubscribes.DataSource = Unsubscribers.Take(10);            //dlUnsubscribes.DataBind();
            //dlUnsubscribes.Visible = (Unsubscribers.Count > 0);        }