curl -X POST "https://app.whattalk.ai/api/conversations/7c9e6679-7425-40de-944b-e07fc1f90ae7/messages" \
-H "Content-Type: application/json" \
-d '{
"message": "I would like to schedule a demo for next week"
}'
const conversationId = '7c9e6679-7425-40de-944b-e07fc1f90ae7';
const response = await fetch(
`https://app.whattalk.ai/api/conversations/${conversationId}/messages`,
{
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
message: 'I would like to schedule a demo for next week'
})
}
);
const data = await response.json();
console.log(data.message);
import requests
conversation_id = '7c9e6679-7425-40de-944b-e07fc1f90ae7'
response = requests.post(
f'https://app.whattalk.ai/api/conversations/{conversation_id}/messages',
json={
'message': 'I would like to schedule a demo for next week'
}
)
data = response.json()
print(data['message'])
{
"status": true,
"message": "I'd be happy to help you schedule a demo! I have availability on Monday at 2 PM, Wednesday at 10 AM, or Friday at 3 PM. Which time works best for you?",
"function_calls": []
}
{
"status": true,
"message": "I've checked our calendar and found several available slots for next week. I can offer you Monday at 2 PM, Wednesday at 10 AM, or Friday at 3 PM. Which would you prefer?",
"function_calls": [
{
"name": "check_calendar_availability",
"arguments": {
"start_date": "2025-01-13",
"end_date": "2025-01-17"
},
"result": {
"available_slots": [
"2025-01-13 14:00",
"2025-01-15 10:00",
"2025-01-17 15:00"
]
}
}
]
}
{
"status": false,
"error": "Conversation not found"
}
{
"status": false,
"error": "Insufficient balance. Please top up your account."
}
{
"status": false,
"error": "Failed to process message: Connection timeout"
}
{
"message": "The message field is required.",
"errors": {
"message": ["The message field is required."]
}
}
Konuşmalar
Mesaj Gönder
Mevcut bir konuşmada mesaj gönderin ve asistanın yanıtını alın
POST
/
conversations
/
{uuid}
/
messages
curl -X POST "https://app.whattalk.ai/api/conversations/7c9e6679-7425-40de-944b-e07fc1f90ae7/messages" \
-H "Content-Type: application/json" \
-d '{
"message": "I would like to schedule a demo for next week"
}'
const conversationId = '7c9e6679-7425-40de-944b-e07fc1f90ae7';
const response = await fetch(
`https://app.whattalk.ai/api/conversations/${conversationId}/messages`,
{
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
message: 'I would like to schedule a demo for next week'
})
}
);
const data = await response.json();
console.log(data.message);
import requests
conversation_id = '7c9e6679-7425-40de-944b-e07fc1f90ae7'
response = requests.post(
f'https://app.whattalk.ai/api/conversations/{conversation_id}/messages',
json={
'message': 'I would like to schedule a demo for next week'
}
)
data = response.json()
print(data['message'])
{
"status": true,
"message": "I'd be happy to help you schedule a demo! I have availability on Monday at 2 PM, Wednesday at 10 AM, or Friday at 3 PM. Which time works best for you?",
"function_calls": []
}
{
"status": true,
"message": "I've checked our calendar and found several available slots for next week. I can offer you Monday at 2 PM, Wednesday at 10 AM, or Friday at 3 PM. Which would you prefer?",
"function_calls": [
{
"name": "check_calendar_availability",
"arguments": {
"start_date": "2025-01-13",
"end_date": "2025-01-17"
},
"result": {
"available_slots": [
"2025-01-13 14:00",
"2025-01-15 10:00",
"2025-01-17 15:00"
]
}
}
]
}
{
"status": false,
"error": "Conversation not found"
}
{
"status": false,
"error": "Insufficient balance. Please top up your account."
}
{
"status": false,
"error": "Failed to process message: Connection timeout"
}
{
"message": "The message field is required.",
"errors": {
"message": ["The message field is required."]
}
}
Bu endpoint, mevcut bir konuşmaya kullanıcı mesajı gönderir ve asistanın yanıtını döndürür. Asistan, yapılandırılmış yapay zeka modelini ve mevcut araçları kullanarak mesajı işler.
Yol Parametreleri
string
gerekli
Konuşmanın benzersiz UUID tanımlayıcısı
İstek Gövdesi
string
gerekli
Asistana gönderilecek kullanıcı mesajı. Maksimum uzunluk: 2000 karakter.
Yanıt Alanları
boolean
İsteğin başarılı olup olmadığını belirtir
string
Asistanın kullanıcı mesajına verdiği yanıt
array
Hata Yanıtları
boolean
Bir hata oluştuğunda
false olurstring
Hata mesajı. Olası değerler:
Conversation not found- Sağlanan UUID herhangi bir konuşmayla eşleşmiyorInsufficient balance. Please top up your account.- Asistan sahibinin hesap bakiyesi çok düşükFailed to process message: [details]- Mesaj işlenirken bir hata oluştu
curl -X POST "https://app.whattalk.ai/api/conversations/7c9e6679-7425-40de-944b-e07fc1f90ae7/messages" \
-H "Content-Type: application/json" \
-d '{
"message": "I would like to schedule a demo for next week"
}'
const conversationId = '7c9e6679-7425-40de-944b-e07fc1f90ae7';
const response = await fetch(
`https://app.whattalk.ai/api/conversations/${conversationId}/messages`,
{
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
message: 'I would like to schedule a demo for next week'
})
}
);
const data = await response.json();
console.log(data.message);
import requests
conversation_id = '7c9e6679-7425-40de-944b-e07fc1f90ae7'
response = requests.post(
f'https://app.whattalk.ai/api/conversations/{conversation_id}/messages',
json={
'message': 'I would like to schedule a demo for next week'
}
)
data = response.json()
print(data['message'])
{
"status": true,
"message": "I'd be happy to help you schedule a demo! I have availability on Monday at 2 PM, Wednesday at 10 AM, or Friday at 3 PM. Which time works best for you?",
"function_calls": []
}
{
"status": true,
"message": "I've checked our calendar and found several available slots for next week. I can offer you Monday at 2 PM, Wednesday at 10 AM, or Friday at 3 PM. Which would you prefer?",
"function_calls": [
{
"name": "check_calendar_availability",
"arguments": {
"start_date": "2025-01-13",
"end_date": "2025-01-17"
},
"result": {
"available_slots": [
"2025-01-13 14:00",
"2025-01-15 10:00",
"2025-01-17 15:00"
]
}
}
]
}
{
"status": false,
"error": "Conversation not found"
}
{
"status": false,
"error": "Insufficient balance. Please top up your account."
}
{
"status": false,
"error": "Failed to process message: Connection timeout"
}
{
"message": "The message field is required.",
"errors": {
"message": ["The message field is required."]
}
}
Fiyatlandırma
Bir widget konuşmasındaki her kullanıcı mesajı 0,01 $ maliyetindedir. Test konuşmaları ücretsizdir.Fonksiyon Çağrıları
Asistan, mesaj işleme sırasında aşağıdaki gibi fonksiyonlar çalıştırabilir:- Takvim işlemleri: Uygunluk kontrolü, randevu oluşturma
- Bilgi bankası sorguları: Dokümantasyon veya SSS araması
- Özel entegrasyonlar: Yapılandırılmış webhook endpoint’lerinizi çağırma
En İyi Uygulamalar
- Hataları zarif bir şekilde yönetin: Hatalar oluştuğunda kullanıcı dostu mesajlar gösterin
- Yükleme durumlarını gösterin: Asistan, özellikle fonksiyon çalıştırırken yanıt vermesi birkaç saniye sürebilir
- Konuşma kimliğini saklayın: Kullanıcıların konuşmaları devam ettirmesine izin vermek için konuşma UUID’sini saklayın
- Hız sınırlarına uyun: Gerekirse mesajlar arasında uygun gecikmeleri uygulayın

