Documentation ›
Account & AI › Query the AI assistant
POST
Query the AI assistant
POSThttps://app.sendapp.ai/api/conversation/ask
Send a question to the AI assistant using the account token. Pass a
conversation_id to keep the context across multiple requests. Parameters
apikey
required
Your API Key.
token
required
Token for this conversation.
question
required
Your question.
conversation_id
optional
Conversation identifier for context.
Request
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": "Hi, how can you help me?"
}'<?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' => 'Hi, how can you help me?',
]),
]);
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: 'Hi, how can you help me?'
})
});
console.log(await res.json());Response (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
}Error
{
"status": "error",
"message": "This API key is not authorized for this token."
}