Skip to content

Latest commit

 

History

History
48 lines (40 loc) · 891 Bytes

README.md

File metadata and controls

48 lines (40 loc) · 891 Bytes

go-basecamp

This project implements a Go client library for the Basecamp API

Installing

Run

go get github.com/toggl/go-basecamp

Example usage:

package main

import (
  "github.com/toggl/go-basecamp"
  "log"
)

func main() {
  var (
    err      error
    accounts []*basecamp.Account
    projects []*basecamp.Project
    people   []*basecamp.Person
  )

  c := basecamp.Client{AccessToken: "<PUT YOUR AUTH TOKEN HERE>"}

  if accounts, err = c.GetAccounts(); err != nil {
    log.Printf("ERROR %q", err)
    return
  }
  if projects, err = c.GetProjects(accounts[0].Id); err != nil {
    log.Printf("ERROR %q", err)
    return
  }

  if people, err = c.GetPeople(accounts[0].Id); err != nil {
    log.Printf("ERROR %q", err)
    return
  }

  log.Println(projects)
  log.Println(people)
}