npm.io
1.2.7 • Published 5 years ago

cloudflow-api

Licence
MPL-2.0
Version
1.2.7
Deps
3
Size
448 kB
Vulns
1
Weekly
0
Stars
2

cloudflow-api

Description

This is node.js wrapper for the Cloudflow API. It is available in async and sync flavors.

Usage

var cloudflowAPI = require('cloudflow-api');

// Create a Cloudflow API wrapper for http://localhost:9090
var apiSync = cloudflowAPI.getSyncAPI('http://localhost:9090');
var apiAsync = cloudflowAPI.getAsyncAPI('http://localhost:9090');

// Doing sync Cloudflow calls
var session = apiSync.auth.create_session('user', 'password');

// Setting the session
apiSync.m_session = session.session;

// Doing calls with that session
var whitepapers = apiSync.whitepaper.list();

// Doing async Cloudflow calls
apiAsync.auth.create_session('user', 'password', function(session) {
	...
}, function(error) {
	...
});