Aramaları filtrelemek için kullanabileceğiniz parametreler ve örnekler
Arama listesi API'si, aramaları çeşitli kriterlere göre filtrelemenize olanak tanır.Tüm filtre parametreleri opsiyoneldir ve birlikte kullanılabilir.
Endpoint:
GET /api/v1/calls?[filters]startDateISO 8601Belirtilen tarihten sonraki aramaları getirir
# Get calls from the last 7 days
curl "https://api.wespoke.ai/api/v1/calls?startDate=2025-01-08T00:00:00Z" \
-H "Authorization: Bearer YOUR_API_KEY"endDateISO 8601Belirtilen tarihten önceki aramaları getirir
# Get calls within a specific date range
curl "https://api.wespoke.ai/api/v1/calls?startDate=2025-01-01T00:00:00Z&endDate=2025-01-08T23:59:59Z" \
-H "Authorization: Bearer YOUR_API_KEY"assistantIdstringBelirli bir asistana ait aramaları filtreler
# Get calls for a specific assistant
curl "https://api.wespoke.ai/api/v1/calls?assistantId=asst_456" \
-H "Authorization: Bearer YOUR_API_KEY"phoneNumberIdstringBelirli bir telefon numarasına ait aramaları filtreler
# Get calls for a specific number
curl "https://api.wespoke.ai/api/v1/calls?phoneNumberId=phone_789" \
-H "Authorization: Bearer YOUR_API_KEY"callerNumberstringBelirli bir arayan numarasından gelen aramaları filtreler
# Get calls from a specific caller number
curl "https://api.wespoke.ai/api/v1/calls?callerNumber=%2B905559876543" \
-H "Authorization: Bearer YOUR_API_KEY"statusenumArama durumuna göre filtreler. Değerler: queued, ringing, in-progress, completed, failed, busy, no-answer
# Get completed calls
curl "https://api.wespoke.ai/api/v1/calls?status=completed" \
-H "Authorization: Bearer YOUR_API_KEY"
# Get failed calls
curl "https://api.wespoke.ai/api/v1/calls?status=failed" \
-H "Authorization: Bearer YOUR_API_KEY"endReasonenumArama bitiş nedenine göre filtreler. Değerler: user_hangup, assistant_hangup, error, timeout, voicemail_detected
# Get calls that went to voicemail
curl "https://api.wespoke.ai/api/v1/calls?endReason=voicemail_detected" \
-H "Authorization: Bearer YOUR_API_KEY"directionenumArama yönüne göre filtreler. Değerler: inbound (gelen), outbound (giden)
# Get outbound calls only
curl "https://api.wespoke.ai/api/v1/calls?direction=outbound" \
-H "Authorization: Bearer YOUR_API_KEY"minDurationnumberMinimum arama süresi (saniye cinsinden)
# Get calls longer than 60 seconds
curl "https://api.wespoke.ai/api/v1/calls?minDuration=60" \
-H "Authorization: Bearer YOUR_API_KEY"maxDurationnumberMaksimum arama süresi (saniye cinsinden)
# Get calls shorter than 30 seconds (likely unanswered)
curl "https://api.wespoke.ai/api/v1/calls?maxDuration=30" \
-H "Authorization: Bearer YOUR_API_KEY"Belirli bir süre aralığındaki aramaları getir:
# Get calls between 1-5 minutes
curl "https://api.wespoke.ai/api/v1/calls?minDuration=60&maxDuration=300" \
-H "Authorization: Bearer YOUR_API_KEY"minCostnumberMinimum arama maliyeti (TL cinsinden)
# Get calls costing more than 1 TL
curl "https://api.wespoke.ai/api/v1/calls?minCost=1.0" \
-H "Authorization: Bearer YOUR_API_KEY"maxCostnumberMaksimum arama maliyeti (TL cinsinden)
# Get calls costing less than 0.50 TL
curl "https://api.wespoke.ai/api/v1/calls?maxCost=0.50" \
-H "Authorization: Bearer YOUR_API_KEY"sortByenumSıralama alanı. Değerler: startTime, duration, cost (varsayılan: startTime)
sortOrderenumSıralama yönü. Değerler: asc (artan), desc (azalan, varsayılan)
Örnek: En pahalı aramaları getir
curl "https://api.wespoke.ai/api/v1/calls?sortBy=cost&sortOrder=desc&limit=10" \
-H "Authorization: Bearer YOUR_API_KEY"Örnek: En uzun aramaları getir
curl "https://api.wespoke.ai/api/v1/calls?sortBy=duration&sortOrder=desc&limit=10" \
-H "Authorization: Bearer YOUR_API_KEY"curl "https://api.wespoke.ai/api/v1/calls?direction=outbound&status=failed&startDate=2025-01-01T00:00:00Z" \
-H "Authorization: Bearer YOUR_API_KEY"curl "https://api.wespoke.ai/api/v1/calls?assistantId=asst_456&minDuration=300&minCost=2.0&sortBy=cost&sortOrder=desc" \
-H "Authorization: Bearer YOUR_API_KEY"curl "https://api.wespoke.ai/api/v1/calls?endReason=voicemail_detected&startDate=2025-01-01T00:00:00Z&endDate=2025-01-31T23:59:59Z" \
-H "Authorization: Bearer YOUR_API_KEY"curl "https://api.wespoke.ai/api/v1/calls?callerNumber=%2B905559876543&sortBy=startTime&sortOrder=desc" \
-H "Authorization: Bearer YOUR_API_KEY"Tüm filtre parametreleri birlikte kullanılabilir. API otomatik olarak tüm kriterleri karşılayanaramaları getirecektir (AND mantığı). Daha karmaşık sorgular için (OR mantığı),birden fazla API çağrısı yapıp sonuçları birleştirmeniz gerekebilir.