Links

Exports

We are no longer updating this site. For user documentation, please go to User Docs. For developer documentation, please go to Developer Docs. If you have any questions or feedback, please submit a ticket.

Overview

The Export API is an asynchronous API which enables you to export your data to s3 buckets.
The exports endpoint has two distinct behaviors, depending on whether the objects field or the select field has been used.
field used
behavior
select
Filtered export of the object against which this filter is applied.
objects
Full export of the objects named in this array.
Select provides a simple JSON syntax for selecting certain fields and filtering that can span several related Objects. Filters support conjunctions (and & or) to any depth and field comparisons include all the operators necessary for simple sql-like "where" clause filtering.

Completion

After triggering your export by calling the POST exports endpoint, you can determine when your job has been completed in two ways:
  1. 1.
    Check the bucket specified in your export response for a file called complete.json, which will be written upon completion.
  2. 2.
    Poll the GET exports/{export_id} endpoint with the export id returned from the export response and look for state completed.
Once your job is complete, access your S3 export bucket to retrieve the set of files that are produced. The export id references a directory within the export bucket which contains a set of one or more files.

Accessing Amazon S3

To learn how to access your exports within Amazon S3, please visit our Exports reference.
post
https://api.zaius.com/v3
/exports
Start Export Job (Filtered)
Example Payload
{
"format": "csv",
"delimiter": "comma",
"select": {
"object": "events",
"fields": [
"product.name"
],
"filter": {
"field": "product.name",
"operator": "=",
"value": "%shoe%"
},
"sorts": [
{
"field": "product.name",
"order": "asc"
}
]
}
}
post
https://api.zaius.com/v3
/exports
Start Export Job (Unfiltered)
Example Payload
{
"objects": [
"string"
],
"format": "csv",
"delimiter": "comma"
}
get
https://api.zaius.com/v3
/exports/{export_id}
Get Export Job Status
Example Request
curl -iX GET \
'https://api.zaius.com/v3/exports/example-export-id' \
-H 'x-api-key: example.apiKey'

More on Filtering

The filtering section in the payload may contain one of the following:
  • Clause: A standalone clause for defining a filter on Zaius data elements.
  • and (all sub-clauses): A combination of clauses - if all of the contained clauses (which may include nested and/or clauses) evaluate to true, this data element may pass the overall filter. If any one (or more) of them do not, the data element will not pass the filter.
  • or (at least one sub-clause): A combination of clauses - if any one (or more) of the contained clauses (which may include nested and/or clauses) evaluates to true, this data element may pass the overall filter. If none do, the data element will not pass the filter.
  • and/or are case-sensitive in this filter
Note that the nature of and /or clauses enables arbitrarily many criteria to be combined.
Example Payload with Filter
{
"format": "csv",
"delimiter": "comma",
"select": {
"object": "customers",
"fields": [
"email",
"insights.ttno_days"
],
"filter": {
"and": [
{
"field": "email",
"operator": "!=",
"value": null
},
{
"field": "ccpa_opted_out",
"operator": "!=",
"value": true}
]
}
}
}