Introduction
This documentation aims to provide all the information you need to work with our API.
<aside>As you scroll, you'll see code examples for working with the API in different programming languages in the dark area to the right (or as part of the content on mobile).
You can switch the language used with the tabs at the top right (or from the nav menu at the top left on mobile).</aside>
Authenticating requests
To authenticate requests, include an Authorization header with the value "Bearer {YOUR_API_KEY}".
All authenticated endpoints are marked with a requires authentication badge in the documentation below.
You can retrieve your api key by visiting your dashboard and clicking on api keys and Generate API key.
Endpoints
Get presigned url for bulk import
Obtain a presigned URL for uploading a zip file containing documents to be imported.
Example request:
curl --request GET \
--get "https://chatbot.logotel.cloud/api/v1/integration/bulk-importer/presigned-url" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://chatbot.logotel.cloud/api/v1/integration/bulk-importer/presigned-url"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200, success):
{
"url": "https://s3.amazonaws.com/bucketname/presigned-url",
"expiration": 200
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Import a file for bulk import
Unzip and import file previously uploaded to the presigned URL.
Example request:
curl --request POST \
"https://chatbot.logotel.cloud/api/v1/integration/bulk-importer/import" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://chatbot.logotel.cloud/api/v1/integration/bulk-importer/import"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());Example response (200, success):
{
"status": true
}
Example response (400):
{
"error": "error message"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Import texts
Import text in the database
Example request:
curl --request POST \
"https://chatbot.logotel.cloud/api/v1/integration/bulk-importer/import-texts" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"data\": [
{
\"identifier\": \"text-001\",
\"title\": \"Sample Text Title\",
\"link\": \"https:\\/\\/example.com\\/text-001\",
\"language\": \"it\",
\"content\": \"This is the content of the text...\",
\"permissions\": [
\"admin\",
\"editor\"
],
\"metadata\": {
\"author\": \"John Doe\",
\"category\": \"Tutorial\"
},
\"document_date\": \"2024-01-15\",
\"is_searchable\": true,
\"is_generative\": false
}
]
}"
const url = new URL(
"https://chatbot.logotel.cloud/api/v1/integration/bulk-importer/import-texts"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"data": [
{
"identifier": "text-001",
"title": "Sample Text Title",
"link": "https:\/\/example.com\/text-001",
"language": "it",
"content": "This is the content of the text...",
"permissions": [
"admin",
"editor"
],
"metadata": {
"author": "John Doe",
"category": "Tutorial"
},
"document_date": "2024-01-15",
"is_searchable": true,
"is_generative": false
}
]
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200, success):
{
"status": true
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete a document
Delete a document associated with the bot and its embeddings.
Example request:
curl --request POST \
"https://chatbot.logotel.cloud/api/v1/integration/bulk-importer/delete-document" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"identifier\": \"text-001\"
}"
const url = new URL(
"https://chatbot.logotel.cloud/api/v1/integration/bulk-importer/delete-document"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"identifier": "text-001"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200, success):
{
"status": true,
"message": "Document deleted successfully"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.