PHP code example of keystackapp / keystack-php-client
1. Go to this page and download the library: Download keystackapp/keystack-php-client 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/ */
keystackapp / keystack-php-client example snippets
Configure Bearer (JWT) authorization: Bearer
$config = KeyStackApp\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new KeyStackApp\Client\Api\ClientApi(
// If you want use custom http client, pass your client which implements `Psr\Http\Client\ClientInterface`.
// This is optional, `Psr18ClientDiscovery` will be used to find http client. For instance `GuzzleHttp\Client` implements that interface
new GuzzleHttp\Client(),
$config
);
$activateLicense = new \KeyStackApp\Client\Model\ActivateLicense(); // \KeyStackApp\Client\Model\ActivateLicense
try {
$result = $apiInstance->activateLicense($activateLicense);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling ClientApi->activateLicense: ', $e->getMessage(), PHP_EOL;
}