Data Version Export API Code Samples

Selection of code samples that demonstrate the use of the Data Version Export API. Copy and edit these code samples to suit your needs.

When using the code samples, remember to replace:

  • {vanity_name} with your tenant name
  • {api_key} with your API key
  • {security_token} with a valid security token

These code samples may not include all available parameters and request body fields for each endpoint. For the endpoint's full request schema, see "Data Version Export" in API Reference.

Retrieve a list of all data versions

Use this sample request to retrieve all the data versions in your Visier tenant. The returned data versions are the data versions you can export using the Data Version Export API.

Copy
cURL sample request: Retrieve a list of all data versions
curl -X GET --url 'https://{vanity_name}.api.visier.io/v1alpha/data/data-version-exports/data-versions' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}'

The response returns all available data versions that you can export.

Schedule a data version export job

Use this sample request to start a data version export job. In this sample, the job will generate a full export for the data version 1234567. The response returns a jobUuid that you can use to check the export job status. To check the export job status, see Retrieve a data version export job's status.

Copy
cURL sample request: Schedule a data version export job
curl -X POST --url 'https://{vanity_name}.api.visier.io/v1alpha/data/data-version-exports/jobs' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}'
-d '{
    "dataVersionNumber": "1234567",
    "baseDataVersionNumber": ""
}'

The response returns the export job's UUID.

Retrieve a data version export job's status

Use this sample request to retrieve the status of a data version export job. After the job completes successfully, the response returns an exportUuid that you can use to retrieve the details of the export. To retrieve the export details, see Retrieve the details of a data version export.

Copy
cURL sample request: Retrieve the status of data version export job c19e2f2b-e8eb-4925-9d7c-228ccce7de1c
curl -X GET --url 'https://{vanity_name}.api.visier.io/v1alpha/data/data-version-exports/jobs/c19e2f2b-e8eb-4925-9d7c-228ccce7de1c' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}'

If the job has completed successfully, the response returns the export UUID.

If the job hasn't completed yet, the response returns an empty export UUID.

Retrieve the details of a data version export

Use this sample request to retrieve the details of a specific data version export. The response returns information about the data version, such as the data version number, tables, columns, and files. To download a file from the export, see Download a file from a data version export.

Copy
cURL sample request: Retrieve the details of data version export 73846160-9c47-11ed-bc10-ebc0e0091820
curl -X GET --url 'https://{vanity_name}.api.visier.io/v1alpha/data/data-version-exports/exports/73846160-9c47-11ed-bc10-ebc0e0091820' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}'

The response returns the export information.

Retrieve the details of all data version exports

Use this sample request to retrieve any existing data version exports. The response returns all available exports and their details, such as the data version number, tables, columns, and files. To download a file from the export, see Download a file from a data version export.

Copy
cURL sample request: Retrieve all data version exports
curl -X GET --url 'https://{vanity_name}.api.visier.io/v1alpha/data/data-version-exports' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}'

The response returns the details of each data version export.

Download a file from a data version export

Use this sample request to download a file from a data version export. The file is the final output of Visier's data processing job and represents the state of your data in the exported data version. Data version export files are in CSV format, compressed with gzip. You can download one file per API request.

Copy
cURL sample request: Download a file from a data version export
curl -X GET --url 'https://{vanity_name}.api.visier.io/v1alpha/data/data-version-exports/exports/73846160-9c47-11ed-bc10-ebc0e0091820/files/0' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}' \
-o ./{file_name}.gz

The response returns one or more CSV files that contain the columns and values for the table. For example, the Employee table file contains columns like EmployeeID, First_Name, Last_Name, Birth_Date, Job_Name, and Performance_Rating. For more information, see File format.