1

嗨,我是 Freshbooks 的新手,我想要一些非常简单的东西。

我希望我的客户在字段中输入电子邮件或名字和姓氏,如果我有该客户,我希望我的 php 代码搜索我的 Freshbook 帐户,如果我希望我的表单提取他的所有帐户并粘贴到输入区域他们应该是。就像客户的名字进入名字区域一样,姓氏进入姓氏区域。

我尝试使用; http://code.google.com/p/freshbooks-php-library/

这但我不t figure it out and I don知道 XML 是如何工作的,所以有人可以帮助我吗?

4

1 回答 1

3

查看 API,我相信代码可能如下所示。请注意,这是完全未经测试的。

从客户端对象开始

//new Client object
$client = new FreshBooks_Client();

使用列表方法获取具有特定电子邮件的用户

//listing function definition void   listing  ( &$rows,  &$resultInfo, [ $page = 1], [ $perPage = 25], [ $filters = array()])
//get projects, 25 per page, page 1, where project belong to client email x@x.x
$client->listing($rows,$resultInfo,1,25,array('email'=>'x@x.x'));

//dump result data
print_r($rows);
print_r($resultInfo);

使用列表方法获取具有特定用户名的用户

//listing function definition void   listing  ( &$rows,  &$resultInfo, [ $page = 1], [ $perPage = 25], [ $filters = array()])
//get projects, 25 per page, page 1, where project belong to client username test
$client->listing($rows,$resultInfo,1,25,array('username'=>'test'));

//dump result data
print_r($rows);
print_r($resultInfo);

希望它可以帮助您入门。

于 2011-08-04T07:16:20.347 回答