Export Jobs Overview

The Export Jobs API allows you to schedule and export large data sets from the Terminus platform. Export jobs are configured and scheduled at user-defined intervals. Export job executions can be retrieved via the API and will return links to CSV files containing the results. Export jobs will automatically expire after 30 days unless the job executions are retrieved or the job is refreshed via an update.

Example Scenario

A marketer schedules an Ad Experiences Tactic Performance report to run on the first day of every month. The data exported in this report can subsequently be used in an external business intelligence or data warehouse application for additional reporting needs.

Copy
Copied
$ curl -i -X POST \
   -H "Authorization: Bearer API_KEY_GOES_HERE" \
   https://api.terminusplatform.com/exports/v1/exportJobs \
   -H 'Content-Type: application/json' \
   -d '{"type": "TACTIC_PERFORMANCE","schedule": "0 0 1 * *"}'

Once the Export Job is scheduled, you can check the Export Job Executions to see if your report has completed and use the download location to retrieve the data.

Copy
Copied
$ curl -H 'Accept: application/json' -H "Authorization: Bearer API_KEY_GOES_HERE" "https://api.terminusplatform.com/exports/v1/exportJobs/TACTIC_PERFORMANCE/executions?pageSize=50&orderBy=updateTime%20asc&filter=status%3DCOMPLETE"

{"exportJobExecutions":[{"id":"31b06aae-37e6-4ed6-a382-0fe24dafb0bb","exportId":"TACTIC_PERFORMANCE","state":"COMPLETE","downloadUri":"https://slerms-files.s3.amazonaws.com/cdd2bef3-3427-4050-a035-46f42329b2e27"}]}

If you want to download the latest Export Job Execution, you can use the following command:

Copy
Copied
$ curl -o export.csv "$(curl -s -H 'Accept: application/json' -H "Authorization: Bearer API_KEY_GOES_HERE" "https://api.terminusplatform.ninja/exports/v1/exportJobs/TACTIC_PERFORMANCE/executions?pageSize=50&orderBy=updateTime%20asc&filter=status%3DCOMPLETE" | jq -r '.exportJobExecutions[].downloadUri')"

Scheduling

An Export Job for a specific type can only be scheduled once per account and the maximum interval an Export Job can be run is once per day. Exported data for the last 48hrs is subject to change.