curl --request POST \
--url https://api.wotnot.io/v1/ai/knowledge-base/{knowledge_base_id}/data-sources/domain \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"type": "domain",
"url": "https://wotnot.io",
"exclude_urls": "",
"refresh_frequency": null
}
'import requests
url = "https://api.wotnot.io/v1/ai/knowledge-base/{knowledge_base_id}/data-sources/domain"
payload = {
"type": "domain",
"url": "https://wotnot.io",
"exclude_urls": "",
"refresh_frequency": None
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
type: 'domain',
url: 'https://wotnot.io',
exclude_urls: '',
refresh_frequency: null
})
};
fetch('https://api.wotnot.io/v1/ai/knowledge-base/{knowledge_base_id}/data-sources/domain', 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.wotnot.io/v1/ai/knowledge-base/{knowledge_base_id}/data-sources/domain",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'type' => 'domain',
'url' => 'https://wotnot.io',
'exclude_urls' => '',
'refresh_frequency' => null
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.wotnot.io/v1/ai/knowledge-base/{knowledge_base_id}/data-sources/domain"
payload := strings.NewReader("{\n \"type\": \"domain\",\n \"url\": \"https://wotnot.io\",\n \"exclude_urls\": \"\",\n \"refresh_frequency\": null\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.wotnot.io/v1/ai/knowledge-base/{knowledge_base_id}/data-sources/domain")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"domain\",\n \"url\": \"https://wotnot.io\",\n \"exclude_urls\": \"\",\n \"refresh_frequency\": null\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wotnot.io/v1/ai/knowledge-base/{knowledge_base_id}/data-sources/domain")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"domain\",\n \"url\": \"https://wotnot.io\",\n \"exclude_urls\": \"\",\n \"refresh_frequency\": null\n}"
response = http.request(request)
puts response.read_body{
"ok": true,
"domain_id": 8,
"request_id": "3QWuobWJE3jF065037422196qAdTZ2Ct"
}Add domain data source
Adds a website domain, such as https://wotnot.io, to an existing knowledge base as a data source. To add specific pages instead, use Add URL data sources.
curl --request POST \
--url https://api.wotnot.io/v1/ai/knowledge-base/{knowledge_base_id}/data-sources/domain \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"type": "domain",
"url": "https://wotnot.io",
"exclude_urls": "",
"refresh_frequency": null
}
'import requests
url = "https://api.wotnot.io/v1/ai/knowledge-base/{knowledge_base_id}/data-sources/domain"
payload = {
"type": "domain",
"url": "https://wotnot.io",
"exclude_urls": "",
"refresh_frequency": None
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
type: 'domain',
url: 'https://wotnot.io',
exclude_urls: '',
refresh_frequency: null
})
};
fetch('https://api.wotnot.io/v1/ai/knowledge-base/{knowledge_base_id}/data-sources/domain', 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.wotnot.io/v1/ai/knowledge-base/{knowledge_base_id}/data-sources/domain",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'type' => 'domain',
'url' => 'https://wotnot.io',
'exclude_urls' => '',
'refresh_frequency' => null
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.wotnot.io/v1/ai/knowledge-base/{knowledge_base_id}/data-sources/domain"
payload := strings.NewReader("{\n \"type\": \"domain\",\n \"url\": \"https://wotnot.io\",\n \"exclude_urls\": \"\",\n \"refresh_frequency\": null\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.wotnot.io/v1/ai/knowledge-base/{knowledge_base_id}/data-sources/domain")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"domain\",\n \"url\": \"https://wotnot.io\",\n \"exclude_urls\": \"\",\n \"refresh_frequency\": null\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wotnot.io/v1/ai/knowledge-base/{knowledge_base_id}/data-sources/domain")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"domain\",\n \"url\": \"https://wotnot.io\",\n \"exclude_urls\": \"\",\n \"refresh_frequency\": null\n}"
response = http.request(request)
puts response.read_body{
"ok": true,
"domain_id": 8,
"request_id": "3QWuobWJE3jF065037422196qAdTZ2Ct"
}Authorizations
All of WotNot's APIs use Bearer token authentication. Send your account token as Bearer <token>. You can find it in Settings > Account Settings > Developer. Keep it on your server: anyone who has it can call the API as your account.
Path Parameters
The ID of the knowledge base to add the domain to.
Body
The domain to add and how to handle it.
The kind of data source. Set it to domain.
"domain"
The website to add. It must be a valid web address, for example https://wotnot.io.
"https://wotnot.io"
Pages on the domain to leave out. The example sends an empty value ("").
""
How often the data source is refreshed. The example sends null.
null
Response
Returns ok set to true with a domain_id and a request_id.
Was this page helpful?