Php Freshbooks oAuth Library For Codeigniter
Switch branches/tags
Nothing to show
Latest commit 174b434 Oct 9, 2010 Cloudmanic Labs, LLC Added some better error checking to support cases where the freshbook…
…s API is not activated


By: Spicer Matthews
Built: 9/30/2010

This is a php library designed to be used with the Codeigniter framework.

This library is based off of the work found here by Mike Helmick. The codebase as changed to work within the Codeignitor library format. Also a controller class was added to demo the use of this library.

To install:

- copy the files to their respective homes; config, controllers, and libraries.

- Modify config.php with your relevant information.

- Run the login method of the Freshbooks controller. 

- To set a different sub domain from your consumer key use the $this->freshbooks_oauth->set_namespace('xxxxxxx'); See the constructor of freshbooks.php

Get Data Calls:

Currently we do not support all the different calls to FreshBooks but we do have a handful to work from. In Freshbooks_oauth.php if you scroll to the comment section "Helper functions to get different datasets" you will be able to add or modify function calls to meet your data needs.

- $this->freshbooks_oauth->get_categories($page = 1, $count = 100, $loop = TRUE)
- $this->freshbooks_oauth->get_expenses($page = 1, $count = 100, $loop = TRUE)
- $this->freshbooks_oauth->get_payments($page = 1, $count = 100, $loop = TRUE)
- $this->freshbooks_oauth->get_customers($page = 1, $count = 100, $loop = TRUE)

* All the get_xxxxx() calls do not need to have any parameters passed into them if you want to get everything in the FreshBooks system. FreshBooks has a limit of 100 results at a time. The get_xxxxxx() are set to make multiple requests to get all the data. If you pass in a $page, $count, and set $loop to FALSE it will not loop and return the page you are after with the result count you are after. Not looping is a much better design for a system that is going to make API calls everyday.