API
Anmelden
Dokumentation › Konto & KI › KI-Assistent abfragen
POST

KI-Assistent abfragen

POSThttps://app.sendapp.ai/api/conversation/ask
Senden Sie eine Frage an den KI-Assistenten mit dem Konto-Token. Übergeben Sie eine conversation_id, um den Kontext über mehrere Anfragen hinweg beizubehalten.
Parameter
apikey erforderlich
Ihr API Key.
token erforderlich
Token für diese Konversation.
question erforderlich
Ihre Frage.
conversation_id optional
Konversationskennung für den Kontext.
Anfrage
curl -X POST 'https://app.sendapp.ai/api/conversation/ask' \
  -H 'Content-Type: application/json' \
  -d '{
    "apikey": "YOUR_API_KEY",
    "token": "YOUR_ACCOUNT_TOKEN",
    "question": "Hallo, wie können Sie mir helfen?"
  }'
<?php
$ch = curl_init('https://app.sendapp.ai/api/conversation/ask');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POST => true,
    CURLOPT_HTTPHEADER => ['Content-Type: application/json'],
    CURLOPT_POSTFIELDS => json_encode([
        'apikey'   => 'YOUR_API_KEY',
        'token'    => 'YOUR_ACCOUNT_TOKEN',
        'question' => 'Hallo, wie können Sie mir helfen?',
    ]),
]);
echo curl_exec($ch);
curl_close($ch);
const res = await fetch('https://app.sendapp.ai/api/conversation/ask', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    apikey: 'YOUR_API_KEY',
    token: 'YOUR_ACCOUNT_TOKEN',
    question: 'Hallo, wie können Sie mir helfen?'
  })
});
console.log(await res.json());
Antwort (200 OK)
{
  "status": "success",
  "conversation_id": "9f8e7d6c-5b4a-3c2d-1e0f-abcdef123456",
  "response": "Certo! Il nostro orario di apertura è dal lunedì al venerdì, dalle 9:00 alle 18:00.",
  "transcription": null
}
Fehler
{
  "status": "error",
  "message": "This API key is not authorized for this token."
}