PHP code example of kokoroe / kokoroe-sdk-php

1. Go to this page and download the library: Download kokoroe/kokoroe-sdk-php library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

kokoroe / kokoroe-sdk-php example snippets



$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
}