Export
Create an ndjson export from an OTQL query, run it, and download the result.
Your goal
Get the result of an OTQL query out of the platform as a file - for an analyst, a partner, or a one-off need.
Expected outcome
An ndjson file containing exactly the properties you selected in your query.
The objects involved
An export is a definition with:
a name,
an output format - always
JSONfor now,a type - always
QUERYfor now,an associated query,
an associated organisation,
an associated datamart.
Each export has executions, representing its result at a given time.
The resulting file is formatted as ndjson and contains the properties you selected in the SELECT part of the OTQL query.
Run an export
Download the file
Use one of these methods, the exports API being the recommended one:
technical_name is a value from result.output_files.
For a query such as SELECT {emails {id}} FROM UserPoint WHERE segments {id="<SEGMENTID>"}, the file looks like:
Note the empty arrays: a UserPoint matching the query but with no email still produces a line.
A 404 means the file does not exist or has been removed.
When an execution fails
Download the error file:
Verify
The query returns the expected results before you create the export.
The execution reaches
Succeeded, anderroneous_tasksis zero or explained.The downloaded file has the number of lines you expected, and the properties you selected.
Related pages
Last updated
Was this helpful?