User Tools

Site Tools


user:jan001:ioa:farmos:datastream_post

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
user:jan001:ioa:farmos:datastream_post [2021/07/07 15:56] – created jan001user:jan001:ioa:farmos:datastream_post [2021/08/24 17:35] (current) – external edit 127.0.0.1
Line 3: Line 3:
   - Create a Sensor in farmOS   - Create a Sensor in farmOS
   - Create a DataStream in / for that sensor   - Create a DataStream in / for that sensor
-  - Call +  - 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: 
 +  * [[https://docs.farmos.org/development/api/index.html|Introduction farmOS 2.x API]] 
 +  * [[https://farmos.org/guide/assets/sensors/|farmOS 1.x Sensors]] 
 +    * Hint for ?private_key= 
 +  * [[https://farmos.org/development/api/#oauth2-details|farmOS 1.x OAuth 2.0]] 
 +  * [[https://www.drupal.org/project/farm/issues/3199413|2.x Data stream issue / todo]] 
 +  * [[https://www.drupal.org/project/farm/issues/3203015|currently (7.2021) no graphs]] 
 +    * labeled as beta blocker 
 +  * [[https://github.com/farmOS/farmOS/blob/2.x/modules/core/data_stream/data_stream.routing.yml|farmsOS 2.x data stream module routing]] 
 +    * shows how to build the url
user/jan001/ioa/farmos/datastream_post.1625666178.txt.gz · Last modified: 2021/08/24 17:34 (external edit)