happyr/api-php-client

Happyr public API client library.

Installs: 187

Dependents: 0

Stars: 1

Watchers: 3

Language: PHP

1.2.3 2015-04-09 10:09 UTC

README

This PHP library is a client to the API at api.happyr.com.

Installation

Install it with Composer!

// composer.json
{
    // ...
    require: {
        // ...
        "happyr/api-php-client": "dev-master",
    }
}

Then, you can install the new dependencies by running Composer's update command from the directory where your composer.json file is located:

$ php composer.phar update

Configuration

There is a few mandatory configuration parameters. They are 'identifier' and 'secret'. You will get them both from the Happyr-API website. You may add those in the Configuration.php or set them in runtime.

You find a the full configuration reference here.

Usage

use Happyr\ApiClient\HappyrApi;
use Happyr\ApiClient\Configuration;

class myClass
{
    // ---

    public function myFunc()
    {
        $config=new Configuration('myApiIdentifier','myApiSecret');

        $api = new HappyrApi($config);
        $patterns=$api->api('patterns');

        // etc..
    }
    // ---

}