kokoroe / kokoroe-sdk-php
Kokoroe SDK for PHP
v1.0.0-alpha.4
2016-06-15 08:16 UTC
Requires
- ext-curl: *
- jakeasmith/http_build_url: ^1.0
- psr/log: ~1.0.0
Requires (Dev)
- leaphub/phpcs-symfony2-standard: ~2.0.1
- phpmd/phpmd: @stable
- phpunit/phpunit: ^4.7
- satooshi/php-coveralls: dev-master
This package is not auto-updated.
Last update: 2025-03-01 20:13:45 UTC
README
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.