Skip to content

Commit 91eacb5

Browse files
Merge pull request #1 from TakayukiHoshi1984/feature_profile_specs
サポートしているProfile用JSONの追加
2 parents 8d8a3b4 + 0e6f29f commit 91eacb5

46 files changed

Lines changed: 23918 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

api/airConditioner.json

Lines changed: 788 additions & 0 deletions
Large diffs are not rendered by default.

api/atmosphericPressure.json

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
{
2+
"swagger": "2.0",
3+
"basePath": "/gotapi/atmosphericPressure",
4+
"info": {
5+
"title": "Atmospheric Pressure Profile",
6+
"version": "2.0.0",
7+
"description": "気圧の値を取得する機能を提供するAPI。"
8+
},
9+
"consumes": [
10+
"application/x-www-form-urlencoded",
11+
"multipart/form-data"
12+
],
13+
"paths": {
14+
"/": {
15+
"get": {
16+
"x-type": "one-shot",
17+
"summary": "スマートデバイスの気圧情報を取得する。",
18+
"description": "",
19+
"parameters": [
20+
{
21+
"name": "serviceId",
22+
"description": "サービスID。取得対象スマートデバイス",
23+
"in": "query",
24+
"required": true,
25+
"type": "string"
26+
}
27+
],
28+
"responses": {
29+
"200": {
30+
"description": "",
31+
"schema": {
32+
"$ref": "#/definitions/GetAtmosphericPressureResponse"
33+
},
34+
"examples": {
35+
"application/json": {
36+
"result": 0,
37+
"product": "Example System",
38+
"version": "1.0.0",
39+
"atmosphericPressure": 1016.12,
40+
"timeStamp": 1431856940275,
41+
"timeStampString": "20150517100220.000-0000"
42+
}
43+
}
44+
}
45+
}
46+
}
47+
}
48+
},
49+
"definitions": {
50+
"GetAtmosphericPressureResponse": {
51+
"type": "object",
52+
"allOf": [
53+
{
54+
"$ref": "#/definitions/CommonResponse"
55+
},
56+
{
57+
"type": "object",
58+
"required": [
59+
"atmosphericPressure",
60+
"timeStamp",
61+
"timeStampString"
62+
],
63+
"properties": {
64+
"atmosphericPressure": {
65+
"type": "number",
66+
"title": "気圧",
67+
"description": "気圧<br>単位: ヘクトパスカル(hPa)"
68+
},
69+
"timeStamp": {
70+
"type": "integer",
71+
"format": "int64",
72+
"title": "気圧のタイムスタンプ",
73+
"description": "測定が行われた測定時間。ミリ秒のUnixタイムスタンプで返す。"
74+
},
75+
"timeStampString": {
76+
"type": "string",
77+
"title": "気圧のタイムスタンプ文字列",
78+
"description": "タイムスタンプと同じタイムスタンプを「YYYYMMDDHHMMSS.sss+/-HHMM」の形式で返す。"
79+
}
80+
}
81+
}
82+
]
83+
},
84+
"CommonResponse": {
85+
"type": "object",
86+
"required": [
87+
"result",
88+
"product",
89+
"version"
90+
],
91+
"properties": {
92+
"result": {
93+
"type": "integer",
94+
"title": "処理結果",
95+
"description": "0: 正常応答<br>0以外: 異常応答"
96+
},
97+
"product": {
98+
"type": "string",
99+
"title": "DeviceConnectシステムの名前",
100+
"description": ""
101+
},
102+
"version": {
103+
"type": "string",
104+
"title": "DeviceConnectシステムのバージョン名",
105+
"description": ""
106+
},
107+
"hmac": {
108+
"type": "string",
109+
"title": "レスポンスに対する署名",
110+
"description": "アプリケーション側から事前にHMACキーを共有されていた場合は必須。"
111+
}
112+
}
113+
}
114+
}
115+
}

api/authorization.json

Lines changed: 201 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,201 @@
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

Comments
 (0)