我试图调用 Harvest API 来获取客户端信息。我尝试遵循 Harvest 提供的官方文档。但是一旦我运行代码它没有输出。
这是我的代码
<?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";
}
?>
但它总是返回不成功。请就我如何克服这个问题提出建议。