Official Aboardly API library client for node.js
This library is generated by alpaca and then modified by hand, hence why some things seem over engineered.
Make sure you have npm installed.
$ npm install aboardly
Works with [ 0.8 / 0.9 / 0.10 / 0.11 ]
var aboardly = require('aboardly');
// Then we instantiate a client (as shown below)
Using this api without authentication gives an error
var client = aboardly.client({
username: 'api_key',
password: 'api_secret'
});
All the callbacks provided to an api call will recieve the response as shown below
// You can also omit the 'methodOptions' param below
client.klass.method('args', methodOptions, function (err, response) {
if (err) console.log(err);
response.code;
// >>> 200
response.headers;
// >>> {'x-server': 'apache'}
}
Updates customer data. If customer does not exist it is created.
The following arguments are required:
- customer_id: Customer identifier - an identifier that can 1:1 match to the user in your own systems.
- options.email: Customer email - required
- options: Data about customer like first_name, last_name, email (required)
client.customers.upsert("customer_id", options, callback);
Creates a new event for a customer
The following arguments are required:
- customer_id: Customer identifier - an identifier that can 1:1 match to the user in your own systems.
- event_name: Event name (e.g. logged_in, signed_up, added_funds)
client.events.create("customer_id", "event_name", options, callback);