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.
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
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 Data In API Reference.
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.