-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #45 from jphacks/feature/update_server_document
Feature/update server document
- Loading branch information
Showing
1 changed file
with
55 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# API ドキュメント | ||
|
||
## /api/line | ||
|
||
- line API との通信用 | ||
|
||
### /api/line/callback | ||
|
||
- line API から受け取った内容をもとに,イベント処理を行う | ||
- カルーセルや返信などは,内容に応じて分岐させている | ||
|
||
## /api/sensor | ||
|
||
- Arduino などのエッジデバイスからのデータを受け取る | ||
|
||
### /api/sensor POST | ||
|
||
- Arduino から Json でデータを受け取る | ||
例: | ||
|
||
```json | ||
{ | ||
"device_id": 1, // (デバイスID)[../arduino/include.md#config.h] | ||
"session_id": "1a2b3c-...", // セッションID: UUID | ||
"external_temperature": 20.0, // 外気温度 | ||
"external_humidity": 20.0,// 外気湿度 | ||
"interlnal_temperature": 20.0, // 靴内温度 | ||
"interlnal_humidity": 20.0,// 靴内湿度 | ||
"drying": 0, // 乾燥状態: bool | ||
} | ||
``` | ||
|
||
## /api/session | ||
|
||
- セッション関係のAPI | ||
|
||
### /api/session GET | ||
|
||
- セッション発行用API | ||
- エッジデバイスからの要求を想定 | ||
- セッションIDを発行し,Lineに靴の乾燥の旨を通知 | ||
- `/api/session/?device_id=1` | ||
- device_id: required | int | ||
|
||
## /api/shoe | ||
|
||
- 靴関係のAPI | ||
|
||
### /api/shoe GET | ||
|
||
- 靴検索用API | ||
- 靴のid と靴の名前(部分一致)で可能 | ||
- `/api/shoe/?id=1?name=靴` | ||
- id: optional | int | ||
- name: optional | string |