Returns all available schema presets.
curl --request GET \
--url https://api-dev.narrative.io/schema-presets \
--header 'Authorization: Bearer <token>'import requests
url = "https://api-dev.narrative.io/schema-presets"
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/schema-presets', 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/schema-presets",
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/schema-presets"
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/schema-presets")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-dev.narrative.io/schema-presets")
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{
"records": [
{
"id": 19,
"company_id": 1,
"created_at": "2021-09-29T15:20:56.44361",
"archived_at": null,
"name": "Age",
"description": "A person's age gathered from registrations and surveys.",
"scope": "public",
"based_on_preset_id": null,
"status": "active",
"icon": "http://icon.com/age.png",
"display_color": "#FFFFFF",
"banner_image": "http://banner.com/age.png",
"tags": [
"age"
],
"details": {
"attributes": [
{
"attribute_id": 1,
"fields": [
{
"field": "age",
"delivered": true,
"filterable": true,
"required": true,
"forecastable": false
}
]
}
]
}
}
]
}{
"error": "<string>",
"error_description": "<string>"
}{
"error": "<string>",
"error_description": "<string>"
}Schema Presets
Returns all available schema presets.
List the schema presets that are publicly available and the ones owned by the authenticated account.
GET
/
schema-presets
Returns all available schema presets.
curl --request GET \
--url https://api-dev.narrative.io/schema-presets \
--header 'Authorization: Bearer <token>'import requests
url = "https://api-dev.narrative.io/schema-presets"
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/schema-presets', 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/schema-presets",
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/schema-presets"
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/schema-presets")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-dev.narrative.io/schema-presets")
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{
"records": [
{
"id": 19,
"company_id": 1,
"created_at": "2021-09-29T15:20:56.44361",
"archived_at": null,
"name": "Age",
"description": "A person's age gathered from registrations and surveys.",
"scope": "public",
"based_on_preset_id": null,
"status": "active",
"icon": "http://icon.com/age.png",
"display_color": "#FFFFFF",
"banner_image": "http://banner.com/age.png",
"tags": [
"age"
],
"details": {
"attributes": [
{
"attribute_id": 1,
"fields": [
{
"field": "age",
"delivered": true,
"filterable": true,
"required": true,
"forecastable": false
}
]
}
]
}
}
]
}{
"error": "<string>",
"error_description": "<string>"
}{
"error": "<string>",
"error_description": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Response
Returns all the schema presets available to the authenticated account or an empty list if no schema preset is available.
Show child attributes
Show child attributes
Was this page helpful?
⌘I

