Arama Detayı

Belirli bir aramanın detaylı bilgilerini ve mesaj geçmişini alın

Endpoint

GET/api/v1/calls/:callId

Belirli bir aramanın detaylı bilgilerini, mesaj geçmişini ve metriklerini getirir.

Path Parametreleri

callIdzorunlu

Detaylarını almak istediğiniz aramanın benzersiz kimliği

Örnek İstek

cURL
curl -X GET "https://api.wespoke.ai/api/v1/calls/call_123" \
  -H "Authorization: Bearer YOUR_API_KEY"

Örnek Yanıt

200 OK
{
  "success": true,
  "data": {
    "id": "call_123",
    "assistantId": "asst_456",
    "phoneNumberId": "phone_789",
    "direction": "inbound",
    "status": "completed",
    "startTime": "2025-01-15T10:30:00Z",
    "endTime": "2025-01-15T10:35:30Z",
    "duration": 330,
    "endReason": "user_hangup",
    "cost": "0.45",
    "from": "+905559876543",
    "to": "+905551234567",
    "messagesCount": 6,
    "recordingUrl": "https://bucket.s3.eu-north-1.amazonaws.com/recordings/2025/01/15/user_123/call_123.m4a?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=...",
    "recordingStatus": "completed",
    "recordingDuration": 330,
    "recordingFormat": "m4a",
    "isSuccess": true,
    "createdAt": "2025-01-15T10:30:00Z",
    "callMetadata": {
      "customerName": "John Smith",
      "ticketId": "TKT-001"
    },
    "assistant": {
      "id": "asst_456",
      "name": "Customer Support Assistant"
    },
    "phoneNumber": {
      "id": "phone_789",
      "number": "+905551234567",
      "name": "Ana Hat"
    },
    "messages": [
    {
      "id": "msg_001",
      "role": "assistant",
      "content": "Hello! Welcome to the customer support assistant. How can I help you?",
      "timestamp": "2025-01-15T10:30:05Z",
      "duration": 4.2,
      "interrupted": false
    },
    {
      "id": "msg_002",
      "role": "user",
      "content": "Hello, I would like to check my order status.",
      "timestamp": "2025-01-15T10:30:10Z",
      "duration": 3.8,
      "interrupted": false
    },
    {
      "id": "msg_003",
      "role": "tool",
      "content": "check_order_status function called",
      "timestamp": "2025-01-15T10:30:15Z",
      "toolInfo": {
        "name": "check_order_status",
        "arguments": {
          "customerId": "cust_789"
        },
        "result": {
          "orderId": "ORD-12345",
          "status": "shipped",
          "trackingNumber": "TRK-67890"
        }
      }
    },
    {
      "id": "msg_004",
      "role": "assistant",
      "content": "Your order has been shipped. Your tracking number is: TRK-67890. Can I help you with anything else?",
      "timestamp": "2025-01-15T10:30:18Z",
      "duration": 5.5,
      "interrupted": false
    },
    {
      "id": "msg_005",
      "role": "user",
      "content": "No, thank you.",
      "timestamp": "2025-01-15T10:30:25Z",
      "duration": 2.1,
      "interrupted": false
    },
    {
      "id": "msg_006",
      "role": "assistant",
      "content": "I am happy I could help. Have a good day!",
      "timestamp": "2025-01-15T10:30:28Z",
      "duration": 3.2,
      "interrupted": false
    }
  ]
  }
}

Yanıt Alanları

messages

Arama sırasında gerçekleşen tüm mesajların dizisi. Her mesaj şunları içerir:

  • role: Mesajın rolü (user, assistant, tool, system)
  • content: Mesaj içeriği
  • timestamp: Mesajın zamanı
  • duration: Mesaj süresi (saniye)
  • interrupted: Mesajın kesilip kesilmediği
  • toolInfo: Araç mesajları için ek bilgiler
recordingUrl

Arama kaydının imzalı URL'si. Bu URL 1 saat geçerlidir ve aramayı dinlemek veya indirmek için kullanılabilir.

cost

Toplam arama maliyeti (TL cinsinden)

Not

Arama kayıtları varsayılan olarak 30 gün boyunca saklanır. Bu süre sonunda otomatik olarak silinir.Kayıtları daha uzun süre saklamak isterseniz, kendi depolama sisteminize indirmelisiniz.

Hata Yanıtları

404 Not Found
{
  "success": false,
  "error": {
    "message": "Call not found",
    "code": "NOT_FOUND"
  }
}