我正在尝试检索所有活动项目的项目名称。我正在关注Harvest API此处提供的文档和代码。但它会引发错误Call to undefined method HarvestAPI::getActiveProjects。这是我编写的代码
<?php
require_once(dirname(__FILE__) . '/HarvestAPI.php');
/* Register Auto Loader */
spl_autoload_register(array('HarvestAPI', 'autoload'));
$api = new HarvestAPI();
$api->setUser( $user );
$api->setPassword( $password );
$api->setAccount($account );
$api->setRetryMode( HarvestAPI::RETRY );
$api->setSSL(true);
$result = $api->getActiveProjects();
foreach( $result->data as $project ) {
echo $project->name;
}
?>
PS 我有该帐户的管理员访问权限。所以,我应该能够查看所有项目标题