An API wrapper for freshbooks (http://developer.freshbooks.com).
Create an Issue for any suggestions
-
Supports all entities (planned)
-
Efficient paging
-
Support for Private (password) and OAuth applications
Others pending
-
Clients
-
Tasks
-
Projects
-
Staff
-
Invoices
-
Time Entries
-
Items
$ npm install nodefreshbooks
var PrivateApplication = require('nodefreshbooks').PrivateApplication;
var privateApp = new PrivateApplication({ token: 'AAAAA', account: '<my freshbooks account name>'});
var PublicApplication = require('nodefreshbooks').PublicApplication;
var publicApp = new PublicApplication({ secret: 'AAAAA', account: '<my freshbooks account name>'});
Efficient paging:
app.entities.clients.list({ pager: {start:1 /* page number */, callback:onClients}})
.fail(function(err)
{
console.log('Oh no, an error');
})
/* Called per page */
function onClients(err, response, cb)
{
var clients = response.data;
if (response.finished) // finished paging
....
cb(); // Async support
}
List filters supported
app.entities.clients.list({ filter: {email: '[email protected]' }})
.then(function(clients)
{
console.log(clients) // array
})
.fail(function(err)
{
console.log('Oh no, an error');
})
Get one entity
app.entities.clients.get('123456')
.then(function(client)
{
})
npm test
- 0.0.1
- Initial Release
Copyright (c) 2014 Tim Shnaider
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.