dev-master
9999999-devPHP Rock RMS API Helper
CC BY-NC 3.0
The Requires
by Daniel Boorn
1.0.4
1.0.4.0PHP Rock RMS API Helper
CC BY-NC 3.0
The Requires
by Daniel Boorn
PHP Rock RMS API Helper
The Rock RMS Api for PHP 5+ allows your church PHP project to easily integrate against the RockRMS.com. Built on top of Guzzle 6, the Rock RSM Api helper for PHP will bootstrap your integration allowing you to easily authenticate and consume all RockRMS REST API resources. Authenticate easily with credential based authentication., (*1)
Funding for this projected was provided by OnlineGiving.org., (*2)
Install the deboorn/rockrmsapi
package, (*3)
$ composer require deboorn/rockrmsapi
```php require 'vendor/autoload.php';, (*4)
$rock = new RockRMS\Api('admin', 'admin', 'http://rock.rocksolidchurchdemo.com/api/');, (*5)
// Calling the auth method will fetch a cookie from the API using the user credentials // The auth only needs to be called once per object, but before consuming endpoints // The auth method is chainable - $rock->auth()->get(...), (*6)
// $rock->auth();, (*7)
// Consume the API using Guzzle 6 style requests making it easy as pie! // However, we return a promise class that allows you to easily decode json // or work directly with the Guzzle response body, headers, etc., (*8)
// Let's grab the campus list and then print the name to console. $campuses = $rock->auth()->get('Campuses')->json(); foreach ($campuses as $campus) { echo "Campus: {$campus->Name}\n"; // ... }, (*9)
// Need to check status codes and grab the response body? It's easy. $promise = $rock->get('Campuses'); var_dump( $promise->response()->getHeaders(), $promise->response()->getStatusCode(), (string)$promise->response()->getBody() );, (*10)
// Let's search some data... $people = $rock->get('People/Search?name=Smith')->json(); var_dump($people);, (*11)
// Easily consume the Rock RMS REST API resources with the following actions -, (*12)
// $rock->get($uri, array $options = []) : Promise // $rock->head($uri, array $options = []) : Promise // $rock->put($uri, array $options = []) : Promise // $rock->post($uri, array $options = []) : Promise // $rock->patch($uri, array $options = []) : Promise // $rock->delete($uri, array $options = []) : Promise // $rock->getAsync($uri, array $options = []) : Promise // $rock->headAsync($uri, array $options = []) : Promise // $rock->putAsync($uri, array $options = []) : Promise // $rock->postAsync($uri, array $options = []) : Promise // $rock->patchAsync($uri, array $options = []) : Promise // $rock->deleteAsync($uri, array $options = []) : Promise, (*13)
// See Rock RMS demo for full list of REST API endpoints/resources. // More documentation coming soon..., (*14)
PHP Rock RMS API Helper
CC BY-NC 3.0
PHP Rock RMS API Helper
CC BY-NC 3.0