PHP code example of wearerequired / harvest-api-php-client

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

    

wearerequired / harvest-api-php-client example snippets


// Include Composer's autoloader.
new \Required\Harvest\Client();
$client->authenticate( 'account-id', 'token' );

// Do your API calls.
$currentUser = $client->currentUser()->show();

// Example request with auto paging.
$projects = $client->projects()->allWithAutoPagingIterator();
foreach ( $projects as $project ) {
	// Do something with $project. The iterator will automatically
	// fetch new entries if the end of a page is reached.
}

composer