Dokument erstellen
curl --request POST \
--url https://app.famulor.de/api/user/knowledgebases/{knowledgebaseId}/documents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"type": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', type: '<string>'})
};
fetch('https://app.famulor.de/api/user/knowledgebases/{knowledgebaseId}/documents', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.famulor.de/api/user/knowledgebases/{knowledgebaseId}/documents"
payload = {
"name": "<string>",
"type": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.famulor.de/api/user/knowledgebases/{knowledgebaseId}/documents",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'type' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://app.famulor.de/api/user/knowledgebases/{knowledgebaseId}/documents"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"type\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"message": "Document created successfully. Processing will begin shortly.",
"data": {
"id": 1,
"name": "Unternehmenswebsite",
"description": "Hauptinhalte der Website",
"type": "website",
"type_label": "Website",
"status": "processing",
"status_label": "Wird verarbeitet",
"created_at": "2025-01-08T10:30:00.000000Z"
}
}
{
"message": "Document created successfully. Processing will begin shortly.",
"data": {
"id": 2,
"name": "Produkthandbuch",
"description": "Benutzerhandbuch für unser Produkt",
"type": "pdf",
"type_label": "PDF",
"status": "processing",
"status_label": "Wird verarbeitet",
"created_at": "2025-01-08T10:35:00.000000Z"
}
}
{
"error": "Knowledgebase not found."
}
{
"message": "A file is required for this document type.",
"errors": {
"file": [
"A file is required for this document type."
]
}
}
{
"error": "Failed to create document. Please try again."
}
Dokument erstellen
Fügt ein neues Dokument zu einer Wissensdatenbank hinzu
POST
/
api
/
user
/
knowledgebases
/
{knowledgebaseId}
/
documents
Dokument erstellen
curl --request POST \
--url https://app.famulor.de/api/user/knowledgebases/{knowledgebaseId}/documents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"type": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', type: '<string>'})
};
fetch('https://app.famulor.de/api/user/knowledgebases/{knowledgebaseId}/documents', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.famulor.de/api/user/knowledgebases/{knowledgebaseId}/documents"
payload = {
"name": "<string>",
"type": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.famulor.de/api/user/knowledgebases/{knowledgebaseId}/documents",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'type' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://app.famulor.de/api/user/knowledgebases/{knowledgebaseId}/documents"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"type\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"message": "Document created successfully. Processing will begin shortly.",
"data": {
"id": 1,
"name": "Unternehmenswebsite",
"description": "Hauptinhalte der Website",
"type": "website",
"type_label": "Website",
"status": "processing",
"status_label": "Wird verarbeitet",
"created_at": "2025-01-08T10:30:00.000000Z"
}
}
{
"message": "Document created successfully. Processing will begin shortly.",
"data": {
"id": 2,
"name": "Produkthandbuch",
"description": "Benutzerhandbuch für unser Produkt",
"type": "pdf",
"type_label": "PDF",
"status": "processing",
"status_label": "Wird verarbeitet",
"created_at": "2025-01-08T10:35:00.000000Z"
}
}
{
"error": "Knowledgebase not found."
}
{
"message": "A file is required for this document type.",
"errors": {
"file": [
"A file is required for this document type."
]
}
}
{
"error": "Failed to create document. Please try again."
}
Dieser Endpunkt erstellt ein neues Dokument in einer Wissensdatenbank. Dokumente werden asynchron verarbeitet - der Endpunkt gibt sofort zurück, während die Verarbeitung im Hintergrund fortgesetzt wird.
Pfad-Parameter
integer
erforderlich
Die eindeutige Kennung der Wissensdatenbank
Request Body
string
erforderlich
Der Name des Dokuments (max. 255 Zeichen)
string
Optionale Beschreibung des Dokuments (max. 255 Zeichen)
string
erforderlich
Dokumenttyp:
website, pdf, txt oder docxWebsite-Dokumente
string
Die Haupt-URL zum Scrapen. Erforderlich, wenn
links nicht bereitgestellt wird.array
Array von spezifischen URLs zum Scrapen. Erforderlich, wenn
url nicht bereitgestellt wird.Anzeigen Links-Eigenschaften
Anzeigen Links-Eigenschaften
string
erforderlich
Eine gültige URL, die in das Dokument aufgenommen werden soll
integer
Standard:"10"
Maximale Anzahl von relativen Links, denen beim Scrapen gefolgt werden soll (1-50)
Datei-Dokumente (PDF, TXT, DOCX)
file
erforderlich
Die hochzuladende Datei (max. 20MB). Verwende
multipart/form-data Kodierung.Antwort-Felder
string
Erfolgsmeldung
object
Das erstellte Dokument-Objekt
Anzeigen Daten-Eigenschaften
Anzeigen Daten-Eigenschaften
Dokumenttypen
| Typ | Beschreibung | Eingabe |
|---|---|---|
website | Scraped Webseiten und extrahiert Textinhalte | URL oder Liste von URLs |
pdf | Extrahiert Text aus PDF-Dateien | PDF-Datei-Upload |
txt | Klartext-Inhalt | TXT-Datei-Upload |
docx | Extrahiert Text aus Word-Dokumenten | DOCX-Datei-Upload |
Die Dokumentverarbeitung erfolgt asynchron. Rufe den Dokument abrufen Endpunkt ab, um zu prüfen, wann die Verarbeitung abgeschlossen ist.
{
"message": "Document created successfully. Processing will begin shortly.",
"data": {
"id": 1,
"name": "Unternehmenswebsite",
"description": "Hauptinhalte der Website",
"type": "website",
"type_label": "Website",
"status": "processing",
"status_label": "Wird verarbeitet",
"created_at": "2025-01-08T10:30:00.000000Z"
}
}
{
"message": "Document created successfully. Processing will begin shortly.",
"data": {
"id": 2,
"name": "Produkthandbuch",
"description": "Benutzerhandbuch für unser Produkt",
"type": "pdf",
"type_label": "PDF",
"status": "processing",
"status_label": "Wird verarbeitet",
"created_at": "2025-01-08T10:35:00.000000Z"
}
}
{
"error": "Knowledgebase not found."
}
{
"message": "A file is required for this document type.",
"errors": {
"file": [
"A file is required for this document type."
]
}
}
{
"error": "Failed to create document. Please try again."
}
War diese Seite hilfreich?
⌘I

