Sl. | Endpoint | Usage | Method | Response Type |
---|---|---|---|---|
1 | / |
Show this Documentation | GET |
text/html |
2 | /getdata/now |
Get all latest sensor data updates | GET |
application/json |
3 | /getdata/<string:date> |
Get all sensor data for a given day. Date format to be passed : dd-mm-yyyy |
GET |
application/json |
4 | /getdata/<string:date>/<string:sensor> |
Get a specific sensor data for a given day | GET |
application/json |
5 | /insertdata |
Insert all sensor data into database | POST |
application/json |
6 | /setpump |
Set moisture threshold for automatic water pump | POST |
application/json |
7 | /getpump |
Read the threshold value from the server | GET |
application/json |
8 | /deletedata/<string:date> |
Delete all sensor data for a given day | DELETE |
application/json |
/getdata/now
:
{
"humidity": 0.77,
"light": 425,
"moisture": {
"plant0": 0.47,
"plant1": 0.72
},
"temparature": 33.2
}
/getdata/<dd-mm-yyyy>
:
{
"moisture": {
"plant0": [],
"plant1": []
},
"temparature": [],
"humidity": [],
"light": []
}
/getdata/<dd-mm-yyyy>/light
:
{
"records": [
{
"light": [
0,
6.67,
5.83,
5.83,
6.67,
273.33,
600.83,
523.33,
6.67,
5.83,
6.67
]
}
]
}
/insertdata
:
{
"moisture": {
"plant0": 0.0,
"plant1": 0.0
},
"temparature": 0.0,
"humidity": 0.0,
"light": 0.0
}
/setpump
:
{"pump0": 0.0, "pump1": 0.0}
/getpump
:
{
"settings": {
"pump0": 0.0,
"pump1": 0.0
}
}