curl --request GET \
--url https://api-dev.narrative.io/nql/name-availability \
--header 'Authorization: Bearer <token>'import requests
url = "https://api-dev.narrative.io/nql/name-availability"
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/nql/name-availability', 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/nql/name-availability",
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/nql/name-availability"
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/nql/name-availability")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-dev.narrative.io/nql/name-availability")
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{
"name": "monthly_purchases",
"available": false,
"reserved_by": "dataset"
}{
"error": "<string>",
"error_description": "<string>"
}{
"error": "<string>",
"error_description": "<string>"
}{
"error": "<string>",
"error_description": "<string>"
}Check Name Availability
Reports whether a name is free to use for a dataset, view, or access rule in your company.
Datasets, views, and access rules draw their names from one namespace per company, so a name taken by any of the
three is unavailable to the other two. When a name is taken, the response says which kind of object holds it, but
never which object. The kind is reported only when the token can read every kind of holder (read access to both
datasets and views); otherwise the name is reported as unavailable with no holder, whatever kind holds it, so
the endpoint cannot be used to discover objects the token cannot otherwise read.
Matching is case-insensitive: Monthly_Purchases and monthly_purchases are the same name.
Availability is not a reservation. A name reported as available can be taken by someone else before you use it, so treat the answer as a pre-flight check rather than a guarantee.
Requires read access to datasets, and a token issued to a company.
curl --request GET \
--url https://api-dev.narrative.io/nql/name-availability \
--header 'Authorization: Bearer <token>'import requests
url = "https://api-dev.narrative.io/nql/name-availability"
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/nql/name-availability', 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/nql/name-availability",
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/nql/name-availability"
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/nql/name-availability")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-dev.narrative.io/nql/name-availability")
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{
"name": "monthly_purchases",
"available": false,
"reserved_by": "dataset"
}{
"error": "<string>",
"error_description": "<string>"
}{
"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.
Query Parameters
The name to check. Matching is case-insensitive.
256^[a-zA-Z0-9_]+$"monthly_purchases"
Response
CheckNameAvailability 200 response
The name that was checked, as supplied by the caller.
256^[a-zA-Z0-9_]+$"monthly_purchases"
Whether the name is free to use for a new dataset, view, or access rule.
false
Present when available is false and the token has read access to every kind of object that can hold a
name (datasets and views). A token missing one of those permissions never receives reserved_by, whatever
kind holds the name, so the field's absence reveals nothing about the holder. It identifies the kind of
object, never the object itself.
dataset, view, access_rule 
