[MailChimp] Error: undefined - Unable to connect to the MailChimp API endpoint.
Closed this issue · 4 comments
Worked on this for a few hours, but can't get past this error (above) on the api.call (obfuscated my settings of course)
Session.set( 'MailChimpOptions.apiKey', "XXXXXXXX");
Session.set( 'MailChimpOptions.listId', "YYYYYYYY");
try {
var api = new MailChimp( Session.get( 'MailChimpOptions.apiKey' ), { version : '2.0' } );
} catch ( error ) {
console.log( error.message );
}
api.call( 'campaigns', 'list', { start: 0, limit: 25 }, function ( error, result ) {
if ( error )
console.log( error.message );
else
console.log( JSON.stringify( result ) ); // Do something with your data!
});
// any ideas how to troubleshoot?
in config settings I do this
},
"mailChimp": {
"listId": "{ my list id }",
"apiKey": "{ my api key }"
},...
then in startup I do this this:
MailChimpOptions.apiKey = Meteor.settings.mailChimp.apiKey;
MailChimpOptions.listId = Meteor.settings.mailChimp.listId;
is that technically OK?
Technically yes, but if you do the settings exactly as described in README.md (with "MailChimpOptions"!):
{
"MailChimpOptions": {
"apiKey": "<Your MailChimp API Key>",
"listId": "<ID of your default mailing list>"
}
}
then you don't need the rest of the code - it's already there.
Try to hardcode 'apiKey' value in api.call method to see what happens and check that your apiKey is valid.
yes, I already tried hard-coding it directly in the call too. I really
spent many hours on it :(
Max Hodges | Partner at White Rabbit Japan http://whiterabbitjapan.com |
t 03.6303.1840 | m 090.1795.4446
On Fri, Jul 4, 2014 at 2:30 AM, Miroslav Hibler notifications@github.com
wrote:
Technically yes, but if you do the settings exactly as described in
README.md (with "MailChimpOptions"!):{
"MailChimpOptions": {
"apiKey": "",
"listId": ""
}}then you don't need the rest of the code - it's already there.
Try to hardcode 'apiKey' value in api.call method to see what happens and
check that your apiKey is valid.—
Reply to this email directly or view it on GitHub
#6 (comment)
.
Did any of you ever get this to work? Maybe have a demo available? I'm running into this same error, and have spent a day on this with no luck. :(
Error: undefined - Unable to connect to the MailChimp API endpoint.