Get attributes
curl --request GET \
--url https://api-dev.narrative.io/attributesimport requests
url = "https://api-dev.narrative.io/attributes"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api-dev.narrative.io/attributes', 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/attributes",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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/attributes"
req, _ := http.NewRequest("GET", url, nil)
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/attributes")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-dev.narrative.io/attributes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"records": [
{
"id": 123456789,
"name": "price",
"description": "The price of an order, product, or a price component. Currency field accepts ISO 4217 currency codes",
"display_name": "Price",
"type": "object",
"properties": {
"value": {
"type": "double",
"validations": [
"$this.value >= 0.0"
]
},
"iso_4217_currency": {
"type": "string",
"enum": [
"USD",
"GBP",
"JPY"
]
},
"tags": {
"type": "array",
"items": {
"type": "string"
}
}
},
"tags": [
"ecommerce",
"transaction"
],
"required": [
"value",
"iso_4217_currency"
]
}
]
}Attributes
Get attributes
Return all attributes.
GET
/
attributes
Get attributes
curl --request GET \
--url https://api-dev.narrative.io/attributesimport requests
url = "https://api-dev.narrative.io/attributes"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api-dev.narrative.io/attributes', 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/attributes",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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/attributes"
req, _ := http.NewRequest("GET", url, nil)
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/attributes")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-dev.narrative.io/attributes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"records": [
{
"id": 123456789,
"name": "price",
"description": "The price of an order, product, or a price component. Currency field accepts ISO 4217 currency codes",
"display_name": "Price",
"type": "object",
"properties": {
"value": {
"type": "double",
"validations": [
"$this.value >= 0.0"
]
},
"iso_4217_currency": {
"type": "string",
"enum": [
"USD",
"GBP",
"JPY"
]
},
"tags": {
"type": "array",
"items": {
"type": "string"
}
}
},
"tags": [
"ecommerce",
"transaction"
],
"required": [
"value",
"iso_4217_currency"
]
}
]
}Query Parameters
resolve attribute(s) which is true by default.
Free-text search term. When provided, attributes are ranked by their relevance to the search term.
Optional minimum relevance score, in the half-open interval (0, 1]. By default no threshold is
applied and all matches are returned, ranked by relevance. Supply min_score to restrict the
results to attributes scoring at or above the given value; below-threshold attributes are then
excluded from both the results and the total count. Can only be supplied together with q;
supplying it without q returns 400.
Required range:
x <= 1Response
200 - application/json
OK
The response is of type string.
Example:
{ "records": [ { "id": 123456789, "name": "price", "description": "The price of an order, product, or a price component. Currency field accepts ISO 4217 currency codes", "display_name": "Price", "type": "object", "properties": { "value": { "type": "double", "validations": ["$this.value >= 0.0"] }, "iso_4217_currency": { "type": "string", "enum": ["USD", "GBP", "JPY"] }, "tags": { "type": "array", "items": { "type": "string" } } }, "tags": ["ecommerce", "transaction"], "required": ["value", "iso_4217_currency"] } ] }
Was this page helpful?
⌘I

