node.js API wrapper for Constant Contact v2 API
This API wrapper is very incomplete at the moment. I will continue to fill it out and improve the docs over the next couple of weeks. Let me know if there's something you're itching for in the meantime.
npm install constantcontact
var Client = require('constantcontact');
var client = new Client();
client.useKey("MY_API_KEY");
client.useToken("MY_ACCESS_TOKEN");
This collection method returns a list of email campaigns.
client.campaigns.get(function (err, res) {
if (err) { throw err; }
console.log(res);
});
constantContactClient.contacts.get, {"email": info.email}
Method for retrieving a list of contacts.
var email = "[email protected]";
client.contacts.get({"email": email}, function (err, res) {
if (err) { throw err; }
console.log(res);
});
Method for adding a Contact to a collection. See full structure of contact object: http://developer.constantcontact.com/docs/contacts-api/contacts-resource.html?method=PUT
client.contacts.post(contact, true, function (err, res) {
if (err) { throw err; }
console.log(res);
});
Modify a particular contact.
client.contacts.put(contact, true, function (err, res) {
if (err) { throw err; }
console.log(res);
});