dev-master
9999999-devLibrary for working with Hub Culture API
The Requires
by serhiyosetskiy
1.2
1.2.0.0API
The Requires
by serhiyosetskiy
1.0
1.0.0.0API
The Requires
by serhiyosetskiy
1.1
1.1.0.0API
The Requires
by serhiyosetskiy
Wallogit.com
2017 © Pedro Peláez
Library for working with Hub Culture API
Wiki https://github.com/hub/APIHubID/wiki, (*1)
Swagger api.hubculture.com, (*2)
Include the library with composer., (*3)
composer require hub/hubid-api-client
Refer to the https://hubculture.com/developer/home for obtaining the private and public keys., (*4)
include '/vendor/autoload.php';
use Hub\HubAPI\HubClient;
$redirectUrl = 'http://localhost/callback.php';
$config = array(
// @see https://hubculture.com/developer/home
'private_key' => '<your private key>',
'public_key' => '<your public key>',
'client_id' => 12345,
);
$hubClient = new HubClient($config);
$redirectLoginHelper = $hubClient->getRedirectLoginHelper();
$redirectLoginHelper->getAccessToken($redirectUrl);
Retrieving a user by id, (*5)
include '/vendor/autoload.php';
use Hub\HubAPI\Service\UserService;
$config = array(
'private_key' => '<your private key>',
'public_key' => '<your public key>',
'token' => '<access_token you got from the auth endpoint>',
);
$service = new UserService($config);
$user = $service->getUserById(18495);
var_dump($user);
Please run the following command to run a PHP server serving examples., (*6)
HUBID_PRIVATE_KEY=[your-private-key] HUBID_PUBLIC_KEY=[your-public-key] make demo
Browse to http://localhost:8085/friend-service.php., (*7)
You may look at examples under examples directory., (*8)
Library for working with Hub Culture API
API
API
API