Extract the activity data for a specific date or a specific asset.
Logs can be filtered by asset ID using log.json?asset=[asset-id]
Logs can be filtered similarly with their timestamp property - but right now it’s tricky to query logs with a specific date via the API because logs are stored with a timestamp, and the RESTful Web Services module (which provides the farmOS API) does not support “greater than” or “less than” filters in URL queries. My hope is that filtered queries like this will be much easier in farmOS 2.0 with the GraphQL module (work in progress).
There is a patch available for the RESTful Web Services module that is marked as “Needs Review” - if that is merged into the project then it would allow us more flexibility in farmOS 1.x: https://www.drupal.org/project/restws/issues/1910294
how can sensor data be extracted using API and search criteria as listed above
Sensor data has it’s own API (different from logs), which does support timestamp ranges. For more details, see Sensors - farmOS.org
One way to do this would be to request all the logs for the given animal, and then iterate through them and filter out dates that don’t apply in your own code.
Can confirm that this patch does work. I have applied it to the restws module in the farmos/farmos:dev docker container. When applied, it provides the ability to query for a range of timestamps (and other types of fields as well) through the farmOS 1.x API provided by the restws module.
One note: The patch itself has to be modified by changing FALSE to TRUE on the line: + if (variable_get('restws_filter_operators', FALSE)) {