/go-freshbooks

This project implements a golang client library for the Freshbooks API

Primary LanguageGoBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

go-freshbooks

This project implements a Go client library for the freshbooks API.

Originally forked from toggl/go-freshbooks and will hopefully merge together eventually but this has been quite the departure.

Supports token-based and OAuth authentication.

Example usage

api := freshbooks.NewApi("<<AccountName>>", "<<AuthToken>>")

clients, pageInfo, err := api.ListClients(&freshbooks.Request{})
projects, pageInfo, err := api.ListProjects(&freshbooks.Request{})
invoices, pageInfo, err := api.ListInvoices(&freshbooks.Request{})
timeEntries, pageInfo,err := api.ListTimeEntries(&freshbooks.Request{})

OAuth authentication

The FreshBooks API also supports OAuth to authorize applications. oauthplain package is used to generate 'Authorization' headers.

token := &oauthplain.Token{
  ConsumerKey:      "<<ConsumerKey>>",
  ConsumerSecret:   "<<ConsumerSecret>>",
  OAuthToken:       "<<OAuthToken>>",
  OAuthTokenSecret: "<<OAuthTokenSecret>>",
}

api := freshbooks.NewApi("<<AccountName>>", token)