0.3.4 • Published 8 years ago
fellowshipone v0.3.4
node-fellowshipone
A Fellowship One API wrapper for Node.js
In very early stages.
Allows you to:
- use a username/password to easily get OAuth tokens for dealing with Fellowship One (i.e. 2nd-party credentials-based authentication)
- interface with the F1 API in a slightly-simplified way
See passport-fellowshipone for 3rd-party OAuth authentication.
Install
$ npm install fellowshipone
Usage
Getting a token
var f1 = new F1({
apiURL: 'http://mychurch.staging.fellowshiponeapi.com/v1',
username: 'joe',
password: 'joespassword',
oauth_credentials: {
consumer_key: '123',
consumer_secret: '456789'
}
})
f1.get_token(function (err, oauth_credentials, userURL) {
request.get(userURL, { oauth: oauth_credentials, json: true }, function (err, res, body) {
console.log('hi there, %s %s', body.firstName, body.lastName)
})
})
Getting a token - alternate method
var config = {
apiURL: 'http://mychurch.staging.fellowshiponeapi.com/v1',
username: 'joe',
password: 'joespassword',
oauth_credentials: {
consumer_key: '123',
consumer_secret: '456789'
}
}
var f1 = new F1(config)
// this method is useful for integrating with other APIs
f1.authenticate(function (err) {
console.log('got tokens: %s/%s', config.oauth_credentials.token,
config.oauth_credentials.token_secret)
console.log('user URL is %s', config.userURL)
})
Searching for Households
var f1 = new F1(config)
f1.authenticate(function (err) {
var households = new F1.Households(f1)
households.search({
searchFor: 'Joe Smith'
}, function (err, found) {
var count = found.results['@count']
console.log('Found %d households', count)
if (count > 0) {
console.log('Households: %j', found.results.household)
}
})
})
API Support
We're aiming to support all of the F1 API by v1.0.0. The (more-or-less) current support state is:
- Accounts
- People API Realm
- Households
- HouseholdMemberTypes
- People
- People Attributes
- People Images
- Addresses
- AddressTypes
- Attributes
- AttributeGroups
- Communications
- CommunicationTypes
- Denominations
- Occupations
- Schools
- Statuses
- SubStatuses
- Requirements
- Requirement Statuses
- Background Check Statuses
- People Requirements
- Requirement Documents
- Households
- Giving API Realm
- not yet
- Groups API Realm
- not yet
- Events API Realm
- not yet
Tests
$ npm install --dev
$ make test
License
Copyright (c) 2014-2015 Dave Henderson
0.3.4
8 years ago
0.3.3
8 years ago
0.3.2
9 years ago
0.3.1
9 years ago
0.3.0
9 years ago
0.2.9
9 years ago
0.2.8
9 years ago
0.2.7
9 years ago
0.2.6
9 years ago
0.2.5
9 years ago
0.2.4
9 years ago
0.2.3
9 years ago
0.2.2
9 years ago
0.2.1
9 years ago
0.2.0
9 years ago
0.1.2
9 years ago
0.1.1
9 years ago
0.1.0
9 years ago
0.0.2
9 years ago
0.0.1
10 years ago