====== 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//data?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