Skip to content

krrrr38/go-freeehr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-freeehr

Build Status

go api client for freee HR.

Usage

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

Example

  • 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.

Development

  • install dependency
> make dep
  • run test
> make test

LICENSE

This library is distributed under the BSD-style license. Almost all code base are written in google/go-github.

About

freee hr api client

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published