So I've been messing around with Mail Chimp. They have an API that allows access to a variety of functions, including downloading your current mailing list and sending emails through them via a third party (i.e. VFP.) However, I haven't been able to figure out what the magic combination of parms to connect to their API is via West Wind.
This string works in the browser:
<<a href="http://us3.api.mailchimp.com/export/1.0/list?apikey=veryverysecret&id=alsosecret" target="top" >>http://us3.api.mailchimp.com/export/1.0/list?apikey=veryverysecret&id=alsosecret<</a>>
but passing it to httpConnect and httpGet in various combos like so:
cPrefix = '' (or '<<a href="http://" target="top" >>http://<</a>>' or 'https://')
cAPIkey = 'veryverysecret'
cListID = 'alsosecret'cURL1= cPrefix + "us3.api.mailchimp.com"
cURL2 = "export/1.0/list"
o.httpconnect(cURL1)
o.AddPostKey("apikey",cAPIkey)
o.AddPostKey("id",cListID)cURL1= cPrefix + "us3.api.mailchimp.com/export/1.0/"
cURL2 = "list"
o.httpconnect(cURL1)
o.AddPostKey("apikey",cAPIkey)
o.AddPostKey("id",cListID)cURL1= cPrefix + "us3.api.mailchimp.com/"
cURL2 = "export/1.0/list?apikey="+cAPIkey+"&id="+cListID
o.httpconnect(cURL1)
and then
m.liResult=o.HTTPGet(cURL2, @m.lcStringReceived, @m.liText)
And always get o.cErrorMsg = "The server name or address could not be resolved"
If I stuff the entire URL into httpConnect and pass an empty string to httpGet, I get either "You must provide a server name (ie. www.somedomain or 111.111.111.121), not a URL." or "The URL is invalid" depending on if I'm passing http or https.
Suggestions?
Whil
I would just try
response = o.HTTPget("http://us3.api.mailchimp.com/export/1.0/list?apikey=veryverysecret&id=alsosecret")
Hi folks, been a while, eh?
So I've been messing around with Mail Chimp. They have an API that allows access to a variety of functions, including downloading your current mailing list and sending emails through them via a third party (i.e. VFP.) However, I haven't been able to figure out what the magic combination of parms to connect to their API is via West Wind.
This string works in the browser:
but passing it to httpConnect and httpGet in various combos like so:
cPrefix = '' (or 'http://' or 'https://')
cAPIkey = 'veryverysecret'
cListID = 'alsosecret'cURL1= cPrefix + "us3.api.mailchimp.com"
cURL2 = "export/1.0/list"
o.httpconnect(cURL1)
o.AddPostKey("apikey",cAPIkey)
o.AddPostKey("id",cListID)cURL1= cPrefix + "us3.api.mailchimp.com/export/1.0/"
cURL2 = "list"
o.httpconnect(cURL1)
o.AddPostKey("apikey",cAPIkey)
o.AddPostKey("id",cListID)cURL1= cPrefix + "us3.api.mailchimp.com/"
cURL2 = "export/1.0/list?apikey="+cAPIkey+"&id="+cListID
o.httpconnect(cURL1)
and then
m.liResult=o.HTTPGet(cURL2, @m.lcStringReceived, @m.liText)
And always get o.cErrorMsg = "The server name or address could not be resolved"
If I stuff the entire URL into httpConnect and pass an empty string to httpGet, I get either "You must provide a server name (ie. www.somedomain or 111.111.111.121), not a URL." or "The URL is invalid" depending on if I'm passing http or https.
Suggestions?
Whil
-- thn (FoxInCloud)
AddPostKey() sets POST keys, but the API seems to be asking for querystring values for the ids. So you end up pushing a POST operation to an endpoint that likely only supports a GET...
+++ Rick ---
Hi folks, been a while, eh?
So I've been messing around with Mail Chimp. They have an API that allows access to a variety of functions, including downloading your current mailing list and sending emails through them via a third party (i.e. VFP.) However, I haven't been able to figure out what the magic combination of parms to connect to their API is via West Wind.
This string works in the browser:
but passing it to httpConnect and httpGet in various combos like so:
cPrefix = '' (or 'http://' or 'https://')
cAPIkey = 'veryverysecret'
cListID = 'alsosecret'cURL1= cPrefix + "us3.api.mailchimp.com"
cURL2 = "export/1.0/list"
o.httpconnect(cURL1)
o.AddPostKey("apikey",cAPIkey)
o.AddPostKey("id",cListID)cURL1= cPrefix + "us3.api.mailchimp.com/export/1.0/"
cURL2 = "list"
o.httpconnect(cURL1)
o.AddPostKey("apikey",cAPIkey)
o.AddPostKey("id",cListID)cURL1= cPrefix + "us3.api.mailchimp.com/"
cURL2 = "export/1.0/list?apikey="+cAPIkey+"&id="+cListID
o.httpconnect(cURL1)
and then
m.liResult=o.HTTPGet(cURL2, @m.lcStringReceived, @m.liText)
And always get o.cErrorMsg = "The server name or address could not be resolved"
If I stuff the entire URL into httpConnect and pass an empty string to httpGet, I get either "You must provide a server name (ie. www.somedomain or 111.111.111.121), not a URL." or "The URL is invalid" depending on if I'm passing http or https.
Suggestions?
Whil
West Wind Technologies
Making waves on the Web
from Maui
Got that piece working nicely now. I was using some of my old code as a template, and had a mental block about using httpConnect.
Whil
Hi Whil,
I would just try
response = o.HTTPget("http://us3.api.mailchimp.com/export/1.0/list?apikey=veryverysecret&id=alsosecret")