I was trying to call the Harvest API to get the client Information. I tried to follow the official documentation provided by Harvest. But Once I run the code It gives no output.
Here is my code
<?php
require_once(dirname(__FILE__) . '/HarvestAPI.php');
spl_autoload_register(array('HarvestAPI', 'autoload') );
$harvest_user = $user; // Your Harvest username, usually an email address
$harvest_pass = $password; // Your Harvest password
$harvest_account = $account;
$harvestAPI = new HarvestAPI();
$harvestAPI->setUser($harvest_user);
$harvestAPI->setPassword($harvest_pass);
$harvestAPI->setAccount($harvest_account);
$harvestAPI->setRetryMode( HarvestAPI::RETRY );
$harvestAPI->setSSL(true);
$result = $harvestAPI->getClients();
if( $result->isSuccess() ) {
echo "Successful";
}
else{
echo "Not Successful";
}
?>
But it always returns not successful . Kindly give suggestions on how I could overcome this problem.