1. Go to this page and download the library: Download bouiboui/pokket-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/ */
bouiboui / pokket-php example snippets
bash
$ composer
php
$pokket = new PokketAPI(
'1234-abcd1234abcd1234abcd1234', // Consumer key
'https://yourdomain.tld/' // Redirect uri
);
php
if (!array_key_exists('pokket.token.request', $_SESSION)) {
$pokket->requestUserAccess($_SESSION['pokket.token.request'] = $pokket->getRequestToken());
}
php
if (!array_key_exists('pokket.token.access', $_SESSION)) {
$_SESSION['pokket.token.access'] = $pokket->getAccessToken($_SESSION['pokket.token.request']);
}
$pokket->setAccessToken($_SESSION['pokket.token.access']);