PHP code example of larsnieuwenhuizen / trustpilot

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

    

larsnieuwenhuizen / trustpilot example snippets


$configuration = new Trustpilot\Configuration('path/to/my/config.yaml');

$configuration = new \LarsNieuwenhuizen\Trustpilot\Configuration();
$configuration->setBaseUrl('https://api.trustpilot.com/')
    ->setBasePath('v1/')
    ->setDefaultResultsPerPage(5)
    ->setDefaultOrderBy('createdat.desc')
    ->setApiKey('apikey');

$client = new \LarsNieuwenhuizen\Trustpilot\Client($configuration);

$result = $client->businessDataService->getAllBusinessUnits();