import requests
url = "https://api.diga.io/v1/knowledge/item/url"
payload = {
"items": [
{
"url": "<string>",
"name": "<string>"
}
],
"knowledge_base_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"successful_items": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"created_date": "2023-11-07T05:31:56Z",
"status": "indexing",
"url": "<string>",
"category": "url",
"size_bytes": 123,
"knowledge_base_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
],
"failed_items": [
{
"name": "<string>",
"error": "<string>"
}
]
}Index web URLs as knowledge items. Each URL is crawled, parsed, and indexed asynchronously.
import requests
url = "https://api.diga.io/v1/knowledge/item/url"
payload = {
"items": [
{
"url": "<string>",
"name": "<string>"
}
],
"knowledge_base_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"successful_items": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"created_date": "2023-11-07T05:31:56Z",
"status": "indexing",
"url": "<string>",
"category": "url",
"size_bytes": 123,
"knowledge_base_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
],
"failed_items": [
{
"name": "<string>",
"error": "<string>"
}
]
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.