Author | Topic: Mailchimp API | |
---|---|---|
Rudolf Reinthaler | Mailchimp API on Tue, 07 Oct 2014 11:27:18 +0200 Hello, I am just integrating Mailchimp in my software, but have the problem that the call method is not recognized. As I understand in the docs at http://apidocs.mailchimp.com/api/2.0/ the method must be in the url like in my example. But with "list" and also "campaigns/list" I get the attached return message. Whats wrong ? regards Rudolf FUNCTION mctest() ****************************************************************** local cUrl := "https://us5.api.mailchimp.com/2.0/?method=list" local cJson := "",cc TEXT INTO cJson WRAP { "apikey": "64790efa18adfasdfas678aa8967ca52-us5", "type": "campaign", } ENDTEXT altd() oHttp := TServerXMLHTTPRequest():New() if oHttp:Open("POST",cUrl,,"myname","mypwd") dc_hourglasson() oHTTp:lIgnoreCertAll := .t. if oHttp:Send() sleep(5) cc := oHttp:responseBody if valtype(cc) = "C" txtview(cc) else dcqdebug cc wmeld("wrong return type " + valtype(cc)) endif //altd() else dc_hourglassoff() wmeld("Error HTTP POST") endif dc_hourglassoff() else dc_hourglassoff() wmeld("Error connect to " + Url) endif return .t. Return value c <?xml version="1.0" encoding="utf-8"?> <methodResponse> <fault> <value> <struct> <member> <name>faultCode</name> <value> <int>-32601</int> </value> </member> <member> <name>faultString</name> <value> <string>Unknown method "/"</string> </value> </member> </struct> </value> </fault> </methodResponse> --- Diese E-Mail ist frei von Viren und Malware, denn der avast! Antivirus Schutz ist aktiv. http://www.avast.com | |
Stephen Bryan | Re: Mailchimp API on Wed, 08 Oct 2014 08:16:21 -0400 Rudolf, Not being familiar with asinet I'm not sure how much help I can be but I do integrate with Mailchimp using xml. The response Unknown Method seems to indicate the message being sent isn't formed correctly. Does asinet have the ability to create a log so you can see what is actually being sent? Stephen "Rudolf Reinthaler" wrote in message news:20a8d0f$45c98df5$a41@news.alaska-software.com... Hello, I am just integrating Mailchimp in my software, but have the problem that the call method is not recognized. As I understand in the docs at http://apidocs.mailchimp.com/api/2.0/ the method must be in the url like in my example. But with "list" and also "campaigns/list" I get the attached return message. Whats wrong ? regards Rudolf FUNCTION mctest() ****************************************************************** local cUrl := "https://us5.api.mailchimp.com/2.0/?method=list" local cJson := "",cc TEXT INTO cJson WRAP { "apikey": "64790efa18adfasdfas678aa8967ca52-us5", "type": "campaign", } ENDTEXT altd() oHttp := TServerXMLHTTPRequest():New() if oHttp:Open("POST",cUrl,,"myname","mypwd") dc_hourglasson() oHTTp:lIgnoreCertAll := .t. if oHttp:Send() sleep(5) cc := oHttp:responseBody if valtype(cc) = "C" txtview(cc) else dcqdebug cc wmeld("wrong return type " + valtype(cc)) endif //altd() else dc_hourglassoff() wmeld("Error HTTP POST") endif dc_hourglassoff() else dc_hourglassoff() wmeld("Error connect to " + Url) endif return .t. Return value c <?xml version="1.0" encoding="utf-8"?> <methodResponse> <fault> <value> <struct> <member> <name>faultCode</name> <value> <int>-32601</int> </value> </member> <member> <name>faultString</name> <value> <string>Unknown method "/"</string> </value> </member> </struct> </value> </fault> </methodResponse> --- Diese E-Mail ist frei von Viren und Malware, denn der avast! Antivirus Schutz ist aktiv. http://www.avast.com | |
Rudolf Reinthaler | Re: Mailchimp API on Wed, 08 Oct 2014 14:49:09 +0200 Hello Stephen, I will contact Pablo, the function is from OT4XB, I think make something wrong in the url. regards Rudolf Am 08.10.2014 14:16, schrieb Stephen Bryan: > Rudolf, > > Not being familiar with asinet I'm not sure how much help I can be but I > do integrate with Mailchimp using xml. > The response Unknown Method seems to indicate the message being sent > isn't formed correctly. Does asinet have the ability to create a log so > you can see what is actually being sent? > > Stephen > > > > > > > > "Rudolf Reinthaler" wrote in message > news:20a8d0f$45c98df5$a41@news.alaska-software.com... > > Hello, > I am just integrating Mailchimp in my software, but have the problem > that the call method is not recognized. As I understand in the docs at > http://apidocs.mailchimp.com/api/2.0/ > the method must be in the url like in my example. > But with "list" and also "campaigns/list" I get the attached return > message. > Whats wrong ? > regards > Rudolf > > > FUNCTION mctest() > ****************************************************************** > local cUrl := "https://us5.api.mailchimp.com/2.0/?method=list" > local cJson := "",cc > > TEXT INTO cJson WRAP > { > "apikey": "64790efa18adfasdfas678aa8967ca52-us5", > "type": "campaign", > } > ENDTEXT > > altd() > > oHttp := TServerXMLHTTPRequest():New() > if oHttp:Open("POST",cUrl,,"myname","mypwd") > dc_hourglasson() > oHTTp:lIgnoreCertAll := .t. > if oHttp:Send() > sleep(5) > cc := oHttp:responseBody > if valtype(cc) = "C" > txtview(cc) > else > dcqdebug cc > wmeld("wrong return type " + valtype(cc)) > endif > //altd() > else > dc_hourglassoff() > wmeld("Error HTTP POST") > endif > dc_hourglassoff() > else > dc_hourglassoff() > wmeld("Error connect to " + Url) > endif > > > return .t. > > > Return value c > > > > <?xml version="1.0" encoding="utf-8"?> > <methodResponse> > <fault> > <value> > <struct> > <member> > <name>faultCode</name> > <value> > <int>-32601</int> > </value> > </member> > <member> > <name>faultString</name> > <value> > <string>Unknown method "/"</string> > </value> > </member> > </struct> > </value> > </fault> > </methodResponse> > > > --- > Diese E-Mail ist frei von Viren und Malware, denn der avast! Antivirus > Schutz ist aktiv. > http://www.avast.com --- Diese E-Mail ist frei von Viren und Malware, denn der avast! Antivirus Schutz ist aktiv. http://www.avast.com |