API kald til MailChimp
Hejsa,Jeg skal kunne oprette en ny bruger på mailchimp via deres API.. jeg har denne her kode fra deres site.. men jeg er ikke helt med på hvordan jeg skal bruge den??
Håber der er nogle som kan hjælpe :)
'Define these variables.
Dim apikey
Dim listid
Dim MCURL = "http://api.mailchimp.com/1.2/"
Function listSubscribe (strEmail, strFirstName, strLastName, strPhone)
Dim resp
Dim merge_vars
Dim ParamArr
Set merge_vars = Server.CreateObject("Scripting.Dictionary")
With merge_vars
.Add "OPTINIP", Request.ServerVariables("REMOTE_ADDR")
.Add "double_optin", False
.Add "FNAME", strFirstName
.Add "LNAME", strLastName
.Add "phone", strPhone
End With
'Function Reference: listSubscribe(string apikey, string id, string email_address, array merge_vars, string email_type, boolean double_optin, boolean update_existing, boolean replace_interests, boolean send_welcome)
'NOTE THAT EMPTY VALUES DO NOT WORK WELL WITH THIS VERSION OF XLMRPC.ASP. BEST TO SEND EMPTY STRINGS.
'ParamArr = array(apikey,listid,strEmail,merge_vars,"",True,True,True,True)
ParamArr = array(apikey,listid,strEmail,merge_vars,"",True,True,True,True)
resp = xmlRPC(MCURL,"listSubscribe",ParamArr)
'Uncomment below for Error Checking
Response.Write(Session("xmltxt")&"<br>")
Response.Write(Session("ServerResponseText")&"<br>")
LGNListSubscribe = resp
End Function