Comment on page

Query Exports

The platform allows you to export data as ndjson, based on OTQL queries. This action is available in the navigator or through API to automate the process.
For punctual exports, you may want to use the navigator (in Data Studio > Exports) rather than our API for more simplicity.
An export is a definition with:
  • a name
  • an output format (always JSON for now)
  • a type (always QUERY for now)
  • an associated query
  • an associated organisation
  • an associated datamart
Each export has executions representing its result at a given time.
An execution goes through different stages:
  • Pending if the export is not started
  • Running if the export is started
  • Succeeded or Failed once the export has been completed
The resulting file is formatted in ndjson, and contains the properties you selected in the SELECT part of the OTQL query.
Listing exports
Details of an export

Create an export

You will first need to create a query for your export.
You should check your query and verify its results before creating an export. It is easier to do at this step, as the export would only return an empty file and no message.
Create an export
// Creating an export payload
"name": "<YOUR_EXPORT_NAME>",
"output_format": "JSON",
"type": "QUERY"
Generate an execution
Execution status
If available, the technical name of the file to download is in the result.output_files array

Download the result of an export

The result of an export is saved as a data file in the platform.
You have two methods to retrieve it :
  • Using the exports API (recommended)
  • Using the data_file API
Download using the exports API
Download using the data_file API
Download the error file