Source Files Download API Code Samples

Selection of code samples that demonstrate the use of the Source Files Download 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 "Source Files Download" in API Reference.

Download source files

Use this sample request to download all source data files from a tenant.

Note: For administrating tenants, this sample downloads files from the administrating tenant.

Copy
cURL sample request: Download all source files
curl -X GET --url 'https://{vanity_name}.api.visier.io/v1alpha/op/data/source-files' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'model={
      "downloadAll": true
    }' \
-o output.zip

The following sample request downloads all source files for a specific analytic tenant.

Copy
cURL sample request: Download all source files for tenant WFF_j1r~c7o
curl -X GET --url 'https://{vanity_name}.api.visier.io/v1alpha/op/data/source-files' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}' \
-H 'TargetTenantID: WFF_j1r~c7o' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'model={
      "downloadAll": true
    }' \
-o output.zip

Use the following sample request to download a specific source's files that were uploaded between the specified timestamps. If you don't know the source's ID, see "Retrieve a list of sources" in API Reference.

Copy
cURL sample request: Download the uploaded files for source abc-de between 2024-01-01T01:23:45.678Z and 2024-01-01T01:23:45.678Z
curl -X GET --url 'https://{vanity_name}.api.visier.io/v1alpha/op/data/source-files' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}' \
-H 'TargetTenantId: WFF_j1r~c7o' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'model={
      "sourceIds": ["abc-de"],
      "minTimestamp": "2024-01-01T01:23:45.678Z",
      "maxTimestamp": "2024-01-01T12:34:56.789Z"
    }' \
-o output.zip

The response returns a ZIP file containing the source data CSV files.