{"id":21320430,"url":"https://github.com/kurusugawa-computer/freee-go","last_synced_at":"2025-03-15T22:34:06.207Z","repository":{"id":218929036,"uuid":"747708977","full_name":"kurusugawa-computer/freee-go","owner":"kurusugawa-computer","description":"freee API の go クライアント","archived":false,"fork":false,"pushed_at":"2025-01-07T03:34:09.000Z","size":56,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-01-22T11:32:27.575Z","etag":null,"topics":["freee"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kurusugawa-computer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-24T13:40:34.000Z","updated_at":"2025-01-07T03:31:06.000Z","dependencies_parsed_at":"2024-06-21T16:51:34.595Z","dependency_job_id":"4cc6b193-780a-4814-963e-f1ac4edc0487","html_url":"https://github.com/kurusugawa-computer/freee-go","commit_stats":null,"previous_names":["kurusugawa-computer/freee-go"],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kurusugawa-computer%2Ffreee-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kurusugawa-computer%2Ffreee-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kurusugawa-computer%2Ffreee-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kurusugawa-computer%2Ffreee-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kurusugawa-computer","download_url":"https://codeload.github.com/kurusugawa-computer/freee-go/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243801604,"owners_count":20350105,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["freee"],"created_at":"2024-11-21T19:47:49.974Z","updated_at":"2025-03-15T22:34:01.197Z","avatar_url":"https://github.com/kurusugawa-computer.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"freee-go\n====\n\n[![GoDoc](https://godoc.org/github.com/smith-30/go-ffprobe?status.svg)](https://godoc.org/github.com/kurusugawa-computer/freee-go)\n\nfreee API の go クライアント\n\n現在開発中です。\n\n## Usage\n\n```\ngo get github.com/kurusugawa-computer/freee-go\n```\n\nhttps://developer.freee.co.jp/startguide/starting-api の手順でアプリケーションを作成し、`Client ID` と `Client Secret` を取得します。  \n`コールバックURL` には `http://localhost:\u003cport\u003e/` を指定してください。  \n`\u003cport\u003e` は実装するアプリケーション側で決定します。  \n\n## Example\n\n```golang\npackage main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"log\"\n\t\"net/http\"\n\t\"strconv\"\n\t\"strings\"\n\n\tfreee \"github.com/kurusugawa-computer/freee-go\"\n\t\"github.com/kurusugawa-computer/freee-go/oauth\"\n)\n\nfunc main() {\n\tclientID := \"xxxx\"\n\tclientSecret := \"xxxx\"\n\n\t// アクセストークンを取得します。\n\taccessToken, err := freee.Authorize(clientID, clientSecret, 8080,\n\t\toauth.WithPrompt(func(authorizeURL string) error {\n\t\t\tfmt.Println(\"次のURLにアクセスして認証を行ってください。\")\n\t\t\tfmt.Println(authorizeURL)\n\t\t\treturn nil\n\t\t}),\n\t\toauth.WithRenderer(func(w http.ResponseWriter, authorizationCode string, err error) {\n\t\t\tcontent := \"認証に成功しました。ブラウザを閉じてください。\"\n\t\t\tif err != nil {\n\t\t\t\tcontent = \"認証に失敗しました。ブラウザを閉じて、アプリケーションをもう一度実行してください。\"\n\t\t\t}\n\t\t\tw.Header().Set(\"Content-Type\", \"text/plain; charset=UTF-8\")\n\t\t\tw.Header().Set(\"Content-Length\", strconv.Itoa(len(content)))\n\t\t\tw.WriteHeader(http.StatusOK)\n\t\t\tio.Copy(w, strings.NewReader(content))\n\t\t}),\n\t)\n\tif err != nil {\n\t\tlog.Fatalln(err)\n\t}\n\n\t// freee API クライアントを作成します。\n\tclient, err := freee.New(clientID, clientSecret, accessToken)\n\tif err != nil {\n\t\tlog.Fatalln(err)\n\t}\n\n\t// ログインユーザーを取得します。\n\tloginUser, err := client.GetLoginUser()\n\tif err != nil {\n\t\tlog.Fatalln(err)\n\t}\n\n\tfmt.Println(loginUser.ID)\n}\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkurusugawa-computer%2Ffreee-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkurusugawa-computer%2Ffreee-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkurusugawa-computer%2Ffreee-go/lists"}