Harvest API-调用未定义的方法HarvestAPI::getActiveProjects


Harvest API-Call to undefined method HarvestAPI::getActiveProjects

我正在尝试检索所有活动项目的项目名称。我遵循了Harvest API提供的文档和代码。但它抛出了一个错误调用未定义的方法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;
    }
?>

第页。S.我拥有该帐户的管理员访问权限。因此,我应该能够查看所有项目标题

查看HarvestAPI.php,您会发现没有名为getActiveProjects 的方法

使用这个

public function getProjects( $updated_since = null ) 
{
    $url = "projects" . $this->appendUpdatedSinceParam( $updated_since );
    return $this->performGET( $url, true );
}