2017 © Pedro Peláez
 

library connector

RIPS API connector package

image

rips/connector

RIPS API connector package

  • Friday, June 1, 2018
  • by rips
  • Repository
  • 3 Watchers
  • 2 Stars
  • 1,007 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 19 Versions
  • 23 % Grown

The README.md

RIPS Connector

A simple PHP interface for easy access to the RIPS API., (*1)

Installation

Use composer to include the package:, (*2)

composer require rips/connector:~3.4

OR add the following to composer.json and run composer update, (*3)

"rips/connector": "~3.4"

Usage

use RIPS\Connector\API;
use RIPS\Connector\Exceptions\ClientException;
use RIPS\Connector\Exceptions\ServerException;

$config = ['base_uri' => 'http://localhost:8000'];

// Initialize with config in constructor
$api = new API('email', 'password', $config);

// Or initialize manually
$api = new API();
$api->initialize('email', 'password', $config);

try {
    // Get all users
    $users = $api->users->getAll()->getDecodedData();

    // Create new organization
    $org = $api->orgs->create([
        'name'       => 'My New Org',
        'validUntil' => '2018-08-03T15:23:04.286Z'
    ]);
} catch (ClientException $e) {
    // 400 error
} catch (ServerException $e) {
    // 500 error
}

Most methods will return a Response object. To get the actual data call the method getDecodedData(). This returns either a stdClass object or an array of stdClass objects., (*4)

Config/Options

The following config options are available:, (*5)

'base_uri' (required, default: http://localhost:8080): API URL
'timeout' (optional, default: 100): Timeout of request in seconds
'connect_timeout' (optional, default: 10): Number of seconds to wait while trying to connect to server
'oauth2' (optional): OAuth2 configuration, see OAuth2 Config

OAuth2Config

The following options are available as associative array under the oauth2 key:, (*6)

'enabled' (required): Use OAuth2 instead of legacy auth
'client_id' (required): Client id for the login client
'store_token' (optional, default: false): Flag if the OAuth2 tokens should be stored on disk
'token_file_path' (optional): The file location for the token file
'access_token' (optional, default: ""): If already present a accesstoken to use for login

Testing

Testing is done with phpunit. You can install phpunit globally or use the composer installed executable in vendor/bin/phpunit., (*7)

Abstract classes use stubs found in test/Stubs., (*8)

Run the tests by executing phpunit in the root directory of the project:, (*9)

With global install:, (*10)

phpunit

With composer install:, (*11)

vendor/bin/phpunit

The Versions

01/06 2018

dev-master

9999999-dev

RIPS API connector package

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

01/06 2018

2.15.2

2.15.2.0

RIPS API connector package

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

01/06 2018

dev-dev

dev-dev

RIPS API connector package

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

01/06 2018

2.15.1

2.15.1.0

RIPS API connector package

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

01/06 2018

2.15.0

2.15.0.0

RIPS API connector package

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

01/06 2018

2.13.1

2.13.1.0

RIPS API connector package

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

01/06 2018

2.13.0

2.13.0.0

RIPS API connector package

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

27/02 2018

2.12.0

2.12.0.0

RIPS API connector package

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

12/02 2018

2.10.4

2.10.4.0

RIPS API connector package

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

31/01 2018

2.10.3

2.10.3.0

RIPS API connector package

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

30/01 2018

2.10.2

2.10.2.0

RIPS API connector package

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

03/01 2018

2.10.1

2.10.1.0

RIPS API connector package

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

21/12 2017

2.10.0

2.10.0.0

RIPS API connector package

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

20/11 2017

2.9.5

2.9.5.0

RIPS API connector package

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

16/11 2017

2.9.4

2.9.4.0

RIPS API connector package

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

16/11 2017

2.9.3

2.9.3.0

RIPS API connector package

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

03/11 2017

2.9.2

2.9.2.0

RIPS API connector package

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

26/10 2017

2.9.1

2.9.1.0

RIPS API connector package

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

19/10 2017

2.9.0

2.9.0.0

RIPS API connector package

  Sources   Download

proprietary

The Requires

 

The Development Requires