curl -X POST "https://app.whattalk.ai/api/conversations" \
-H "Content-Type: application/json" \
-d '{
"assistant_id": "550e8400-e29b-41d4-a716-446655440000",
"type": "widget",
"variables": {
"customer_name": "John Smith",
"company": "Acme Corp",
"source": "pricing_page"
}
}'
const response = await fetch('https://app.whattalk.ai/api/conversations', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
assistant_id: '550e8400-e29b-41d4-a716-446655440000',
type: 'widget',
variables: {
customer_name: 'John Smith',
company: 'Acme Corp',
source: 'pricing_page'
}
})
});
const data = await response.json();
console.log(data.conversation_id);
import requests
response = requests.post(
'https://app.whattalk.ai/api/conversations',
json={
'assistant_id': '550e8400-e29b-41d4-a716-446655440000',
'type': 'widget',
'variables': {
'customer_name': 'John Smith',
'company': 'Acme Corp',
'source': 'pricing_page'
}
}
)
data = response.json()
print(data['conversation_id'])
{
"status": true,
"conversation_id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"history": [
{
"role": "assistant",
"content": "Hello John Smith! Welcome to Acme Corp support. How can I help you today?"
}
]
}
{
"status": true,
"conversation_id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"history": []
}
{
"status": false,
"error": "Assistant not found"
}
{
"status": false,
"error": "Insufficient balance. Please top up your account."
}
Konuşmalar
Konuşma Oluştur
Bir yapay zeka asistanıyla yeni bir konuşma oturumu oluşturun
POST
/
conversations
curl -X POST "https://app.whattalk.ai/api/conversations" \
-H "Content-Type: application/json" \
-d '{
"assistant_id": "550e8400-e29b-41d4-a716-446655440000",
"type": "widget",
"variables": {
"customer_name": "John Smith",
"company": "Acme Corp",
"source": "pricing_page"
}
}'
const response = await fetch('https://app.whattalk.ai/api/conversations', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
assistant_id: '550e8400-e29b-41d4-a716-446655440000',
type: 'widget',
variables: {
customer_name: 'John Smith',
company: 'Acme Corp',
source: 'pricing_page'
}
})
});
const data = await response.json();
console.log(data.conversation_id);
import requests
response = requests.post(
'https://app.whattalk.ai/api/conversations',
json={
'assistant_id': '550e8400-e29b-41d4-a716-446655440000',
'type': 'widget',
'variables': {
'customer_name': 'John Smith',
'company': 'Acme Corp',
'source': 'pricing_page'
}
}
)
data = response.json()
print(data['conversation_id'])
{
"status": true,
"conversation_id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"history": [
{
"role": "assistant",
"content": "Hello John Smith! Welcome to Acme Corp support. How can I help you today?"
}
]
}
{
"status": true,
"conversation_id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"history": []
}
{
"status": false,
"error": "Assistant not found"
}
{
"status": false,
"error": "Insufficient balance. Please top up your account."
}
Bu endpoint, bir yapay zeka asistanıyla yeni bir konuşma oturumu oluşturur. Bunu web widget’ınız veya uygulamanız aracılığıyla metin tabanlı bir sohbet oturumu başlatmak için kullanın.
İstek Gövdesi
string
gerekli
Konuşmayı başlatacağınız asistanın UUID’si. Sistemde mevcut ve geçerli bir asistan UUID’si olmalıdır.
string
varsayılan:"widget"
Konuşma türü. Olası değerler:
widget- Web widget konuşması (varsayılan, ücretli)test- Test konuşması (ücretsiz, geliştirme için)
object
Asistana aktarılacak özel değişkenler. Bu değişkenler, asistanın sistem istemi ve ilk mesajında
{{variable_name}} sözdizimi kullanılarak kullanılabilir.Yaygın kullanım alanları:- Formlardan müşteri bilgilerini önceden doldurma
- Uygulamanızdan bağlam aktarma
- Oturum bazında asistan davranışını özelleştirme
Yanıt Alanları
boolean
İsteğin başarılı olup olmadığını belirtir
string
Oluşturulan konuşmanın benzersiz UUID tanımlayıcısı. Bu kimliği sonraki mesaj istekleri için kullanın.
array
Hata Yanıtları
boolean
Bir hata oluştuğunda
false olurstring
Neyin yanlış gittiğini açıklayan hata mesajı. Olası değerler:
Assistant not found- Sağlanan assistant_id mevcut değilInsufficient balance. Please top up your account.- Asistan sahibinin hesap bakiyesi çok düşük
curl -X POST "https://app.whattalk.ai/api/conversations" \
-H "Content-Type: application/json" \
-d '{
"assistant_id": "550e8400-e29b-41d4-a716-446655440000",
"type": "widget",
"variables": {
"customer_name": "John Smith",
"company": "Acme Corp",
"source": "pricing_page"
}
}'
const response = await fetch('https://app.whattalk.ai/api/conversations', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
assistant_id: '550e8400-e29b-41d4-a716-446655440000',
type: 'widget',
variables: {
customer_name: 'John Smith',
company: 'Acme Corp',
source: 'pricing_page'
}
})
});
const data = await response.json();
console.log(data.conversation_id);
import requests
response = requests.post(
'https://app.whattalk.ai/api/conversations',
json={
'assistant_id': '550e8400-e29b-41d4-a716-446655440000',
'type': 'widget',
'variables': {
'customer_name': 'John Smith',
'company': 'Acme Corp',
'source': 'pricing_page'
}
}
)
data = response.json()
print(data['conversation_id'])
{
"status": true,
"conversation_id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"history": [
{
"role": "assistant",
"content": "Hello John Smith! Welcome to Acme Corp support. How can I help you today?"
}
]
}
{
"status": true,
"conversation_id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"history": []
}
{
"status": false,
"error": "Assistant not found"
}
{
"status": false,
"error": "Insufficient balance. Please top up your account."
}
Fiyatlandırma
- Widget konuşmaları: Kullanıcı mesajı başına 0,01 $
- Test konuşmaları: Ücretsiz (geliştirme ve test için)

