go api client for freee HR.
func main() {
....
url := conf.AuthCodeURL("state", oauth2.AccessTypeOffline)
fmt.Printf("Visit the URL for the auth dialog: %v\nEnter code: ", url)
var code string
if _, err := fmt.Scan(&code); err != nil {
log.Fatal(err)
}
fmt.Printf("code: %v\n", code)
token, err := conf.Exchange(oauth2.NoContext, code) // get access token and so on
if err != nil {
log.Fatal(err)
}
fmt.Printf("access token: %v\n", token)
client, _ := freeehr.NewClient(conf.Client(oauth2.NoContext, token))
// get user information
userResponse, resp, err := client.Users.GetMe()
}
FREEE_CLIENT_ID=${YOUR_APP_ID} FREEE_CLIENT_SECRET=${YOUR_SECRET} go run example/user/main.go
- if yo do not have access token, see document.
- install dependency
> make dep
- run test
> make test
This library is distributed under the BSD-style license. Almost all code base are written in google/go-github.