Skip to content

This project implements a golang client library for the Basecamp API

License

Notifications You must be signed in to change notification settings

toggl/go-basecamp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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