首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >获取客户信息

获取客户信息
EN

Stack Overflow用户
提问于 2016-04-12 23:15:30
回答 1查看 374关注 0票数 0

我试着打电话给收获API来获取客户信息。我试着跟踪哈佛公司提供的官方文件。但是,一旦我运行了代码,它就没有输出。

这是我的密码

代码语言:javascript
复制
<?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";

}

?>

但是它总是返回不成功的。请给出我如何克服这个问题的建议。

EN

回答 1

Stack Overflow用户

发布于 2016-04-14 15:38:01

我今天试着用同样的代码处理它,猜猜它是如何工作的!我只是增加了几行来打印数组。

代码语言:javascript
复制
<?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";
 $data = $result->get( "data" );
print_r($data);
}
else{
echo "Not Successful";

}
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/36585763

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档