...
You can easily change the output format in every data request using the URL parameter dformat
and the Content-Type:
.
NDJSON
Request cURL request example:
Code Block |
---|
https://ecoplots-test.tern.org.au/api/v1.0/datasets?dformat=ndjson |
...
Response content-type: application/x-ndjsonjson
CSV
Request example:
Code Block |
---|
https://ecoplots-test.tern.org.au/api/v1.0/datasets?dformat=csv |
...
Response content-type: text/csv
...
Should you need or wish to export the request response output into a standalone file, append the following commands
CSV output to a file append
| tee -a output.csv
to requestNDJSON output to a file append
| tee -a output.json
to requestif user requires output to be JSON, use
| jq -s | tee -a output.json
ensure that
?dformat=
matches the output file extensioncheck what directory output is going to by using
ls