Upload articles from a file
curl --request POST \
--url https://back.leap.onclarity.com/api/kb/articles/upload \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form file=@example-file \
--form 'collection_name=<string>'import requests
url = "https://back.leap.onclarity.com/api/kb/articles/upload"
files = { "file": ("example-file", open("example-file", "rb")) }
payload = { "collection_name": "<string>" }
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('file', '<string>');
form.append('collection_name', '<string>');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://back.leap.onclarity.com/api/kb/articles/upload', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"code": "<string>",
"status": "error",
"message": "<string>",
"extra": {}
}{
"code": "<string>",
"status": "error",
"message": "<string>",
"extra": {}
}Knowledge base
Upload articles from a file
POST
/
api
/
kb
/
articles
/
upload
Upload articles from a file
curl --request POST \
--url https://back.leap.onclarity.com/api/kb/articles/upload \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form file=@example-file \
--form 'collection_name=<string>'import requests
url = "https://back.leap.onclarity.com/api/kb/articles/upload"
files = { "file": ("example-file", open("example-file", "rb")) }
payload = { "collection_name": "<string>" }
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('file', '<string>');
form.append('collection_name', '<string>');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://back.leap.onclarity.com/api/kb/articles/upload', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"code": "<string>",
"status": "error",
"message": "<string>",
"extra": {}
}{
"code": "<string>",
"status": "error",
"message": "<string>",
"extra": {}
}Authorizations
Your organization API key (it starts with anek_org_). The same key works on the Voice API and the Support API. See Authentication.
Response
Request fulfilled, document follows