Get mappings
curl --request GET \
--url https://api-dev.narrative.io/mappings \
--header 'Authorization: Bearer <token>'import requests
url = "https://api-dev.narrative.io/mappings"
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/mappings', 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/mappings",
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/mappings"
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/mappings")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-dev.narrative.io/mappings")
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": "ea9dddd2-e3ee-40b5-b03e-c3cd37c8a7f0",
"attribute_id": 1,
"created_at": "2021-12-10T00:00:00Z",
"dataset_id": 3,
"mapping": {
"type": "object_mapping",
"property_mappings": [
{
"path": "foo",
"expression": "upper(`US Kennel ID`)",
"dependencies": {
"properties": [
"US Kennel ID"
]
}
},
{
"path": "bar.baz.qux",
"expression": "weight * 10000",
"dependencies": {
"properties": [
"weight"
]
}
}
]
},
"status": "active",
"updated_at": "2021-12-10T00:00:01Z",
"created_by": 1,
"updated_by": 1,
"company_id": 100,
"scope": "global",
"source": "admin",
"derived_from": "ea9dddd2-e3ee-40b5-b03e-c3cd37c8a6f0"
},
{
"id": "ea9dddd2-e3ee-40b5-b03e-c3cd37c8a6f0",
"attribute_id": 1,
"created_at": "2021-12-10T00:00:00Z",
"dataset_id": 3,
"mapping": {
"type": "value_mapping",
"expression": "foo bar baz",
"dependencies": {
"properties": []
}
},
"status": "archived",
"updated_at": "2021-12-10T00:00:01Z",
"created_by": 1,
"updated_by": 2,
"company_id": 100,
"scope": "global",
"source": "admin",
"derived_from": null
}
]
}Mappings
Get mappings
Return the mappings owned by the caller’s company. Optionally filter by attribute and/or dataset.
GET
/
mappings
Get mappings
curl --request GET \
--url https://api-dev.narrative.io/mappings \
--header 'Authorization: Bearer <token>'import requests
url = "https://api-dev.narrative.io/mappings"
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/mappings', 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/mappings",
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/mappings"
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/mappings")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-dev.narrative.io/mappings")
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": "ea9dddd2-e3ee-40b5-b03e-c3cd37c8a7f0",
"attribute_id": 1,
"created_at": "2021-12-10T00:00:00Z",
"dataset_id": 3,
"mapping": {
"type": "object_mapping",
"property_mappings": [
{
"path": "foo",
"expression": "upper(`US Kennel ID`)",
"dependencies": {
"properties": [
"US Kennel ID"
]
}
},
{
"path": "bar.baz.qux",
"expression": "weight * 10000",
"dependencies": {
"properties": [
"weight"
]
}
}
]
},
"status": "active",
"updated_at": "2021-12-10T00:00:01Z",
"created_by": 1,
"updated_by": 1,
"company_id": 100,
"scope": "global",
"source": "admin",
"derived_from": "ea9dddd2-e3ee-40b5-b03e-c3cd37c8a6f0"
},
{
"id": "ea9dddd2-e3ee-40b5-b03e-c3cd37c8a6f0",
"attribute_id": 1,
"created_at": "2021-12-10T00:00:00Z",
"dataset_id": 3,
"mapping": {
"type": "value_mapping",
"expression": "foo bar baz",
"dependencies": {
"properties": []
}
},
"status": "archived",
"updated_at": "2021-12-10T00:00:01Z",
"created_by": 1,
"updated_by": 2,
"company_id": 100,
"scope": "global",
"source": "admin",
"derived_from": null
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
Attribute identifier. Can be specified multiple times to retrieve mappings for multiple attributes.
Dataset identifier. Can be specified multiple times to retrieve mappings for multiple datasets.
Response
200 - application/json
OK
Show child attributes
Show child attributes
Was this page helpful?
⌘I

