Authentication

You need to authenticate every request to the NOTO API using your API Key (find out how to create an API key).

The API key should be passed in the Header of the request, using the key:api-key Here you can see a example in Bash:

# CHANGE ME
url="https://engine.noto.network/noto/api/v1/resolve?fullQualifiedDomain=example.tld"
# CHANGE ME
api_key="your_api_key"

curl -X GET -H "api-key: $api_key" $url

Here you can see additional examples in the following languages:

Node.js
const fetch = require('node-fetch');

// CHANGE ME
const url = 'https://engine.noto.network/noto/api/v1/resolve?fullQualifiedDomain=example.tld'; 
// CHANGE ME
const api_key = 'your_api_key';

async function fetchData(url, api_key) {
    try {
        const response = await fetch(url, {
            method: 'GET',
            headers: { 'api-key': api_key }
        });
        if (!response.ok) throw new Error('Error: network response');
        const data = await response.json();
        console.log('Server response:', data);
    } catch (error) {
        console.error('Fetch error:', error);
    }
}

// CALL FUNCTION
fetchData();
Python
import requests

# CHANGE ME
url = "https://engine.noto.network/noto/api/v1/resolve?fullQualifiedDomain=example.tld"
# CHANGE ME
api_key = "your_api_key"

headers = {"api-key": api_key}

try:
    response = requests.get(url, headers=headers)
    response.raise_for_status()
    print(response.json())
except requests.exceptions.HTTPError as errh:
    print("An HTTP error occurred:", errh)
except requests.exceptions.RequestException as err:
    print("A Request error occurred:", err)
Go
package main

import (
    "fmt"
    "io/ioutil"
    "net/http"
)

func main() {
    // CHANGE ME
    url := "https://engine.noto.network/noto/api/v1/resolve?fullQualifiedDomain=example.tld"
    // CHANGE ME
    api_key := "your_api_key"

    client := &http.Client{}
    req, err := http.NewRequest("GET", url, nil)
    if err != nil {
        fmt.Println("Error creating request:", err)
        return
    }

    req.Header.Add("api-key", api_key)

    res, err := client.Do(req)
    if err != nil {
        fmt.Println("Error making request:", err)
        return
    }
    defer res.Body.Close()

    body, err := ioutil.ReadAll(res.Body)
    if err != nil {
        fmt.Println("Error reading response body:", err)
        return
    }

    fmt.Println("Server response:", string(body))
}
C#
Java

Last updated