node package manager

liverail-api

A nodejs client library for the Liverail platform's API

liverail-api

This provides a node client library to use the Liverail API.

Created by Pinion.

npm install liverail-api

var liverail = require('liverail-api');
 
liverail.login('username', 'password', function() {
liverail.call('/entity/list', function(errresult) {
if (err) { 
console.error("Oh no!")
} else {
console.log(result.entities)
}
});
});
var liverail = require('liverail-api');
 
liverail.login('username', 'password', function() {
var params = {
order_line_id: '123',
time_end: '2012-02-22 00:00:00'
}
liverail.call('/order/line/edit', params, function(errresult) {
if (err) { 
console.error("Oh no!")
}
});
});

login takes 3 arguments; username, password and a callback, to which it will pass an error indicator and the results from Liverail in case you're interested in them.

call is a generic call function that will call a specified route on the liverail API. The token is added automatically, but you may pass an object with additional parameters to send to the api. You may also pass a callback, which will be called with an error indicator and the results of the API call.