Zum Haaptinhalt sprangen

API Integratioun

Push Daten programmatesch an Är AI SmartTalk Wëssenbasis mat eisem REST API. Ideal fir personaliséiert Integratiounen, automatiséiert Pipelines, an all Datenquell déi net vun eisen nativen Connectoren ofgedeckt ass.


Iwwerbléck

D'API Integratioun erlaabt Iech:

  • Dokumenten direkt an Är Wëssenbasis ze pushen
  • Inhalt programmatesch ze aktualiséieren
  • Veraltet Entréeën ze läschen
  • Personaliséiert Datenpipelines ze bauen
  • Integréieren mat all System dat HTTP Ufroen kann maachen

Virbedingunge

Elo, ier Dir ufänkt, stellt sécher datt Dir:

  • E aktive AI SmartTalk Kont hutt
  • API Zougang aktivéiert ass (kontrolléiert Äre Plang)
  • Basiswëssen iwwer REST APIs hutt
  • E Tool fir HTTP Ufroen ze maachen (curl, Postman, oder Ären Applikatiounscode)

Äre API Credentielen kréien

Schrëtt 1: Zougang zu API Parameteren

  1. Loggt Iech an Ärem AI SmartTalk Kont an
  2. Navigéiert op EinstellungenIntegratiounen
  3. Fannt API a klickt op Konfiguréieren

Schrëtt 2: API Token generéieren

  1. Klickt op Neit Token generéieren
  2. Koppéiert Ären Chat Modell ID an API Token
  3. Späichert dës sécher—de Token gëtt nëmmen eemol gewisen!

⚠️ Sécherheetswarnung: Ni Ären API Token an Client-Säit Code oder ëffentleche Repositories aussetzen.


API Endpunkten

Basis URL

https://api.aismarttalk.tech/v1

Authentifikatioun

All Ufroen erfuerderen Ären API Token am Header:

Authorization: Bearer YOUR_API_TOKEN

API Endpoints

Basis URL

https://api.aismarttalk.tech/v1

Authentifikatioun

All Ufroen erfuerderen Ären API Token am Header:

Authorization: Bearer YOUR_API_TOKEN

Dokumenter importéieren

Endpoint

POST /documents/import

Ufro Kéier

{
"chatModelId": "your-chat-model-id",
"documents": [
{
"title": "Produkt Dokumentatioun",
"content": "Voll Inhalt vun Ärem Dokument geet hei...",
"url": "https://example.com/docs/product",
"metadata": {
"category": "documentation",
"language": "en"
}
}
]
}

Parameteren

FeldTypObligatoreschBeschreiwung
chatModelIdstringÄren eenzegaartegen Chat Modell Identifikator
documentsarrayArray vun Dokumentobjekten
documents[].titlestringDokumenttitel fir Identifikatioun
documents[].contentstringVoll Textinhalt
documents[].urlstringQuell-URL (fir Referenz)
documents[].metadataobjectBenotzerdefinéiert Schlüssel-Wäert Pär

Äntwert

{
"success": true,
"imported": 1,
"documents": [
{
"id": "doc_abc123",
"title": "Produkt Dokumentatioun",
"status": "processing"
}
]
}

Beispill: cURL

curl -X POST https://api.aismarttalk.tech/v1/documents/import \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"chatModelId": "your-chat-model-id",
"documents": [
{
"title": "Guide fir unzefänken",
"content": "Wëllkomm op eiser Plattform. Hei ass wéi een unfänkt...",
"url": "https://docs.example.com/getting-started"
}
]
}'

Dokumenter froen

Frot Froen géint Äre Wëssenbaséiert programmatesch.

Endpoint

POST /chat/query

Ufro Kéier

{
"chatModelId": "your-chat-model-id",
"query": "Wéi kann ech meng Passwuert zrécksetzen?",
"options": {
"maxTokens": 500,
"temperature": 0.7
}
}

Äntwert

{
"success": true,
"response": "Fir Äert Passwuert zréckzesetzen, navigéiert op Astellungen > Sécherheet > Passwuert änneren...",
"sources": [
{
"documentId": "doc_abc123",
"title": "Sécherheetsguide",
"relevance": 0.95
}
]
}

Dokumenter recuperéieren

Kritt Dokumenter déi mat enger Ufro übereenstëmmen ( ouni AI Äntwert).

Endpoint

POST /documents/search

Ufro Kéier

{
"chatModelId": "your-chat-model-id",
"query": "passwuert séchergestallt",
"limit": 10
}

Äntwert

{
"success": true,
"documents": [
{
"id": "doc_abc123",
"title": "Sécherheets Bescht Praktiken",
"content": "...",
"relevance": 0.92
}
]
}

Code Beispiller

Python

import requests

API_TOKEN = "your-api-token"
CHAT_MODEL_ID = "your-chat-model-id"

def import_document(title: str, content: str, url: str = None):
response = requests.post(
"https://api.aismarttalk.tech/v1/documents/import",
headers={
"Authorization": f"Bearer {API_TOKEN}",
"Content-Type": "application/json"
},
json={
"chatModelId": CHAT_MODEL_ID,
"documents": [{
"title": title,
"content": content,
"url": url
}]
}
)
return response.json()

