List data sources
curl --request GET \
--url https://api.chatling.ai/v2/chatbots/{chatbotId}/knowledge-base/data-sources \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.chatling.ai/v2/chatbots/{chatbotId}/knowledge-base/data-sources"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.chatling.ai/v2/chatbots/{chatbotId}/knowledge-base/data-sources', 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.chatling.ai/v2/chatbots/{chatbotId}/knowledge-base/data-sources",
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.chatling.ai/v2/chatbots/{chatbotId}/knowledge-base/data-sources"
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.chatling.ai/v2/chatbots/{chatbotId}/knowledge-base/data-sources")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.chatling.ai/v2/chatbots/{chatbotId}/knowledge-base/data-sources")
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{
{
"status": "success",
"data": {
"pages": {
"current_page": 1,
"last_page": 3,
"per_page": 25
},
"sources": [
{
"id": "321e979b-a174-89fc-25de-f0b31dbd659f",
"type": "link",
"status": "processed",
"characters": 6232,
"resync_queued": false,
"data": {
"url": "https://chatling.ai",
"page_title": "No-Code AI Chatbot for Your Website | Chatling"
},
"created_at": "2024-06-15T12:23:41"
},
]
}
}
Knowledge base
List data sources
Get a list of the data sources added to the knowledge base.
GET
/
chatbots
/
{chatbotId}
/
knowledge-base
/
data-sources
List data sources
curl --request GET \
--url https://api.chatling.ai/v2/chatbots/{chatbotId}/knowledge-base/data-sources \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.chatling.ai/v2/chatbots/{chatbotId}/knowledge-base/data-sources"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.chatling.ai/v2/chatbots/{chatbotId}/knowledge-base/data-sources', 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.chatling.ai/v2/chatbots/{chatbotId}/knowledge-base/data-sources",
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.chatling.ai/v2/chatbots/{chatbotId}/knowledge-base/data-sources"
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.chatling.ai/v2/chatbots/{chatbotId}/knowledge-base/data-sources")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.chatling.ai/v2/chatbots/{chatbotId}/knowledge-base/data-sources")
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{
{
"status": "success",
"data": {
"pages": {
"current_page": 1,
"last_page": 3,
"per_page": 25
},
"sources": [
{
"id": "321e979b-a174-89fc-25de-f0b31dbd659f",
"type": "link",
"status": "processed",
"characters": 6232,
"resync_queued": false,
"data": {
"url": "https://chatling.ai",
"page_title": "No-Code AI Chatbot for Your Website | Chatling"
},
"created_at": "2024-06-15T12:23:41"
},
]
}
}
Request parameters
Path
string
required
The chatbot ID.
Query
integer
default:"1"
The page number for pagination.
string
default:"date_desc"
The sort order. Possible values:
date_desc: Sort by date in descending order.date_asc: Sort by date in ascending order.
string
Filter by the type of the data source. Possible values are
link, text, faq, document, and zoho.Leave blank to get all types of data sources.Response
string
The status of the request. Will be
success if the request was successful, otherwise error.object
Show properties
Show properties
object
array
Show properties
Show properties
string
The unique identifier of the data source.
string
The type of the data source.
string
The processing status of the data source. Possible values are
pending, processing, processed, error.integer
The number of characters used by the data source.
boolean
Whether the data source is queued for resync.
object
Additional data based on the type of the data source.
string
The date and time when the data source was created.
{
{
"status": "success",
"data": {
"pages": {
"current_page": 1,
"last_page": 3,
"per_page": 25
},
"sources": [
{
"id": "321e979b-a174-89fc-25de-f0b31dbd659f",
"type": "link",
"status": "processed",
"characters": 6232,
"resync_queued": false,
"data": {
"url": "https://chatling.ai",
"page_title": "No-Code AI Chatbot for Your Website | Chatling"
},
"created_at": "2024-06-15T12:23:41"
},
]
}
}
⌘I

