Environment
Objective
How to fetch data into csv format using curl.
Resolution
- When making a request, append ?format=csv to the end
- For example, if sensors meta data is required from UI, it can be fetched in csv format using below query.
curl -s -k -XGET -H "X-Auth-Token:<APITOKEN>" "https://<CBRSERVER>/api/v2/sensor?format=csv"
Additional Notes
Below query can be used for fetching the data in json format.
curl -s -k -XGET -H "X-Auth-Token:<APITOKEN>" "https://<CBRSERVER>/api/v1/sensor"