Mailchimp Classic ASP endpoint error

2019-08-31 04:16发布

问题:

I'm using a method illustrated here:

http://apidocs.mailchimp.com/api/downloads/serialized_xml_listsubscribe.asps

I am using a correct API Key and ListID - However, when running the script I am getting the following response:

"You must specify a email_address value for the listSubscribe method -90"

I've searched and mailed their support but had no reply back as yet. Has anyone had a similar issue - any thoughts on it there's a parameter missing?

Cheers.

Heres the code from the Mailchimp example:

Dim email
Dim apikey
Dim listId
Dim resp

email = Trim(Request.Form("Email"))
list_id = "xxxxxx"
apikey = "zzzzzzzzzzzzzzzzzzzzzz"

Dim xmlhttp
Set xmlhttp = Server.Createobject("MSXML2.ServerXMLHTTP")
xmlhttp.Open "GET","http://<my-dc>.api.mailchimp.com/1.3/?method=listSubscribe&output=xml&apikey=" & apikey & "&id=" & list_id & "&email=" & Server.URLEncode(email) & "&merge_vars=",false
xmlhttp.send
resp = xmlhttp.responsetext
Set xmlhttp = Nothing

回答1:

try email_address instead of email

xmlhttp.Open "GET","http://<my-dc>.api.mailchimp.com/1.3/?method=listSubscribe&output=xml&apikey=" & apikey & "&id=" & list_id & "&email_address=" & Server.URLEncode(email) & "&merge_vars=",false