dev-master
9999999-devUtilizes 2nd Party authentication to work with FellowshipOne's API
The Requires
- php >=5.3.0
- illuminate/support 4.0.x
- guzzle/guzzle *
by Aaron Van Ruler
Utilizes 2nd Party authentication to work with FellowshipOne's API
This package only provides 2nd Party authentication and the ability to make GET, POST, and PUT requests. You must build your own package/controllers to actually interact with Fellowship One data., (*1)
Before starting, you need to have a "Portal User" account that is linked to a specific user in your Fellowship One database. You also must have a 2nd Party Application enabled in your church's Fellowship One admin section., (*2)
Add the following to your service provider array, (*3)
Avr\F1\F1ServiceProvider
Copy the configuration file, (*4)
php artisan config:publish avr/f1
Set the appropriate credentials and base URLs., (*5)
In any class, add use F1;
before the class declaration., (*6)
The builtin F1
façade uses Guzzle's HTTP Client + OauthPlugin to make the requests. Consult their documentation for building requests and handling responses., (*7)
For example, create a request to Fellowship One's API by using the appropriate endpoint and format:, (*8)
$request = F1::get('v1/people/statuses.json')->send();
Using Guzzle, there are multiple ways to handle the response:, (*9)
$response = $request->getBody(true);
Or, use Guzzle's built in json()
method:, (*10)
$response = $request->json();
Check Guzzle's documentation for more help (including leveraging Exceptions, etc)., (*11)
Questions: @avr, (*12)
Utilizes 2nd Party authentication to work with FellowshipOne's API