1+ {
2+ "swagger" : " 2.0" ,
3+ "basePath" : " /gotapi/authorization" ,
4+ "info" : {
5+ "title" : " Authorization Profile" ,
6+ "version" : " 2.0.0" ,
7+ "description" : " Local OAuthのクライアントを操作する機能を提供するAPI。"
8+ },
9+ "consumes" : [],
10+ "paths" : {
11+ "/grant" : {
12+ "get" : {
13+ "x-type" : " one-shot" ,
14+ "summary" : " Device Connect ManagerにLocal OAuthを行うためのクライアントの作成要求を行う。" ,
15+ "description" : " 同じオリジンから送信された場合には、以前のクライアントを削除して新たにクライアントを作成する。<br>それに伴い、クライアントに紐づいていたアクセストークンもすべて破棄される。" ,
16+ "parameters" : [],
17+ "responses" : {
18+ "200" : {
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+ }
31+ }
32+ }
33+ }
34+ },
35+ "/accessToken" : {
36+ "get" : {
37+ "x-type" : " one-shot" ,
38+ "summary" : " DeviceConnectManagerにLocal OAuthを行うためのアクセストークンの作成要求を行う。" ,
39+ "description" : " 各プロファイルにアクセスするためには、このAPIで作成したアクセストークンが必要になる。<br>また、アクセストークンには有効期限が存在するので、有効期限が切れた場合には再度アクセストークンを作成し直す必要がある。" ,
40+ "parameters" : [
41+ {
42+ "name" : " clientId" ,
43+ "description" : " クライアントID。Authorization Create Client APIで取得したclientIdを使用する。" ,
44+ "in" : " query" ,
45+ "required" : true ,
46+ "type" : " string"
47+ },
48+ {
49+ "name" : " applicationName" ,
50+ "description" : " アプリケーション名。承認確認画面に表示するアプリケーション名を指定する。<br>例:「Twitterイベントプラグイン」と指定した場合は、「TwitterイベントプラグインがdConnectにアクセスする許可をしますか?」と確認メッセージが表示される。" ,
51+ "in" : " query" ,
52+ "required" : true ,
53+ "type" : " string"
54+ },
55+ {
56+ "name" : " scope" ,
57+ "description" : " スコープ。使用するプロファイルの一覧をカンマ区切りで定義する。<br>例)file,notification,vibration" ,
58+ "in" : " query" ,
59+ "required" : true ,
60+ "type" : " array" ,
61+ "items" : {
62+ "type" : " string"
63+ }
64+ }
65+ ],
66+ "responses" : {
67+ "200" : {
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+ }
114+ }
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+ }
198+ }
199+ }
200+ }
201+ }
0 commit comments