Update Knowledge Base
curl --request PATCH \
--url https://v2.okchat.ai/api/external/chatbot/{chatbotId}/knowledge-base \
--header 'Content-Type: multipart/form-data' \
--form documentId=2043a479-0cca-4495-97cc-c4b490138f3d \
--form file='@example-file'import requests
url = "https://v2.okchat.ai/api/external/chatbot/{chatbotId}/knowledge-base"
files = { "file": ("example-file", open("example-file", "rb")) }
payload = { "documentId": "2043a479-0cca-4495-97cc-c4b490138f3d" }
response = requests.patch(url, data=payload, files=files)
print(response.text)const form = new FormData();
form.append('documentId', '2043a479-0cca-4495-97cc-c4b490138f3d');
form.append('file', '<string>');
const options = {method: 'PATCH'};
options.body = form;
fetch('https://v2.okchat.ai/api/external/chatbot/{chatbotId}/knowledge-base', 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://v2.okchat.ai/api/external/chatbot/{chatbotId}/knowledge-base",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"documentId\"\r\n\r\n2043a479-0cca-4495-97cc-c4b490138f3d\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Content-Type: multipart/form-data"
],
]);
$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://v2.okchat.ai/api/external/chatbot/{chatbotId}/knowledge-base"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"documentId\"\r\n\r\n2043a479-0cca-4495-97cc-c4b490138f3d\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("PATCH", url, payload)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://v2.okchat.ai/api/external/chatbot/{chatbotId}/knowledge-base")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"documentId\"\r\n\r\n2043a479-0cca-4495-97cc-c4b490138f3d\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://v2.okchat.ai/api/external/chatbot/{chatbotId}/knowledge-base")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"documentId\"\r\n\r\n2043a479-0cca-4495-97cc-c4b490138f3d\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"chatbot": {
"active": true,
"created_at": "2024-11-08T09:25:54.141252+00:00",
"description": "Demo AI Chatbot",
"id": "5afe16ed-5fd2-4552-a993-903bc9c32bb6",
"is_public": true,
"name": "Test",
"openai_api_key": null,
"organization_id": "123042b2-86e2-4184-a86e-95423d728815",
"personality_config": {
"style": "Test",
"tone": "Test"
},
"settings": {
"avatar": "https://alwiuiydhxcstgrluarg.supabase.co/storage/v1/object/public/chatbot/5afe16ed-5fd2-4552-a993-903bc9c32bb6/0aabc2ff-6aab-491b-8858-0d001acc167d.png",
"greeting": "Hello! How can I assist you today?",
"isRequestUserInfoEnabled": false,
"isToolEnabled": true,
"model": "gpt-4o",
"prompt": "You are a helpful and friendly customer support agent. Respond to user inquiries in a clear and concise manner. Always strive to provide accurate and helpful information.",
"snippet": {
"header": "오케이챗 고객응대 챗봇",
"logo": "https://dasomx.odoo.com/web/image/website/1/logo/DASOMX?unique=1aee356",
"name": "Test",
"primaryColor": "#9c2caa",
"secondaryColor": "#60d7a9",
"slogan": "Chat with us"
}
},
"slug": "test-1",
"updated_at": "2024-12-01T14:38:45.709025+00:00"
}
}API Reference
Update Knowledge Base
Update Knowledge Base
PATCH
/
api
/
external
/
chatbot
/
{chatbotId}
/
knowledge-base
Update Knowledge Base
curl --request PATCH \
--url https://v2.okchat.ai/api/external/chatbot/{chatbotId}/knowledge-base \
--header 'Content-Type: multipart/form-data' \
--form documentId=2043a479-0cca-4495-97cc-c4b490138f3d \
--form file='@example-file'import requests
url = "https://v2.okchat.ai/api/external/chatbot/{chatbotId}/knowledge-base"
files = { "file": ("example-file", open("example-file", "rb")) }
payload = { "documentId": "2043a479-0cca-4495-97cc-c4b490138f3d" }
response = requests.patch(url, data=payload, files=files)
print(response.text)const form = new FormData();
form.append('documentId', '2043a479-0cca-4495-97cc-c4b490138f3d');
form.append('file', '<string>');
const options = {method: 'PATCH'};
options.body = form;
fetch('https://v2.okchat.ai/api/external/chatbot/{chatbotId}/knowledge-base', 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://v2.okchat.ai/api/external/chatbot/{chatbotId}/knowledge-base",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"documentId\"\r\n\r\n2043a479-0cca-4495-97cc-c4b490138f3d\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Content-Type: multipart/form-data"
],
]);
$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://v2.okchat.ai/api/external/chatbot/{chatbotId}/knowledge-base"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"documentId\"\r\n\r\n2043a479-0cca-4495-97cc-c4b490138f3d\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("PATCH", url, payload)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://v2.okchat.ai/api/external/chatbot/{chatbotId}/knowledge-base")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"documentId\"\r\n\r\n2043a479-0cca-4495-97cc-c4b490138f3d\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://v2.okchat.ai/api/external/chatbot/{chatbotId}/knowledge-base")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"documentId\"\r\n\r\n2043a479-0cca-4495-97cc-c4b490138f3d\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"chatbot": {
"active": true,
"created_at": "2024-11-08T09:25:54.141252+00:00",
"description": "Demo AI Chatbot",
"id": "5afe16ed-5fd2-4552-a993-903bc9c32bb6",
"is_public": true,
"name": "Test",
"openai_api_key": null,
"organization_id": "123042b2-86e2-4184-a86e-95423d728815",
"personality_config": {
"style": "Test",
"tone": "Test"
},
"settings": {
"avatar": "https://alwiuiydhxcstgrluarg.supabase.co/storage/v1/object/public/chatbot/5afe16ed-5fd2-4552-a993-903bc9c32bb6/0aabc2ff-6aab-491b-8858-0d001acc167d.png",
"greeting": "Hello! How can I assist you today?",
"isRequestUserInfoEnabled": false,
"isToolEnabled": true,
"model": "gpt-4o",
"prompt": "You are a helpful and friendly customer support agent. Respond to user inquiries in a clear and concise manner. Always strive to provide accurate and helpful information.",
"snippet": {
"header": "오케이챗 고객응대 챗봇",
"logo": "https://dasomx.odoo.com/web/image/website/1/logo/DASOMX?unique=1aee356",
"name": "Test",
"primaryColor": "#9c2caa",
"secondaryColor": "#60d7a9",
"slogan": "Chat with us"
}
},
"slug": "test-1",
"updated_at": "2024-12-01T14:38:45.709025+00:00"
}
}Headers
Example:
"4358d60b39ef0df47f421c0d58331407ec609abb6355dfa4"
Path Parameters
Example:
""
Query Parameters
Example:
"파일"
Response
200 - application/json
Example
Show child attributes
Show child attributes
⌘I