Skip to content
MMyungji edited this page Nov 11, 2019 · 3 revisions

센서데이터 저장하기

메소드 경로 짧은 설명
POST /sensor 사용자의 화분 센서에 측정된 데이터 저장

요청 헤더

authorization : token

요청 바디

{
    "soil_water" : "화분 토양 수분",
    "temperature" : "주변 온도",
    "humidity" : "주변 습도",
    "fine_dust" : "주변 미세먼지 농도(PM2.5로 저장해주세요)",
    "co_gas" : "주변 일산화탄소 농도"
}

요청 바디 예시

{
    "soil_water" : "34",
    "temperature" : "20.3",
    "humidity" : "45.6",
    "fine_dust" : "12",
    "co_gas" : "2.5"
}

응답 바디

생성 성공

{
    "message": "success"
}

생성 실패

{
    "message": "fail"
}

token 없을 때

{
    message: "access denied"
}
Clone this wiki locally