PHP code example of itspirit / trustpilot-authenticator
1. Go to this page and download the library: Download itspirit/trustpilot-authenticator 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/ */
itspirit / trustpilot-authenticator example snippets
$authenticator = new Trustpilot\Api\Authenticator\Authenticator($apiKey, $apiToken, $username, $password);
$accessToken = $authenticator->getAccessToken();
// $accessToken->getToken(): string
// $accessToken->hasExpired(): bool
// $accessToken->getExpiry(): \DateTimeImmutable
// $accessToken->serialize(): string