curl --request GET \
--url https://api-dev.narrative.io/datasets \
--header 'Authorization: Bearer <token>'import requests
url = "https://api-dev.narrative.io/datasets"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api-dev.narrative.io/datasets', 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://api-dev.narrative.io/datasets",
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: Bearer <token>"
],
]);
$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://api-dev.narrative.io/datasets"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api-dev.narrative.io/datasets")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-dev.narrative.io/datasets")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"prev_page": null,
"current_page": 1,
"next_page": null,
"total_records": 1,
"total_pages": 1,
"records": [
{
"id": 18923,
"company_id": 382,
"created_at": "2021-06-24T00:54:40.029056Z",
"data_plane": {
"type": "owned",
"id": "c0bed5c2-8af8-4f7a-9787-1ffc3def339b",
"company_id": 382,
"created_at": "2021-06-01T00:00:00Z",
"description": "The company's Snowflake account",
"display_name": "Snowflake (us-west-2)",
"external_id": "snowflake-prod",
"is_narrative": false,
"platform": {
"type": "platform_snowflake",
"account_locator": "ab12345",
"account_name": "acme",
"organization_name": "acmeorg",
"region": {
"type": "region_aws",
"id": "us-west-2"
}
},
"status": "active",
"tags": [],
"updated_at": "2021-06-01T00:00:00Z",
"collaborators": {
"participants": {
"type": "all"
},
"manage_compute_pools": {
"type": "all"
}
},
"compute_pools": []
},
"display_name": "Declared Age",
"is_narrative_managed": true,
"description": "Mobile identifiers tied to birth information provided as part of app registration.",
"name": "Declared Age",
"retention_policy": {
"policies": [
{
"type": {
"kind": "snapshot_ttl",
"snapshot_retention_policy": {
"type": "retain_everything"
}
},
"enabled": true
}
]
},
"schema": {
"file_config": {
"type": "flat",
"delimiter": ",",
"escape": "\"",
"header": true,
"quote": "\""
},
"type": "object",
"properties": {
"idValue": {
"display_name": "Id Value",
"order": 0,
"approximate_cardinality": 100000,
"description": "ID values",
"type": "string"
},
"idType": {
"display_name": "Id Type",
"order": 1,
"approximate_cardinality": 1,
"type": "string",
"enum": [
"md5_email",
"sha256_email"
]
},
"eventTimestamp": {
"display_name": "Event TS",
"order": 2,
"description": "When the observation was collected",
"type": "timestamptz",
"validations": [
"eventTimestamp < current_timestamp()"
]
},
"countryCode": {
"display_name": "countryCode",
"order": 3,
"approximate_cardinality": 6,
"description": "The country of residence of the individual",
"type": "string"
},
"age": {
"display_name": "Age",
"order": 4,
"approximate_cardinality": 90,
"description": "How old this individual is in years",
"type": "long"
},
"birthInfo": {
"display_name": "birth info",
"order": 5,
"description": "The year this individual was born",
"type": "double"
}
},
"required": [
"idValue",
"idType",
"eventTimestamp",
"countryCode",
"age"
],
"primary": "/age"
},
"status": "active",
"tags": [
"age",
"demo",
"demographic",
"demographics"
],
"updated_at": "2021-06-24T00:54:40.029056Z",
"write_mode": "append",
"subscription_id": "123e4567-e89b-12d3-a456-426614174000"
}
]
}Get datasets
Return the active and pending datasets belonging to the authenticated company, one page at a time.
Without page and per_page every dataset comes back in a single page. With either one the list is
paged, per_page defaulting to 100.
A data_plane_id, page or per_page value that does not parse makes the request answer 404 with no
body rather than 400. A tag value that is not a valid tag is not an error: the request is served as if
no tag had been sent at all.
curl --request GET \
--url https://api-dev.narrative.io/datasets \
--header 'Authorization: Bearer <token>'import requests
url = "https://api-dev.narrative.io/datasets"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api-dev.narrative.io/datasets', 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://api-dev.narrative.io/datasets",
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: Bearer <token>"
],
]);
$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://api-dev.narrative.io/datasets"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api-dev.narrative.io/datasets")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-dev.narrative.io/datasets")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"prev_page": null,
"current_page": 1,
"next_page": null,
"total_records": 1,
"total_pages": 1,
"records": [
{
"id": 18923,
"company_id": 382,
"created_at": "2021-06-24T00:54:40.029056Z",
"data_plane": {
"type": "owned",
"id": "c0bed5c2-8af8-4f7a-9787-1ffc3def339b",
"company_id": 382,
"created_at": "2021-06-01T00:00:00Z",
"description": "The company's Snowflake account",
"display_name": "Snowflake (us-west-2)",
"external_id": "snowflake-prod",
"is_narrative": false,
"platform": {
"type": "platform_snowflake",
"account_locator": "ab12345",
"account_name": "acme",
"organization_name": "acmeorg",
"region": {
"type": "region_aws",
"id": "us-west-2"
}
},
"status": "active",
"tags": [],
"updated_at": "2021-06-01T00:00:00Z",
"collaborators": {
"participants": {
"type": "all"
},
"manage_compute_pools": {
"type": "all"
}
},
"compute_pools": []
},
"display_name": "Declared Age",
"is_narrative_managed": true,
"description": "Mobile identifiers tied to birth information provided as part of app registration.",
"name": "Declared Age",
"retention_policy": {
"policies": [
{
"type": {
"kind": "snapshot_ttl",
"snapshot_retention_policy": {
"type": "retain_everything"
}
},
"enabled": true
}
]
},
"schema": {
"file_config": {
"type": "flat",
"delimiter": ",",
"escape": "\"",
"header": true,
"quote": "\""
},
"type": "object",
"properties": {
"idValue": {
"display_name": "Id Value",
"order": 0,
"approximate_cardinality": 100000,
"description": "ID values",
"type": "string"
},
"idType": {
"display_name": "Id Type",
"order": 1,
"approximate_cardinality": 1,
"type": "string",
"enum": [
"md5_email",
"sha256_email"
]
},
"eventTimestamp": {
"display_name": "Event TS",
"order": 2,
"description": "When the observation was collected",
"type": "timestamptz",
"validations": [
"eventTimestamp < current_timestamp()"
]
},
"countryCode": {
"display_name": "countryCode",
"order": 3,
"approximate_cardinality": 6,
"description": "The country of residence of the individual",
"type": "string"
},
"age": {
"display_name": "Age",
"order": 4,
"approximate_cardinality": 90,
"description": "How old this individual is in years",
"type": "long"
},
"birthInfo": {
"display_name": "birth info",
"order": 5,
"description": "The year this individual was born",
"type": "double"
}
},
"required": [
"idValue",
"idType",
"eventTimestamp",
"countryCode",
"age"
],
"primary": "/age"
},
"status": "active",
"tags": [
"age",
"demo",
"demographic",
"demographics"
],
"updated_at": "2021-06-24T00:54:40.029056Z",
"write_mode": "append",
"subscription_id": "123e4567-e89b-12d3-a456-426614174000"
}
]
}Authorizations
Query Parameters
Return only the dataset's mappings with one of these sources; the datasets themselves are not filtered.
Repeat the parameter to name several; omitted, every stored mapping is returned. Naming derived adds the
derived mappings the dataset's stored mappings imply, whatever their own source: each is computed on the
request by applying a derivation rule to a stored mapping, has no id because nothing is stored, and carries
a provenance saying how it was produced.
The source of the mapping.
company- Company private mappingadmin- Admin created/promoted mappingsystem- System (Automated/ML) mappingslineage- Lineage-derived mappings (editable without admin)rosetta_stone- Rosetta Stone mappings (editable without admin)derived- Computed on the request from a stored mapping and a derivation rule. Not stored, so it has noid; listed only when asked for by source
company, admin, system, lineage, rosetta_stone, derived Response
OK

