API

API data exports

Export data in CSV or JSON format in batch

Last updated July 9th, 2020

The Jetti API allows you to export data in JSON format. However, if you need to export a significant amount of data, you'll need to paginate through the API and implement handling for rate limiting.

As an alternative, certain endpoints support the exporting of data asynchronously via CSV and JSON. To set this up, you'll first need to set up an API template within the setup area.

Once the format and data mapping has been setup, you'll then need to select the webhook option for delivery. A URL should be provided to send the completed data export. This will be done via a POST request with the following body:

{
    "file": "https://....."
}

The file will link to a generated JSON or CSV file you can then download. From there, you can use this data to populate external BI tools or databases.

Triggering the export via the UI

The exports can be triggered from the Jetti dashboard. For example, under the purchases list you can trigger the webhook from the Export button. As with the other exports, filtering the data on the page (e.g. specifying a date range) will also filter the exported data.

Triggering the export via the API

You can also trigger the exports via API. To do this, you'll need to know the template id. This can usually be found in the URL in the UI. Or, by querying the /api/templates.json endpoint.

To trigger the webhook / email export, you'll need to send a JSON payload detailing any data filtering to POST /api/templates/:id/export.json. As an example, if you wanted to filter based upon date range, dropship provider and purchase type, you can send:

{
   "where": {
        "purchaseType": {
            "$in": ["dropship", "automated_dropship", "adjusted_dropship"]
        },
        "dropshipProviderId": 4230
    },
    "dateFrom": "2018-01-01T00:00:00Z",
    "dateTo": "2019-01-01T00:00:00Z"
}
Back to API