Introduction
This documentation aims to provide all the information you need to work with our API.
Authenticating requests
To authenticate requests, include an Authorization header with the value "Bearer {USER_SIGNED_JWT}".
All authenticated endpoints are marked with a requires authentication badge in the documentation below.
You can retrieve your token with the bot private key. More info here https://github.com/Logotel/logobot-php-integration.
Endpoints
GET api/health
requires authentication
Example request:
curl --request GET \
--get "https://api.chatbot.logotel.cloud/api/health" \
--header "Authorization: Bearer {USER_SIGNED_JWT}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"$client = new \GuzzleHttp\Client();
$url = 'https://api.chatbot.logotel.cloud/api/health';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {USER_SIGNED_JWT}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://api.chatbot.logotel.cloud/api/health"
);
const headers = {
"Authorization": "Bearer {USER_SIGNED_JWT}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());import requests
import json
url = 'https://api.chatbot.logotel.cloud/api/health'
headers = {
'Authorization': 'Bearer {USER_SIGNED_JWT}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"database": {
"status": true,
"description": "ok"
},
"cache": {
"status": true,
"description": "ok"
}
}
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.
Authenticate
requires authentication
Authenticate the user via jwt and return a key to be used instead of it
Example request:
curl --request POST \
"https://api.chatbot.logotel.cloud/api/v1/authenticate" \
--header "Authorization: Bearer {USER_SIGNED_JWT}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"jwt\": \"ea\"
}"
$client = new \GuzzleHttp\Client();
$url = 'https://api.chatbot.logotel.cloud/api/v1/authenticate';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {USER_SIGNED_JWT}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'jwt' => 'ea',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://api.chatbot.logotel.cloud/api/v1/authenticate"
);
const headers = {
"Authorization": "Bearer {USER_SIGNED_JWT}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"jwt": "ea"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());import requests
import json
url = 'https://api.chatbot.logotel.cloud/api/v1/authenticate'
payload = {
"jwt": "ea"
}
headers = {
'Authorization': 'Bearer {USER_SIGNED_JWT}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Example response (200, success):
{
"key": "somekey",
}
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.
Thread list
requires authentication
Obtain the threads list
Example request:
curl --request GET \
--get "https://api.chatbot.logotel.cloud/api/v1/threads" \
--header "Authorization: Bearer {USER_SIGNED_JWT}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"$client = new \GuzzleHttp\Client();
$url = 'https://api.chatbot.logotel.cloud/api/v1/threads';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {USER_SIGNED_JWT}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://api.chatbot.logotel.cloud/api/v1/threads"
);
const headers = {
"Authorization": "Bearer {USER_SIGNED_JWT}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());import requests
import json
url = 'https://api.chatbot.logotel.cloud/api/v1/threads'
headers = {
'Authorization': 'Bearer {USER_SIGNED_JWT}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200, success):
[
{
"uuid": "fdb07973-4955-40db-a8d1-d5b8547b4c9b",
"title": "the title of the thread",
"last_chat": {
"uuid": "dfrr67f7-s940-33dx-app9-ofpf7b4c9b",
"is_bot": true,
"order": 1,
"message": "This is a message",
"feedback": "positive",
"created_at": "10/10/2024 10:10:10",
"sources": [
"source1",
"source2",
]
}
}
]
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.
Create thread
requires authentication
Create a new thread with a first chat message
Example request:
curl --request POST \
"https://api.chatbot.logotel.cloud/api/v1/threads" \
--header "Authorization: Bearer {USER_SIGNED_JWT}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"question\": \"What\'s the meaning of life?\"
}"
$client = new \GuzzleHttp\Client();
$url = 'https://api.chatbot.logotel.cloud/api/v1/threads';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {USER_SIGNED_JWT}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'question' => 'What\'s the meaning of life?',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://api.chatbot.logotel.cloud/api/v1/threads"
);
const headers = {
"Authorization": "Bearer {USER_SIGNED_JWT}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"question": "What's the meaning of life?"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());import requests
import json
url = 'https://api.chatbot.logotel.cloud/api/v1/threads'
payload = {
"question": "What's the meaning of life?"
}
headers = {
'Authorization': 'Bearer {USER_SIGNED_JWT}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Example response (200, 202):
{
"uuid": "fdb07973-4955-40db-a8d1-d5b8547b4c9b",
"last_chat": {
"uuid": "fdb07973-4955-40db-a8d1-d5b8547b4c9b",
"is_bot": true,
"order": 1,
"message": "This is a message",
"feedback": "positive",
"created_at": "10/10/2024 10:10:10",
"sources": [
"source1",
"source2",
]
}
}
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.
Get documents
requires authentication
Obtain a list of document added to the bot
Example request:
curl --request GET \
--get "https://api.chatbot.logotel.cloud/api/v1/document?filter=nulla" \
--header "Authorization: Bearer {USER_SIGNED_JWT}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"$client = new \GuzzleHttp\Client();
$url = 'https://api.chatbot.logotel.cloud/api/v1/document';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {USER_SIGNED_JWT}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'filter' => 'nulla',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://api.chatbot.logotel.cloud/api/v1/document"
);
const params = {
"filter": "nulla",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {USER_SIGNED_JWT}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());import requests
import json
url = 'https://api.chatbot.logotel.cloud/api/v1/document'
params = {
'filter': 'nulla',
}
headers = {
'Authorization': 'Bearer {USER_SIGNED_JWT}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()Example response (200, success):
[
{
"uuid": "fdb07973-4955-40db-a8d1-d5b8547b4c9b",
"name": "a-file-name",
"icon": "file-word",
"created_at": "10/10/2024 10:10:10",
},
{
"uuid": "fjsdfj43-4944-4jg5-mmf4-52fr34j3j4f",
"name": "another-file-name",
"icon": "file-pdf",
"created_at": "10/10/2024 11:11:11",
},
]
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.
Settings
requires authentication
Get the bot settings
Example request:
curl --request GET \
--get "https://api.chatbot.logotel.cloud/api/v1/settings" \
--header "Authorization: Bearer {USER_SIGNED_JWT}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"$client = new \GuzzleHttp\Client();
$url = 'https://api.chatbot.logotel.cloud/api/v1/settings';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {USER_SIGNED_JWT}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://api.chatbot.logotel.cloud/api/v1/settings"
);
const headers = {
"Authorization": "Bearer {USER_SIGNED_JWT}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());import requests
import json
url = 'https://api.chatbot.logotel.cloud/api/v1/settings'
headers = {
'Authorization': 'Bearer {USER_SIGNED_JWT}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200, success):
{
"disclaimer": "this is a disclaimer sentence",
}
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.
Speech to text
requires authentication
Obtain the audio file and convert it to text.
Example request:
curl --request POST \
"https://api.chatbot.logotel.cloud/api/v1/speech-to-text" \
--header "Authorization: Bearer {USER_SIGNED_JWT}" \
--header "Content-Type: multipart/form-data" \
--header "Accept: application/json" \
--form "mimeType=et"\
--form "audio=@/tmp/phpIDFBML" $client = new \GuzzleHttp\Client();
$url = 'https://api.chatbot.logotel.cloud/api/v1/speech-to-text';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {USER_SIGNED_JWT}',
'Content-Type' => 'multipart/form-data',
'Accept' => 'application/json',
],
'multipart' => [
[
'name' => 'mimeType',
'contents' => 'et'
],
[
'name' => 'audio',
'contents' => fopen('/tmp/phpIDFBML', 'r')
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://api.chatbot.logotel.cloud/api/v1/speech-to-text"
);
const headers = {
"Authorization": "Bearer {USER_SIGNED_JWT}",
"Content-Type": "multipart/form-data",
"Accept": "application/json",
};
const body = new FormData();
body.append('mimeType', 'et');
body.append('audio', document.querySelector('input[name="audio"]').files[0]);
fetch(url, {
method: "POST",
headers,
body,
}).then(response => response.json());import requests
import json
url = 'https://api.chatbot.logotel.cloud/api/v1/speech-to-text'
files = {
'mimeType': (None, 'et'),
'audio': open('/tmp/phpIDFBML', 'rb')}
payload = {
"mimeType": "et"
}
headers = {
'Authorization': 'Bearer {USER_SIGNED_JWT}',
'Content-Type': 'multipart/form-data',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, files=files)
response.json()Example response (200, success):
{
"text": "transcribed text"
}
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.
Text to speech
requires authentication
Convert the text to an audio file.
Example request:
curl --request POST \
"https://api.chatbot.logotel.cloud/api/v1/text-to-speech" \
--header "Authorization: Bearer {USER_SIGNED_JWT}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"chat_id\": \"vqhnnzppqxcmia\"
}"
$client = new \GuzzleHttp\Client();
$url = 'https://api.chatbot.logotel.cloud/api/v1/text-to-speech';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {USER_SIGNED_JWT}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'chat_id' => 'vqhnnzppqxcmia',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://api.chatbot.logotel.cloud/api/v1/text-to-speech"
);
const headers = {
"Authorization": "Bearer {USER_SIGNED_JWT}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"chat_id": "vqhnnzppqxcmia"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());import requests
import json
url = 'https://api.chatbot.logotel.cloud/api/v1/text-to-speech'
payload = {
"chat_id": "vqhnnzppqxcmia"
}
headers = {
'Authorization': 'Bearer {USER_SIGNED_JWT}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()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.
Realtime get token
requires authentication
Get the realtime token object
Example request:
curl --request GET \
--get "https://api.chatbot.logotel.cloud/api/v1/realtime/token" \
--header "Authorization: Bearer {USER_SIGNED_JWT}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"$client = new \GuzzleHttp\Client();
$url = 'https://api.chatbot.logotel.cloud/api/v1/realtime/token';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {USER_SIGNED_JWT}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://api.chatbot.logotel.cloud/api/v1/realtime/token"
);
const headers = {
"Authorization": "Bearer {USER_SIGNED_JWT}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());import requests
import json
url = 'https://api.chatbot.logotel.cloud/api/v1/realtime/token'
headers = {
'Authorization': 'Bearer {USER_SIGNED_JWT}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200, success):
{
"token": "12345678909876543212345678901234567890",
"expires_at": 1744019087,
}
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.
Rag question
requires authentication
Retrieve information from the bot knowledge base
Example request:
curl --request POST \
"https://api.chatbot.logotel.cloud/api/v1/realtime/rag" \
--header "Authorization: Bearer {USER_SIGNED_JWT}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"question\": \"ebqbiowsbfipklyknpn\"
}"
$client = new \GuzzleHttp\Client();
$url = 'https://api.chatbot.logotel.cloud/api/v1/realtime/rag';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {USER_SIGNED_JWT}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'question' => 'ebqbiowsbfipklyknpn',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://api.chatbot.logotel.cloud/api/v1/realtime/rag"
);
const headers = {
"Authorization": "Bearer {USER_SIGNED_JWT}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"question": "ebqbiowsbfipklyknpn"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());import requests
import json
url = 'https://api.chatbot.logotel.cloud/api/v1/realtime/rag'
payload = {
"question": "ebqbiowsbfipklyknpn"
}
headers = {
'Authorization': 'Bearer {USER_SIGNED_JWT}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Example response (200, success):
{
"context": [
"this is the context of the question",
"this is the context of the question",
"this is the context of the question"
],
"links": [
{
"filename": "file1.pdf",
"link": "https://example.com/file1.pdf"
},
{
"filename": "file2.pdf",
"link": "https://example.com/file2.pdf"
}
],
}
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 thread
requires authentication
Delete a thread
Example request:
curl --request DELETE \
"https://api.chatbot.logotel.cloud/api/v1/threads/2b65fd1e-038e-3397-ab20-7a82ecb92274" \
--header "Authorization: Bearer {USER_SIGNED_JWT}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"$client = new \GuzzleHttp\Client();
$url = 'https://api.chatbot.logotel.cloud/api/v1/threads/2b65fd1e-038e-3397-ab20-7a82ecb92274';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {USER_SIGNED_JWT}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://api.chatbot.logotel.cloud/api/v1/threads/2b65fd1e-038e-3397-ab20-7a82ecb92274"
);
const headers = {
"Authorization": "Bearer {USER_SIGNED_JWT}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());import requests
import json
url = 'https://api.chatbot.logotel.cloud/api/v1/threads/2b65fd1e-038e-3397-ab20-7a82ecb92274'
headers = {
'Authorization': 'Bearer {USER_SIGNED_JWT}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('DELETE', url, headers=headers)
response.json()Example response (204):
Empty response
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.
Chat messages
requires authentication
Obtain the chat messages list in the thread
Example request:
curl --request GET \
--get "https://api.chatbot.logotel.cloud/api/v1/threads/4d113338-5ce6-323c-a727-920765d5fb77/chats" \
--header "Authorization: Bearer {USER_SIGNED_JWT}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"$client = new \GuzzleHttp\Client();
$url = 'https://api.chatbot.logotel.cloud/api/v1/threads/4d113338-5ce6-323c-a727-920765d5fb77/chats';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {USER_SIGNED_JWT}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://api.chatbot.logotel.cloud/api/v1/threads/4d113338-5ce6-323c-a727-920765d5fb77/chats"
);
const headers = {
"Authorization": "Bearer {USER_SIGNED_JWT}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());import requests
import json
url = 'https://api.chatbot.logotel.cloud/api/v1/threads/4d113338-5ce6-323c-a727-920765d5fb77/chats'
headers = {
'Authorization': 'Bearer {USER_SIGNED_JWT}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200, success):
[
{
"uuid": "fdb07973-4955-40db-a8d1-d5b8547b4c9b",
"is_bot": true,
"order": 1,
"message": "This is a message",
"feedback": "positive",
"created_at": "10/10/2024 10:10:10",
"sources": [
"source1",
"source2",
]
},
]
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.
Create chat message
requires authentication
Create a chat message in the thread
Example request:
curl --request POST \
"https://api.chatbot.logotel.cloud/api/v1/threads/acde87cc-9f35-31f5-b27b-81c66e3227d1/chats" \
--header "Authorization: Bearer {USER_SIGNED_JWT}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"question\": \"What\'s the meaning of life?\"
}"
$client = new \GuzzleHttp\Client();
$url = 'https://api.chatbot.logotel.cloud/api/v1/threads/acde87cc-9f35-31f5-b27b-81c66e3227d1/chats';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {USER_SIGNED_JWT}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'question' => 'What\'s the meaning of life?',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://api.chatbot.logotel.cloud/api/v1/threads/acde87cc-9f35-31f5-b27b-81c66e3227d1/chats"
);
const headers = {
"Authorization": "Bearer {USER_SIGNED_JWT}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"question": "What's the meaning of life?"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());import requests
import json
url = 'https://api.chatbot.logotel.cloud/api/v1/threads/acde87cc-9f35-31f5-b27b-81c66e3227d1/chats'
payload = {
"question": "What's the meaning of life?"
}
headers = {
'Authorization': 'Bearer {USER_SIGNED_JWT}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Example response (200, 202):
{
"uuid": "fdb07973-4955-40db-a8d1-d5b8547b4c9b",
"is_bot": false,
"order": 1,
"message": "This is a message",
"feedback": "",
"created_at": "10/10/2024 10:10:10",
"sources": []
}
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.
Check if AI reply
requires authentication
Check if the AI reply is ready and if is so, return the message
Example request:
curl --request GET \
--get "https://api.chatbot.logotel.cloud/api/v1/threads/6ddadcf2-685e-3d89-ab04-aa34a9ef351b/chats/pending" \
--header "Authorization: Bearer {USER_SIGNED_JWT}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"$client = new \GuzzleHttp\Client();
$url = 'https://api.chatbot.logotel.cloud/api/v1/threads/6ddadcf2-685e-3d89-ab04-aa34a9ef351b/chats/pending';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {USER_SIGNED_JWT}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://api.chatbot.logotel.cloud/api/v1/threads/6ddadcf2-685e-3d89-ab04-aa34a9ef351b/chats/pending"
);
const headers = {
"Authorization": "Bearer {USER_SIGNED_JWT}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());import requests
import json
url = 'https://api.chatbot.logotel.cloud/api/v1/threads/6ddadcf2-685e-3d89-ab04-aa34a9ef351b/chats/pending'
headers = {
'Authorization': 'Bearer {USER_SIGNED_JWT}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200, chat found but pending):
{
"status": "pending",
}
Example response (200, chat found and ready):
{
"status": "ok",
"data": {
"uuid": "fdb07973-4955-40db-a8d1-d5b8547b4c9b",
"is_bot": false,
"order": 1,
"message": "This is a message",
"feedback": "",
"created_at": "10/10/2024 10:10:10",
"sources": [
"source1",
"source2",
]
}
}
Example response (204, chat not found):
Empty response
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.
Feedback
requires authentication
Add feedback to the chat
Example request:
curl --request PUT \
"https://api.chatbot.logotel.cloud/api/v1/threads/575ed74c-f09f-3480-8f02-d73df6fa8aeb/chats/3aa1d93b-2c4e-3dd2-81d7-f0c1a307e6ad" \
--header "Authorization: Bearer {USER_SIGNED_JWT}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"feedback\": \"positive\"
}"
$client = new \GuzzleHttp\Client();
$url = 'https://api.chatbot.logotel.cloud/api/v1/threads/575ed74c-f09f-3480-8f02-d73df6fa8aeb/chats/3aa1d93b-2c4e-3dd2-81d7-f0c1a307e6ad';
$response = $client->put(
$url,
[
'headers' => [
'Authorization' => 'Bearer {USER_SIGNED_JWT}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'feedback' => 'positive',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://api.chatbot.logotel.cloud/api/v1/threads/575ed74c-f09f-3480-8f02-d73df6fa8aeb/chats/3aa1d93b-2c4e-3dd2-81d7-f0c1a307e6ad"
);
const headers = {
"Authorization": "Bearer {USER_SIGNED_JWT}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"feedback": "positive"
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());import requests
import json
url = 'https://api.chatbot.logotel.cloud/api/v1/threads/575ed74c-f09f-3480-8f02-d73df6fa8aeb/chats/3aa1d93b-2c4e-3dd2-81d7-f0c1a307e6ad'
payload = {
"feedback": "positive"
}
headers = {
'Authorization': 'Bearer {USER_SIGNED_JWT}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('PUT', url, headers=headers, json=payload)
response.json()Example response (204):
Empty response
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.
AI Search Engine
requires authentication
Search the query in the documents by similarity using vector search.
Example request:
curl --request POST \
"https://api.chatbot.logotel.cloud/api/v1/search-engine/documents" \
--header "Authorization: Bearer {USER_SIGNED_JWT}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"question\": \"What\'s the meaning of life?\",
\"limit\": 10,
\"filter\": {
\"0\": {
\"date_from\": \"2020-01-01\"
},
\"date_from\": \"2025-04-07\"
}
}"
$client = new \GuzzleHttp\Client();
$url = 'https://api.chatbot.logotel.cloud/api/v1/search-engine/documents';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {USER_SIGNED_JWT}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'question' => 'What\'s the meaning of life?',
'limit' => 10,
'filter' => [
[
'date_from' => '2020-01-01',
],
'date_from' => '2025-04-07',
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://api.chatbot.logotel.cloud/api/v1/search-engine/documents"
);
const headers = {
"Authorization": "Bearer {USER_SIGNED_JWT}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"question": "What's the meaning of life?",
"limit": 10,
"filter": {
"0": {
"date_from": "2020-01-01"
},
"date_from": "2025-04-07"
}
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());import requests
import json
url = 'https://api.chatbot.logotel.cloud/api/v1/search-engine/documents'
payload = {
"question": "What's the meaning of life?",
"limit": 10,
"filter": {
"0": {
"date_from": "2020-01-01"
},
"date_from": "2025-04-07"
}
}
headers = {
'Authorization': 'Bearer {USER_SIGNED_JWT}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Example response (200, success):
[
{
"uuid": "fdb07973-4955-40db-a8d1-d5b8547b4c9b",
"name": "my document",
"icon": "file-pdf",
"distance": 0.953548767,
"ratings": {
"distance": "0.8100819089838152",
"time_rating": "0.18356164383561646",
"document_rating": "0.3333333333333333",
"title_rating": "0,6666666666666666"
},
"link": "https://example.com/something.pdf",
"metadata": {
"key": "value",
"key2": "value2"
},
"created_at": "10/10/2024 10:10:10"
},
]
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.