Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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 request

  • NDJSON output to a file append | tee -a output.json to request

  • if user requires output to be JSON, use | jq -s | tee -a output.json

  • ensure that ?dformat= matches the output file extension

  • check what directory output is going to by using ls