سؤال

Trying to get the PerceptiveMC API (http://perceptivemcapi.codeplex.com/) up and running. From the documentation I am able to get the 'Test Install' OK

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) _
Handles Me.Load
   Dim apikey As String = "YourApikey" ' or default to config
   GridView1.DataSource = MCAPISettings.ListAPISettings().ToList()
   GridView1.DataBind()
End Sub

I am trying to use the 'ListSubscribe' to enter a test to my MailChimp list but my output returns a failure each time

Dim input As listSubscribeInput = New listSubscribeInput()

        input.api_AccessType = EnumValues.AccessType.XmlRpc
        input.api_OutputType = EnumValues.OutputType.XmlRpc
        input.api_Validate = True
        input.parms.apikey = "xxxxxxxxxxxxxxxxxx-us4"
        input.parms.id = "xxxxxxxxx"
        input.parms.email_address = "test@test.com"
        input.parms.email_type = EnumValues.emailType.html
        input.parms.double_optin = True
        input.parms.send_welcome = True
        input.parms.update_existing = True
        input.parms.replace_interests = True
        input.parms.merge_vars.Add("FNAME", "Test")
        input.parms.merge_vars.Add("LNAME", "Test")

        ' do it
        Dim cmd As New listSubscribe(input)

        Dim output As listSubscribeOutput = cmd.Execute()

        ' check output
        If output.result = True Then
            Response.Write("Success")
        Else
            Response.Write("Fail")
        End If

During debugging I can see that cmd looks to be populated as expected but output.result returns as false.

I am not seeing any error message or warnings when building the code. Can anyone suggest how to uncover what the problem is?

EDIT

Ok, here is the error that I am encountering:

The remote name could not be resolved: 'us4.api.mailchimp.com' at 
System.Net.HttpWebRequest.GetRequestStream(TransportContext& context) at 
System.Net.HttpWebRequest.GetRequestStream() at 
CookComputing.XmlRpc.XmlRpcClientProtocol.Invoke(Object clientObj, MethodInfo mi, Object[] 
parameters) at CookComputing.XmlRpc.XmlRpcClientProtocol.Invoke(MethodInfo mi, Object[] 
Parameters) at XmlRpcProxy2e8b139c-9016-4a0e-8cc6-5d8c78fa9a26.listSubscribe(String 
apikey, String id, String email_address, XmlRpcStruct merge_vars, String email_type, 
Boolean double_optin, Boolean update_existing, Boolean replace_interests, Boolean 
send_welcome) at PerceptiveMCAPI.Methods.listSubscribe.ExecuteXmlRpc()

EDIT

The above error seems to be a problem directly related to the server that my test is running on. I am now getting a 407 Proxy Authentication required message.

هل كانت مفيدة؟

المحلول

This was resolved by adding an exception to my proxy for us4.api.mailchimp.com

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top