curl --request GET \
--url https://{instance}/api/export/v1/sample-data \
--header 'Authorization: <api-key>'import requests
url = "https://{instance}/api/export/v1/sample-data"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://{instance}/api/export/v1/sample-data', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{instance}/api/export/v1/sample-data",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{instance}/api/export/v1/sample-data"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://{instance}/api/export/v1/sample-data")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{instance}/api/export/v1/sample-data")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body<string>{
"error": "<string>"
}{
"error": "<string>"
}Export sample data
Run a query against a catalog asset and export the resulting rows. The columns are determined by the query at runtime, so there is no fixed schema.
Requires the CATALOG_ASSETS_READ permission, and SQL_EXECUTION_WRITE in the namespace of the credential, because the query runs against your data system.
This endpoint does not accept filter or sort.
curl --request GET \
--url https://{instance}/api/export/v1/sample-data \
--header 'Authorization: <api-key>'import requests
url = "https://{instance}/api/export/v1/sample-data"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://{instance}/api/export/v1/sample-data', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{instance}/api/export/v1/sample-data",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{instance}/api/export/v1/sample-data"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://{instance}/api/export/v1/sample-data")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{instance}/api/export/v1/sample-data")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body<string>{
"error": "<string>"
}{
"error": "<string>"
}Authorizations
Your API key's access key and access secret, colon-delimited: <access-key>:<access-secret>. The same header as the GraphQL API; see Authentication.
Query Parameters
The ID of the catalog asset to sample.
The ID of the credential used to reach the asset's data system.
The SQL query to run against the asset.
Response
A CSV export with a header row, capped at 100,000 rows. The Content-Disposition header carries a generated filename built from the resource, an optional entity name, and the time range (or today's date if the request has no time bounds).
The response is of type string.