Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Create new endpoint to POST sensor readings

Jira Legacy
serverSystem JIRA
serverId815f41e5-e5fb-3402-8587-82eccc3ffab0
keyLF-2454
Jira Legacy
server
System JIRA
serverId815f41e5-e5fb-3402-8587-82eccc3ffab0
keyLF-2454

Role: N/A

API: N/A

Dates: N/A

...

Test Step #

Description

Test Data

Expected Result

Actual Result

Pass/Fail

1

Using Postman an API make a POST request to {{base_url}}/sensorssensor/add_reading/partner/1/farm/:{{farm_id}}

Endpoint with sample data for an active sensor at the farm_id in the request in the same format as test data

Example json that webhook will post to the url

[

{
"MBZ69B": {
"node_esidlabel": "123Simulated device",
"sensordevice_esidtype": "124ESA-10015 - Soil Water Potential Sensor",
"parameter_numberconfigurable": 1false,
"unitfirmware_version": "ÂșC"null,
"timehardware_version": [ "02-09-2022, 22:53:52"D",
"02-09-2022, 22:54:07"

],

"value": [

1,

2

],

"validated": [

false,

false

]

},

{

"node_esid": "123",

"sensor_esid": "124",

"parameter_number": 2,

"unit": "kPa",

"timedata": [
{
"parameter_category": "Soil Water Potential",
"unit": "kPa",
"label": null,
"parameter_number": 0,
"timestamps": [
"022022-09-2022, 22:54:23"11-24 07:07:07.715370+00:00"],
"valuevalues": [

3

109.8519954399],
"validated": [
false], "raw_values": [
109.8519954399]} ]

200 Response status

2

Check database and ensure that sensor reading data is being persisted correctly

Readings received in the post request exist

3

...