0.1.5 • Published 9 years ago

represent-api v0.1.5

Weekly downloads
4
License
MIT
Repository
github
Last release
9 years ago

node-represent

A node.js wrapper for the Represent API.

You can find the documentation at http://docs.represent.apiary.io/

Installation

You can install this wrapper using npm (node package manager):

npm install represent-api

Quick Start

// Import Represent node.js API
var represent = require("represent-api");

// Connect to Represent with your credentials
represent.connect({
	email: "email@example.com",
	password: "**********"
}, function(error) {
	if (error) throw error;

	// Download a daily summary of your campaigns
	represent.summary(function(error, summary) {
		if (error) throw error;
		
		console.log(summary);
	});

	// Download a list of the first 10 campaigns running on your Represent account
	represent.campaigns({
        offset: 0,
        limit: 10
    }, function(error, campaigns) {
		if (error) throw error;
		
		campaigns.forEach(function(campaign) {
			console.log(campaign.id, campaign.slug);
		});
	});

	// Download all information available about campaign id 1234
	represent.campaign(1234, function(error, campaign) {
		if (error) throw error;
		
		console.log(campaign);
	});
});

License

Released under the MIT license. See file called LICENSE for more details.

0.1.5

9 years ago

0.1.4

9 years ago

0.1.3

9 years ago

0.1.2

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago