kokoroe/kokoroe-sdk-php

v1.0.0-alpha.4 2016-06-15 08:16 UTC

README

Build Status SensioLabs Insight Coveralls HHVM Packagist

Install

Add kokoroe/kokoroe-sdk-php to your composer.json:

% php composer.phar require kokoroe/kokoroe-sdk-php:~1.0

Usage

Example

<?php

$kokoroe = new Kokoroe\Kokoroe([
    'client_id'             => '{client-id}',
    'client_secret'         => '{client-secret}',
    'country'               => 'FR',
    'locale'                => 'fr',
    'user_ip'               => $_SERVER['REMOTE_ADDR'], // use real ip of user.
    'default_access_token'  => '{access-token}', // optional
    'signature'             => true // optional
]);

// If you provided a 'default_access_token', the '{access-token}' is optional.
$response = $kokoroe->get('/me', '{access-token}');

if ($response->isSuccessful()) {
    var_dump($response->getContent()); // dump array
}

?>

Options

Name Type Default Description Required
client_id string null The id of your application, Format: UUID. yes
client_secret string null The secret key of yout application. yes
user_ip string null The IP address of user. yes
country strung null The country code, Ex: FR. yes
default_access_token string null The default access_token. no
default_api_version string v1.0 The default API version. no
default_api_url string https://api.kokoroe.co The default API url. no
locale string en The locale of response, Ex: en no
ssl_verify bool true Enable or disable the verification of SSL certificate. no
tracker string null The Tracker-ID for identifie request. no
signature bool null Enable or disable the signature of requests. no

License

kokoroe-sdk-php is licensed under the MIT license.