1.0.1 • Published 9 years ago

f1-node-api v1.0.1

Weekly downloads
1
License
ISC
Repository
github
Last release
9 years ago

f1-node-api

A node wrapper for the Fellowship One API. There needed to be an easier way of interfacing with the existing api.

Todo

  • Need to hookup OAuth strategy. Might use a headless browser to handle this, so I can keep it in the same wheelhouse.

Usage

npm install f1-node-api

If you set process.env.DEVELOPMENT all requests will hit against staging.fellowshiponeapi.com;

Available endpoints: api_path.json

var fOne = require('f1-node-api');

// Returns a Fellowship One endpoint by passing a churchcode and desired route
// Example: fOne.createEndpoint('foo','households_search')
// https://foo.fellowshiponeapi.com/v1/Households/Search.json
fOne.createEndpoint(churchcode, route);


// Creates a request to Fellowship One  
// @params obj {Object}  
// obj = {path: '', params:'', oauth: {token:'', token_secret:'',consumer_key:'',consumer_secret:''}, churchcode:''}  
// @params callback {Function}  
//
// TODO: convert to using streams

fOne.f1_request(obj, callback);