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

...

Test Step #

Description

Test Data

Expected Result

Actual Result

Pass/Fail

1

Using Postman an API make a POST request to {{base_url}}/sensors/add_reading/1/: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

[

{

"node_esid": "123",

"sensor_esid": "124",

"parameter_number": 1,

"unit": "ÂșC",

"time": [

"02-09-2022, 22:53:52",

"02-09-2022, 22:54:07"

],

"value": [

1,

2

],

"validated": [

false,

false

]

},

{

"node_esid": "123",

"sensor_esid": "124",

"parameter_number": 2,

"unit": "kPa",

"time": [

"02-09-2022, 22:54:23"

],

"value": [

3

],

"validated": [

false

]

}

]

200 Response status

2

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

Readings received in the post request exist

3

...