PHP code example of moneymaxim / trustpilot-authenticator

1. Go to this page and download the library: Download moneymaxim/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/ */

    

moneymaxim / trustpilot-authenticator example snippets


$authenticator = new Trustpilot\Api\Authenticator\Authenticator();

$accessToken = $authenticator->getAccessToken($apiKey, $apiToken, $username, $password);

// $accessToken->getToken(): string
// $accessToken->hasExpired(): bool
// $accessToken->getExpiry(): \DateTimeImmutable
// $accessToken->serialize(): string