|
1 | 1 | { |
2 | 2 | "swagger": "2.0", |
| 3 | + "basePath": "/gotapi/authorization", |
3 | 4 | "info": { |
4 | 5 | "title": "Authorization Profile", |
5 | 6 | "version": "2.0.0", |
6 | | - "description": "" |
| 7 | + "description": "Local OAuthのクライアントを操作する機能を提供するAPI。" |
7 | 8 | }, |
8 | 9 | "consumes": [], |
9 | 10 | "paths": { |
10 | 11 | "/grant": { |
11 | 12 | "get": { |
12 | 13 | "x-type": "one-shot", |
13 | | - "summary": "", |
14 | | - "description": "", |
| 14 | + "summary": "Device Connect ManagerにLocal OAuthを行うためのクライアントの作成要求を行う。", |
| 15 | + "description": "同じオリジンから送信された場合には、以前のクライアントを削除して新たにクライアントを作成する。<br>それに伴い、クライアントに紐づいていたアクセストークンもすべて破棄される。", |
15 | 16 | "parameters": [], |
16 | 17 | "responses": { |
17 | 18 | "200": { |
18 | | - "description": "" |
| 19 | + "description": "", |
| 20 | + "schema": { |
| 21 | + "$ref": "#/definitions/GrantResponse" |
| 22 | + }, |
| 23 | + "examples": { |
| 24 | + "application/json": { |
| 25 | + "result": 0, |
| 26 | + "product": "Example System", |
| 27 | + "version": "1.0.0", |
| 28 | + "clientId": "d94da8f1-3826-4ed5-a729-2d9499e842c9" |
| 29 | + } |
| 30 | + } |
19 | 31 | } |
20 | 32 | } |
21 | 33 | } |
22 | 34 | }, |
23 | 35 | "/accessToken": { |
24 | 36 | "get": { |
25 | 37 | "x-type": "one-shot", |
26 | | - "summary": "", |
27 | | - "description": "", |
| 38 | + "summary": "DeviceConnectManagerにLocal OAuthを行うためのアクセストークンの作成要求を行う。", |
| 39 | + "description": "各プロファイルにアクセスするためには、このAPIで作成したアクセストークンが必要になる。<br>また、アクセストークンには有効期限が存在するので、有効期限が切れた場合には再度アクセストークンを作成し直す必要がある。", |
28 | 40 | "parameters": [ |
29 | 41 | { |
30 | 42 | "name": "clientId", |
| 43 | + "description": "クライアントID。Authorization Create Client APIで取得したclientIdを使用する。", |
31 | 44 | "in": "query", |
32 | 45 | "required": true, |
33 | 46 | "type": "string" |
34 | 47 | }, |
35 | 48 | { |
36 | 49 | "name": "applicationName", |
| 50 | + "description": "アプリケーション名。承認確認画面に表示するアプリケーション名を指定する。<br>例:「Twitterイベントプラグイン」と指定した場合は、「TwitterイベントプラグインがdConnectにアクセスする許可をしますか?」と確認メッセージが表示される。", |
37 | 51 | "in": "query", |
38 | 52 | "required": true, |
39 | 53 | "type": "string" |
40 | 54 | }, |
41 | 55 | { |
42 | 56 | "name": "scope", |
| 57 | + "description": "スコープ。使用するプロファイルの一覧をカンマ区切りで定義する。<br>例)file,notification,vibration", |
43 | 58 | "in": "query", |
44 | 59 | "required": true, |
45 | 60 | "type": "array", |
|
50 | 65 | ], |
51 | 66 | "responses": { |
52 | 67 | "200": { |
53 | | - "description": "" |
| 68 | + "description": "", |
| 69 | + "schema": { |
| 70 | + "$ref": "#/definitions/AccessTokenResponse" |
| 71 | + }, |
| 72 | + "examples": { |
| 73 | + "application/json": { |
| 74 | + "result": 0, |
| 75 | + "product": "Example System", |
| 76 | + "version": "1.0.0", |
| 77 | + "accessToken": "0a93ac0aade4e046ed63eb24d1172f5f35c88ca60daa901547c28d5827cb418a5de1d7c5f9e62405", |
| 78 | + "scopes":[ |
| 79 | + { |
| 80 | + "scope": "file", |
| 81 | + "expirePeriod": 15552000 |
| 82 | + }, |
| 83 | + { |
| 84 | + "scope": "creditcard", |
| 85 | + "expirePeriod": 0 |
| 86 | + } |
| 87 | + ], |
| 88 | + "expire": 1431856940275 |
| 89 | + } |
| 90 | + } |
| 91 | + } |
| 92 | + } |
| 93 | + } |
| 94 | + } |
| 95 | + }, |
| 96 | + "definitions": { |
| 97 | + "GrantResponse": { |
| 98 | + "type": "object", |
| 99 | + "allOf": [ |
| 100 | + { |
| 101 | + "$ref": "#/definitions/CommonResponse" |
| 102 | + }, |
| 103 | + { |
| 104 | + "type": "object", |
| 105 | + "required": [ |
| 106 | + "clientId" |
| 107 | + ], |
| 108 | + "properties": { |
| 109 | + "clientId": { |
| 110 | + "type": "string", |
| 111 | + "title": "クライアントID", |
| 112 | + "description": "クライアントを識別するためのID。" |
| 113 | + } |
54 | 114 | } |
55 | 115 | } |
| 116 | + ] |
| 117 | + }, |
| 118 | + "AccessTokenResponse": { |
| 119 | + "type": "object", |
| 120 | + "allOf": [ |
| 121 | + { |
| 122 | + "$ref": "#/definitions/CommonResponse" |
| 123 | + }, |
| 124 | + { |
| 125 | + "type": "object", |
| 126 | + "required": [ |
| 127 | + "accessToken", |
| 128 | + "expire", |
| 129 | + "scopes" |
| 130 | + ], |
| 131 | + "properties": { |
| 132 | + "accessToken": { |
| 133 | + "type": "string", |
| 134 | + "title": "アクセストークン", |
| 135 | + "description": "各プロファイルにアクセスする場合に必要になる。" |
| 136 | + }, |
| 137 | + "expire": { |
| 138 | + "type": "number", |
| 139 | + "title": "失効日時", |
| 140 | + "description": "スコープ毎のアクセストークンの失効時刻のうち、直近の時刻(UNIX時間)。" |
| 141 | + }, |
| 142 | + "scopes": { |
| 143 | + "type": "array", |
| 144 | + "title": "スコープ配列", |
| 145 | + "description": "スコープの有効期限一覧を格納する配列。", |
| 146 | + "items":{ |
| 147 | + "type": "object", |
| 148 | + "required": [ |
| 149 | + "scope", |
| 150 | + "expirePeriod" |
| 151 | + ], |
| 152 | + "properties": { |
| 153 | + "scope": { |
| 154 | + "type": "string", |
| 155 | + "title": "スコープ", |
| 156 | + "description": "スコープのプロファイル名。" |
| 157 | + }, |
| 158 | + "expirePeriod": { |
| 159 | + "type": "number", |
| 160 | + "title": "スコープの有効期限", |
| 161 | + "description": "アクセストークンの有効期限。スコープ毎に設定されている。<br>アクセストークンが作成されてから使用できる間の時間(秒)を返す。<br>この時間を過ぎるとアクセストークンが使用できなくなる。" |
| 162 | + } |
| 163 | + } |
| 164 | + } |
| 165 | + } |
| 166 | + } |
| 167 | + } |
| 168 | + ] |
| 169 | + }, |
| 170 | + "CommonResponse": { |
| 171 | + "type": "object", |
| 172 | + "required": [ |
| 173 | + "result", |
| 174 | + "product", |
| 175 | + "version" |
| 176 | + ], |
| 177 | + "properties": { |
| 178 | + "result": { |
| 179 | + "type": "integer", |
| 180 | + "title": "処理結果", |
| 181 | + "description": "0: 正常応答<br>0以外: 異常応答" |
| 182 | + }, |
| 183 | + "product": { |
| 184 | + "type": "string", |
| 185 | + "title": "DeviceConnectシステムの名前", |
| 186 | + "description": "" |
| 187 | + }, |
| 188 | + "version": { |
| 189 | + "type": "string", |
| 190 | + "title": "DeviceConnectシステムのバージョン名", |
| 191 | + "description": "" |
| 192 | + }, |
| 193 | + "hmac": { |
| 194 | + "type": "string", |
| 195 | + "title": "レスポンスに対する署名", |
| 196 | + "description": "アプリケーション側から事前にHMACキーを共有されていた場合は必須。" |
| 197 | + } |
56 | 198 | } |
57 | 199 | } |
58 | 200 | } |
|
0 commit comments