Home

Awesome

go-freshbooks

This project implements a Go client library for the freshbooks API. Supports token-based and OAuth authentication.

Example usage

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

users, err := api.Users()
tasks, err := api.Tasks()
clients, err := api.Clients()
projects, err := api.Projects()

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)