Error adding a simple subscribe... help me!

Jan 16, 2013 at 4:05 PM

I just would to add Giulietto Ferruzzo (of Pandora company) into my subscribers (I have only one list).

This is my code:

Private Sub Test()
        Dim chimp = New MCApi(MailchimpAPIKey, False)
        Dim listId As String = MailchimpUniqueIDList

        ' Setup Subscribe Options that will be used for all records add or updated during the BatchListSubscribe
        Dim options = New List.SubscribeOptions() With {.DoubleOptIn = False, .EmailType = List.EmailType.Html, .UpdateExisting = True, .ReplaceInterests = True}
        '
        Dim batch = New List(Of List.Merges)()

        Dim groupings = New List(Of List.Grouping)() From {}
        
        batch.Add(New List.Merges("giulioferri@gmail.com", List.EmailType.Html, groupings) From { _
         {"FNAME", "Giulietto"}, _
         {"LNAME", "Ferruzzo"}, _
         {"RAGSOCIALE", "Pandora"} _
     })

        Dim ret = chimp.ListBatchSubscribe(listId, batch, options)

        ltrRis.Text = ""
        ltrRis.Text &= String.Format("Email records Added:   {0}", ret.AddCount & "
"
) ltrRis.Text &= String.Format("Email records Updated: {0}", ret.UpdateCount & "
"
) ltrRis.Text &= String.Format("Email records Errors: {0}" & "
"
, ret.ErrorCount & "
"
) For Each [error] As List.BatchError In ret.Errors ltrRis.Text &= String.Format("ERROR: {0}" & "
"
, [error].Email, [error].Message & "
"
) Next End Sub

Why does it not work?

I've included in References both MailChimp.dll and FSharp.Core.

Please help me! Thanks! ;-)

Giulio

Coordinator
Jan 16, 2013 at 7:11 PM

Do you get any error? 

Jan 16, 2013 at 7:25 PM

No, only generic ERROR

Email records Added: 0

 Email records Updated: 0

 Email records Errors: 1

ERROR: giulioferri@gmail.com

Any ideas???


Coordinator
Jan 16, 2013 at 7:58 PM

Try ListSubscribe instead.

It may return more valuable information (if fails).

Jan 17, 2013 at 7:52 AM

Thanks. I figured it out using ListSubscribe :-)

But this dll's work only with framework 4.0... is there anything working with 3.5 one???

Thanks a lot again!

Giulio

Coordinator
Jan 17, 2013 at 8:08 AM
Edited Jan 17, 2013 at 8:09 AM

http://mcapinet.codeplex.com/discussions/360956