user:jan001:ioa:farmos:datastream_post
Post Data to Datastream
- Create a Sensor in farmOS
- Create a DataStream in / for that sensor
- Call GET http://localhost/api/data_stream/basic/ to get all basic data streams
- Response:
- data includes an array of data_streams
- ID: res.data[i].id
- private_key: res.data[i].attributes.private_key
- name: res.data[i].attributes.name
- Call POST http://localhost/api/data_stream/<ID>/data?private_key=<private_key> with a Body (in Postman 'raw','json'):
- {'data': 20}
- basic data streams can only have one value
- will look for 'data' in JSON
- Should give a 201 Created back
- This value can now be found in Assets>Sensors>(The Sensor you want)>Data stream
Important Links:
-
- Hint for ?private_key=
-
- labeled as beta blocker
-
- shows how to build the url
user/jan001/ioa/farmos/datastream_post.txt · Last modified: 2023/01/05 14:38 by 127.0.0.1