Server (0.0.3)

Download OpenAPI specification:Download

Status check

ステータスの取得を行う

ステータスは以下の値を取る

  • in: 入浴中
  • out: 入浴していない
  • danger: 危険
  • unknown: 不明

デバイスはidによって識別される

Responses

Response samples

Content type
application/json
{
  • "status": "in"
}

Update status

ステータスの更新を行う

ステータスは以下の値にセット可能

  • in: 入浴中
  • out: 入浴していない
  • danger: 危険

デバイスはidによって識別される

Request Body schema: application/json
status
string
Enum: "in" "out" "danger"

Responses

Request samples

Content type
application/json
{
  • "status": "in"
}

Response samples

Content type
application/json
{
  • "status": "in"
}

get sensor data

センサーデータの取得を行う

Responses

Response samples

Content type
application/json
{
  • "temperature": 28.5,
  • "humidity": 84.2,
  • "co2": 1000,
  • "lastUpdate": "2019-08-24T14:15:22Z"
}

update sensor data

センサーデータをアップデートする

Request Body schema: application/json
temperature
number

温度 (℃)

humidity
number

湿度 (%)

co2
number

CO2濃度 (ppm)

Responses

Request samples

Content type
application/json
{
  • "temperature": 28.5,
  • "humidity": 84.2,
  • "co2": 1000
}

Response samples

Content type
application/json
{
  • "temperature": 28.5,
  • "humidity": 84.2,
  • "co2": 1000,
  • "lastUpdate": "2019-08-24T14:15:22Z"
}

Send alart

デバイスからスマホに対してアラートを送信する

デバイスはidによって識別される

json形式で以下のようなメッセージを送信できる

{
  "message": "浴室で大きな音が検知されました"
}
Request Body schema: application/json
message
string

Responses

Request samples

Content type
application/json
{
  • "message": "string"
}

Response samples

Content type
application/json
{
  • "message": "Alart sent."
}

get phone number

緊急連絡を行うための電話番号を取得する

Responses

Response samples

Content type
application/json
{
  • "number": "string"
}

Set phone number

緊急連絡を行うための電話番号を設定する

Request Body schema: application/json
number
string

Responses

Request samples

Content type
application/json
{
  • "number": "string"
}

Response samples

Content type
application/json
{
  • "number": "string"
}

get status history

ステータスの履歴を取得する

Responses

Response samples

Content type
application/json
{
  • "history": [
    ]
}