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.
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{})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)