-
-
Save futoase/a16989814f0807a1e1ccdd9f3e4f3c18 to your computer and use it in GitHub Desktop.
Revisions
-
futoase revised this gist
Nov 16, 2017 . 1 changed file with 4 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,7 @@ require 'oauth2' require 'faraday' require 'faraday_middleware' require 'base64' # Initialize @@ -19,13 +20,15 @@ # Getting authorized AUTHORIZATION_BASE64_PACK = Base64.encode64("#{YOUR_APP_ID}:#{YOUR_SECRET}").gsub("\n", '') params = { grant_type: 'authorization_code', code: AUTHORIZATION_CODE, redirect_uri: YOUR_REDIRECT_URI, headers: { 'Content-Type' => 'application/json', 'Authorization' => "Basic #{AUTHORIZATION_BASE64_PACK}" } } -
yokoji revised this gist
Jun 25, 2014 . 1 changed file with 9 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -20,20 +20,25 @@ ## 仕様 ### APIエンドポイント https://api.freee.co.jp/ (httpsのみ) ### 認証 [OAuth2][oauth2]に対応 - Authorization Code Flow (Webアプリ向け) - Implicit Flow (Mobileアプリ向け) #### エンドポイント https://secure.freee.co.jp/ (httpsのみ) * authorize : /oauth/authorize * token : /oauth/token ### データフォーマット リクエスト、レスポンスともにJSON形式をサポート -
yokoji revised this gist
Jun 16, 2014 . 1 changed file with 2 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -20,16 +20,14 @@ ## 仕様 ### エンドポイント https://api.freee.co.jp/ (httpsのみ) * authorize : /oauth/authorize * token : /oauth/token ### 認証 [OAuth2][oauth2]に対応 -
yokoji revised this gist
Jun 16, 2014 . 1 changed file with 4 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -20,7 +20,10 @@ ## 仕様 ### OAuthエンドポイント ### APIエンドポイント https://api.freee.co.jp/ (httpsのみ) -
yokoji revised this gist
Dec 15, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -72,4 +72,4 @@ Authorization Code Flowでユーザ情報、事業所情報を取得するまで ご不明点、ご要望等は以下までご連絡ください。 dev-support@freee.co.jp -
yokoji revised this gist
Oct 10, 2013 . 1 changed file with 4 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -22,7 +22,10 @@ ### エンドポイント https://api.freee.co.jp/ (httpsのみ) * authorize : /oauth/authorize * token : /oauth/token ### 認証 -
yokoji revised this gist
Oct 9, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -41,7 +41,7 @@ https://api.freee.co.jp/api/v1 (httpsのみ) 1. [freee][freee]にサインアップします。 2. [アプリケーション一覧][oauth_app]から「新しいアプリケーションを登録」します。 3. アプリケーションの登録が完了すると、AppIDとSecretが取得できます。 4. ローカルの開発環境でテストする際は、認証用URLを直打ちしてAuthorization Codeを取得できます。 [freee]: https://secure.freee.co.jp/ [oauth_app]: https://secure.freee.co.jp/oauth/applications -
yokoji revised this gist
Oct 9, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ # freee API v1.0 全自動クラウド会計ソフトfreeeの開発者向けAPIのドキュメントです。 ## 概要 -
yokoji revised this gist
Oct 9, 2013 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ # freee API v1.0 全自動クラウド会計ソフトfeeeの開発者向けAPIのドキュメントです。 ## 概要 @@ -67,6 +67,6 @@ Authorization Code Flowでユーザ情報、事業所情報を取得するまで ## 連絡先 ご不明点、ご要望等は以下までご連絡ください。 [email protected] -
yokoji revised this gist
Oct 9, 2013 . 1 changed file with 29 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,6 +4,22 @@ ## 概要 本APIを利用することで、あなたのアプリやサービスをfreeeと連携させることができます。 ### 提供機能(2013/10/10現在) * ユーザ情報の取得 * 事業所情報の取得 * 取引(収入・支出・振替)の照会/登録 * 口座明細の照会/登録 * 取引先の照会/登録 * 品目の照会/登録 * 勘定科目の照会 * 税区分の照会 * 口座情報の照会 ## 仕様 ### エンドポイント https://api.freee.co.jp/api/v1 (httpsのみ) @@ -20,7 +36,7 @@ https://api.freee.co.jp/api/v1 (httpsのみ) [oauth2]: http://tools.ietf.org/html/rfc6749 ## はじめに 1. [freee][freee]にサインアップします。 2. [アプリケーション一覧][oauth_app]から「新しいアプリケーションを登録」します。 @@ -30,19 +46,27 @@ https://api.freee.co.jp/api/v1 (httpsのみ) [freee]: https://secure.freee.co.jp/ [oauth_app]: https://secure.freee.co.jp/oauth/applications ## APIリファレンス https://secure.freee.co.jp/developers/api/doc ## サンプル実装 (Ruby) Authorization Code Flowでユーザ情報、事業所情報を取得するまでの実装例です。 * 使用する外部ライブラリ - oauth2 - faraday - faraday_middleware ## 注意点 * 本機能は現在β版として運用しており、予告なく新規APIが追加されることがありますのでご了承ください。 * APIのパラメータ等が変更になる場合は、バージョンを更新して提供いたします。 ## 連絡先 不明点、要望等は以下までご連絡ください。 [email protected] -
yokoji revised this gist
Oct 9, 2013 . 2 changed files with 12 additions and 7 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,17 +1,22 @@ # freee API v1.0 全自動クラウド会計ソフトfeeeのAPIです。 ## 概要 ### エンドポイント https://api.freee.co.jp/api/v1 (httpsのみ) ### 認証 [OAuth2][oauth2]に対応 - Authorization Code Flow (Webアプリ向け) - Implicit Flow (Mobileアプリ向け) ### データフォーマット リクエスト、レスポンスともにJSON形式をサポート [oauth2]: http://tools.ietf.org/html/rfc6749 This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,7 +5,7 @@ # Initialize options = { site: 'https://api.freee.co.jp', authorize_url: '/oauth/authorize', token_url: '/oauth/token' } -
yokoji revised this gist
Sep 14, 2013 . 2 changed files with 25 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -31,7 +31,7 @@ https://secure.freee.co.jp/developers/api/doc ## Sample Authorization Code Flowでユーザ情報、事業所情報を取得するまでのRubyの実装例です。 * 使用する外部ライブラリ - oauth2 This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -35,7 +35,7 @@ # GET /api/1/users/me access_token.get('/api/1/users/me?companies=true').response.env[:body] # { # "user" => # { @@ -45,5 +45,28 @@ # "last_name" => "freee", # "first_name_kana" => "たろう", # "last_name_kana"=> "ふりー" # "companies" => # { # "id" => "12345", # "display_name" => "freee株式会社", # "role" => "default" # } # } # } # GET /api/1/companies/:id access_token.get('/api/1/companies/12345?details=true').response.env[:body] # { # "company" => # { # "id" => 12345, # "name" => "freee株式会社, # "name_kana" => "ふりーかぶしきがいしゃ", # "display_name"=> "freeeカブシキガイシャ", # "role" => "default", # "account_items" => {...}, # "taxes" => {...}, # "items" => {...}, # "partners" => {...} # } -
yokoji revised this gist
Sep 14, 2013 . 2 changed files with 8 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -31,7 +31,12 @@ https://secure.freee.co.jp/developers/api/doc ## Sample Authorization Code Flowでユーザ情報を取得するまでのRubyの実装例です。 * 使用する外部ライブラリ - oauth2 - faraday - faraday_middleware ## Contact This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -29,13 +29,13 @@ } } token = client.get_token(params).token access_token = OAuth2::AccessToken.new(client, token) # GET /api/1/users/me access_token.get('/api/1/users/me').response.env[:body] # { # "user" => # { -
yokoji revised this gist
Sep 14, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -22,7 +22,7 @@ params = { grant_type: 'authorization_code', code: AUTHORIZATION_CODE, redirect_uri: YOUR_REDIRECT_URI, headers: { 'Content-Type' => 'application/json', 'Authorization' => HTTPAuth::Basic.pack_authorization(YOUR_APP_ID, YOUR_SECRET) -
yokoji revised this gist
Sep 14, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -35,4 +35,4 @@ Authorization Code Flowでユーザ情報を取得するまでのRubyの実装 ## Contact [email protected] -
yokoji revised this gist
Sep 14, 2013 . 1 changed file with 6 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,7 +6,7 @@ * 認証は[OAuth2][oauth2]に対応 - Authorization Code Flow (Webアプリ向け) - Implicit Flow (Mobileアプリ向け) * 通信はHTTPSのみ @@ -31,4 +31,8 @@ https://secure.freee.co.jp/developers/api/doc ## Sample Authorization Code Flowでユーザ情報を取得するまでのRubyの実装例。 ## Contact freee開発チーム [email protected] -
yokoji revised this gist
Sep 13, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -31,4 +31,4 @@ https://secure.freee.co.jp/developers/api/doc ## Sample Authorization Code Flowでユーザ情報を取得するまでのRubyの実装例。 -
yokoji revised this gist
Sep 13, 2013 . 1 changed file with 6 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -20,11 +20,15 @@ 1. [freee][freee]にサインアップします。 2. [アプリケーション一覧][oauth_app]から「新しいアプリケーションを登録」します。 3. アプリケーションの登録が完了すると、AppIDとSecretが取得できます。 4. テスト環境では、認証用URLを直打ちしてAuthorization Codeを取得できます。 [freee]: https://secure.freee.co.jp/ [oauth_app]: https://secure.freee.co.jp/oauth/applications ## API Reference https://secure.freee.co.jp/developers/api/doc ## Sample * Authorization Code Flowでユーザ情報を取得するまでのRubyの実装例。 -
yokoji revised this gist
Sep 13, 2013 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -18,7 +18,7 @@ ## Quick Start 1. [freee][freee]にサインアップします。 2. [アプリケーション一覧][oauth_app]から「新しいアプリケーションを登録」します。 3. アプリケーションの登録が完了すると、AppIDとSecretが取得できます。 4. テスト環境では、認証用URLを直打ちしてAuthorization Codeを取得することができます。 @@ -27,4 +27,4 @@ ## Sample * Authorization Code Flowでユーザ情報を取得するまでの例をRubyで載せています。 -
yokoji revised this gist
Sep 13, 2013 . 3 changed files with 30 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,30 @@ # freee API v1.0 draft 全自動クラウド会計ソフトfeeeのAPIです。 ## Notes * 認証は[OAuth2][oauth2]に対応 - Authorization Code Flow (Webアプリ向け) - Implicit Flow (Mobile向け) * 通信はHTTPSのみ * データフォーマットはJSON - Content-Type: 'application/json' [oauth2]: http://tools.ietf.org/html/rfc6749 ## Quick Start 1. [freee][freee]にサインアップします。 2. [アプリケーション一覧][applications]から「新しいアプリケーションを登録」します。 3. アプリケーションの登録が完了すると、AppIDとSecretが取得できます。 4. テスト環境では、認証用URLを直打ちしてAuthorization Codeを取得することができます。 [freee]: https://secure.freee.co.jp/ [oauth_app]: https://secure.freee.co.jp/oauth/applications ## Sample * Authorization Code Flowの例をRubyで載せています。 File renamed without changes.This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +0,0 @@ -
yokoji revised this gist
Sep 13, 2013 . 2 changed files with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes.File renamed without changes. -
yokoji created this gist
Sep 13, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,49 @@ require 'oauth2' require 'faraday' require 'faraday_middleware' # Initialize options = { site: 'https://secure.freee.co.jp', authorize_url: '/oauth/authorize', token_url: '/oauth/token' } client = OAuth2::Client.new(YOUR_APP_ID, YOUR_SECRET, options) do |conn| conn.request :url_encoded conn.request :json conn.response :json, content_type: /\bjson$/ conn.adapter Faraday.default_adapter end # Getting authorized params = { grant_type: 'authorization_code', code: AUTHORIZATION_CODE, redirect_uri: REDIRECT_URI, headers: { 'Content-Type' => 'application/json', 'Authorization' => HTTPAuth::Basic.pack_authorization(YOUR_APP_ID, YOUR_SECRET) } } token = client.auth_code.get_token(AUTHORIZATION_CODE, params).token access_token = OAuth2::AccessToken.new(client, token) # GET /api/1/users/me access_token.get('/api/1/users/me').response.env[:body] # { # "user" => # { # "email" => "[email protected]", # "display_name" => "freee太郎, # "first_name" => "太郎", # "last_name" => "freee", # "first_name_kana" => "たろう", # "last_name_kana"=> "ふりー" # } # } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,5 @@ # freee API v1.0 draft ## Quick Start ## Notes