# Importéiert e Dokument
result = import_document(
title="FAQ: Versand",
content="Mir bidden gratis Versand fir Bestellungen iwwer $50...",
url="https://shop.example.com/faq/shipping"
)
print(result)

JavaScript / Node.js

const API_TOKEN = 'your-api-token';
const CHAT_MODEL_ID = 'your-chat-model-id';

async function importDocument(title, content, url = null) {
const response = await fetch('https://api.aismarttalk.tech/v1/documents/import', {
method: 'POST',
headers: {
'Authorization': `Bearer ${API_TOKEN}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
chatModelId: CHAT_MODEL_ID,
documents: [{
title,
content,
url
}]
})
});
return response.json();
}

// Importéiert e Dokument
importDocument(
'FAQ: Retouren',
'Dir kënnt Artikelen innerhalb vun 30 Deeg no dem Kaf zréckginn...',
'https://shop.example.com/faq/returns'
).then(console.log);

PHP

<?php
$apiToken = 'your-api-token';
$chatModelId = 'your-chat-model-id';

$data = [
'chatModelId' => $chatModelId,
'documents' => [
[
'title' => 'Produkt Spezifikatiounen',
'content' => 'Eis Widget huet déi folgend Spezifikatiounen...',
'url' => 'https://example.com/products/widget'
]
]
];

$ch = curl_init('https://api.aismarttalk.tech/v1/documents/import');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer ' . $apiToken,
'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));

$response = curl_exec($ch);
curl_close($ch);

print_r(json_decode($response, true));

Benotzungsfäll

Custom CMS Integratioun

Synchroniséiert Inhalt vun engem proprietären CMS:

  • Hook an CMS Publikatiounsereignisser
  • Push nei/aktualiséiert Inhalt an AI SmartTalk
  • Entfernt geläscht Inhalt

Datenpipeline

Importéiert aus Datenlager:

  • Exportéiert relevant Daten an JSON
  • Batch Import iwwer API
  • Plangt regelméisseg Updates

E-Commerce Produkter

Synchroniséiert Produktdaten aus personaliséierte Systemer:

  • Produktbeschreiwungen
  • Spezifikatiounen
  • Präisinformatioun

Intern Systemer

Verbindt intern Tools déi net native ënnerstëtzt sinn:

  • Custom wikis
  • Legacy Datenbanken
  • Proprietär Applikatiounen

Rate Limits

EndpointRate Limit
Document Import100 requests/minute
Query60 requests/minute
Search60 requests/minute

Note: Rate limits variéieren jee no Plang. Kontaktéiert de Support fir méi héich Limiten.


Error Handling

Error Response Format

{
"success": false,
"error": {
"code": "INVALID_TOKEN",
"message": "De fournéiert API Token ass ongëlteg oder ofgelaf"
}
}

Common Error Codes

CodeDescriptionSolution
INVALID_TOKENOngëlteg oder ofgelaf TokenRegeneréiert API Token
INVALID_MODEL_IDUnbekannte Chat Modell IDKontrolléiert Är Chat Modell ID
RATE_LIMITEDZe vill UfroënImplementéiert Backoff, probéiert et méi spéit
INVALID_REQUESTMalforméiert Ufro KéierKontrolléiert JSON Struktur
DOCUMENT_TOO_LARGEInhalt iwwertrëfft LimitSpléckt an méi kleng Dokumenter
QUOTA_EXCEEDEDPlang Limiten erreechtUpgrade oder kontaktéiert de Support

Troubleshooting

Authentication Fails

IssueSolution
401 UnauthorizedKontrolléiert ob de Token korrekt an aktiv ass
Token net funktionnéiertRegeneréiert Token an den Astellungen
Ofgelaf TokenTokens lafen net of, awer kënne widderholl ginn

Import Issues

IssueSolution
Eempty responseKontrolléiert ob de Content-Type application/json ass
Dokument net erschéngtWaart op d'Veraarbechtung; kontrolléiert de Knowledge Abschnitt
Partiell ImportE puer Dokumenter kënnen Validatiounsfehler hunn

Performance Issues

IssueSolution
Langsame ImporterBatch Dokumenter (max 100 pro Ufro)
TimeoutsReduzéiert Batch Gréisst, probéiert et mat Backoff
Rate limitéiertImplementéiert exponentiellen Backoff

Best Practices

  1. Batch imports: Schéckt méi Dokumenter pro Ufro (bis zu 100)
  2. Unique titles: Benotzt beschreiwende, eenzegaarteg Titelen fir all Dokument
  3. Structured content: Gutt formatéiert Inhalt verbessert AI Äntwerten
  4. Metadata tagging: Benotzt Metadata fir Kategoriséierung an Filterung
  5. Secure tokens: Späichert Tokens an Ëmfeldvariabelen
  6. Handle errors: Implementéiert Retry Logik mat exponentiellem Backoff
  7. Monitor usage: Spuert API Uruff géint Är Plang Limiten

Bereet fir Är
Benotzererfarung ze verbesseren?

Déployéiert AI Assistenten déi Clienten begeeschteren an mat Ärem Betrib skaliéieren.

GDPR Konform