ASP - campaignCreate

 
Vista:

campaignCreate

Publicado por Alvaro (1 intervención) el 09/08/2011 17:34:00
Tengo problemas para crear una campaña en mailchimp desde mi pagina en asp classic!!


alguien tiene alguna idea?

Les dejo el codigo pero no me funciona la funcion q convierte a xml:


function functionToXML(methodName, paramArr)
dim i

' Clear the global return string
xmlText=""

' Begin header, method call
addTxt "<?xml version=""1.0""?>" _
& "<methodCall>" _
& "<methodName>" _
& methodName _
& "</methodName>" _

' If we have arguments, add them
addTxt "<params>"
if isArray(paramArr) Then
if UBound(paramArr, 1)>=0 then
for i = 0 to UBound(paramArr, 1)
If Not IsEmpty(paramArr(i)) Then
addTxt "<param>"
addItem paramArr(i)
addTxt "</param>"
End IF
next
end if
Else
addTxt "<param>"
addItem paramArr
addTxt "</param>"
End If
addTxt "</params>"
addTxt "</methodCall>"

functionToXML = xmlText ' returning a global variable for convenience
end function



Dim apikey
Dim listid
Dim MCURL
Dim ParamList(0)

'listid = "36280"
listid = "8bd6669c90"
apikey = "588c9691d1f564b0e2dcf0afd999fed6-us2"
MCURL = "http://us1.api.mailchimp.com/1.3/"


Set options_vars = Server.CreateObject("Scripting.Dictionary")
With options_vars
.Add "list_id", listid
.Add "subject", "primer email"
.Add "from_email", "[email protected]"
.Add "from_name", "Alvaro"
.Add "to_name", "Lista de distribucion"
End With

Set content = Server.CreateObject("Scripting.Dictionary")
With content
.Add "html", "algo"
.Add "text", "algo"
End With

Set ParamList(0) = Server.CreateObject("Scripting.Dictionary")
With ParamList(0)
.Add "apikey", apikey
.Add "type", listid
.Add "options", options_vars
.Add "content", content
End With


' go from simple ASCII to xmlrpc
' Create the requestBody from the methodName and paramArr

requestText = functionToXML("campaignCreate", ParamList)


response.write "Preparing to send: " & server.htmlencode(requestText)
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder