Statistika
Qo'ng'iroqlar statistikasini olish uchun endpointlar. Dashboard va hisobotlar uchun ishlatiladi.
Ogohlantirish
Barcha endpointlar Bearer token talab qiladi. Batafsil: Auth
Umumiy parametrlar
Ko'pgina statistika endpointlari from va to parametrlarini talab qiladi:
| Field | Type | Required | Description |
|---|---|---|---|
from | date | Yes | Boshlanish sanasi (Y-m-d yoki Y-m-d H:i:s) |
to | date | Yes | Tugash sanasi (Y-m-d yoki Y-m-d H:i:s) |
external_number | string | No | Tashqi raqam bo'yicha filtrlash |
Misol parametrlar
?from=2026-01-01&to=2026-01-31
?from=2026-01-01 00:00:00&to=2026-01-31 23:59:59
?from=2026-01-01&to=2026-01-31&external_number=781130590Umumiy qo'ng'iroqlar soni
Endpoint
GET /statistic/calls-count
Berilgan davr uchun kiruvchi, chiquvchi va ichki qo'ng'iroqlarning umumiy va holat bo'yicha sonini qaytaradi.
Response
| Field | Type | Description |
|---|---|---|
result.all.incoming | int | Jami kiruvchi qo'ng'iroqlar |
result.all.outgoing | int | Jami chiquvchi qo'ng'iroqlar |
result.all.internal | int | Jami ichki qo'ng'iroqlar |
result.incoming.answered | int | Javob berilgan kiruvchi |
result.incoming.not_answered | int | Javobsiz kiruvchi |
result.incoming.total | int | Jami kiruvchi |
result.outgoing.answered | int | Javob berilgan chiquvchi |
result.outgoing.not_answered | int | Javobsiz chiquvchi |
result.outgoing.total | int | Jami chiquvchi |
result.internal.answered | int | Javob berilgan ichki |
result.internal.not_answered | int | Javobsiz ichki |
result.internal.total | int | Jami ichki |
Example
{
"status": "success",
"code": 200,
"result": {
"all": {
"incoming": 150,
"outgoing": 230,
"internal": 45
},
"incoming": {
"answered": 120,
"not_answered": 30,
"total": 150
},
"outgoing": {
"answered": 200,
"not_answered": 30,
"total": 230
},
"internal": {
"answered": 40,
"not_answered": 5,
"total": 45
}
},
"message": "Ok"
}Soat bo'yicha statistika
Endpoint
GET /statistic/calls-by-hour
Har soat uchun qo'ng'iroqlar sonini qaytaradi. Grafik uchun ishlatiladi.
Response
| Field | Type | Description |
|---|---|---|
result.incoming.all | array | Kiruvchilar soat bo'yicha |
result.incoming.not_answered | array | Javobsiz kiruvchilar soat bo'yicha |
result.outgoing.all | array | Chiquvchilar soat bo'yicha |
result.outgoing.not_answered | array | Javobsiz chiquvchilar soat bo'yicha |
result.internal.all | array | Ichkilar soat bo'yicha |
result.internal.not_answered | array | Javobsiz ichkilar soat bo'yicha |
Har bir array elementi:
| Field | Type | Description |
|---|---|---|
date_hour | string | Sana va soat (2026-01-13 09:00:00) |
call_count | int | Shu soatdagi qo'ng'iroqlar soni |
Example
{
"status": "success",
"code": 200,
"result": {
"incoming": {
"all": [
{ "date_hour": "2026-01-13 09:00:00", "call_count": 12 },
{ "date_hour": "2026-01-13 10:00:00", "call_count": 18 },
{ "date_hour": "2026-01-13 11:00:00", "call_count": 25 }
],
"not_answered": [
{ "date_hour": "2026-01-13 09:00:00", "call_count": 2 },
{ "date_hour": "2026-01-13 10:00:00", "call_count": 3 },
{ "date_hour": "2026-01-13 11:00:00", "call_count": 5 }
]
},
"outgoing": { "all": [...], "not_answered": [...] },
"internal": { "all": [...], "not_answered": [...] }
},
"message": "Ok"
}Kun bo'yicha statistika
Endpoint
GET /statistic/calls-by-day
Har kun uchun qo'ng'iroqlar sonini qaytaradi.
Response tuzilishi calls-by-hour bilan bir xil, lekin date_hour o'rniga kun qiymati bo'ladi.
Oy bo'yicha statistika
Endpoint
GET /statistic/calls-by-month
Har oy uchun qo'ng'iroqlar sonini qaytaradi.
Response tuzilishi calls-by-hour bilan bir xil, lekin oy bo'yicha gruppalashtilgan.
Tashqi raqamlar bo'yicha statistika
Endpoint
GET /statistic/calls-by-external-number
Tashqi telefon raqamlari (SIP trunk raqamlari) bo'yicha qo'ng'iroqlar statistikasini qaytaradi.
Response tuzilishi calls-by-hour bilan bir xil, lekin tashqi raqam bo'yicha.
Foydalanuvchilar bo'yicha statistika
Endpoint
GET /statistic/calls-by-users
Har bir foydalanuvchi (operator) uchun chiquvchi va kiruvchi qo'ng'iroqlar statistikasini qaytaradi.
Request
| Field | Type | Required | Description |
|---|---|---|---|
from | date | Yes | Boshlanish sanasi |
to | date | Yes | Tugash sanasi |
status | integer|null | No | Holat bo'yicha filter (1=Answered, 2=Not answered) |
Response
| Field | Type | Description |
|---|---|---|
result | array | Foydalanuvchilar statistikasi |
result[*].number | string | Foydalanuvchi modul raqami |
result[*].outgoing_count | int | Chiquvchi qo'ng'iroqlar soni |
result[*].outgoing_duration | int | Chiquvchi umumiy davomiylik (soniya) |
result[*].outgoing_conversation | int | Chiquvchi suhbat davomiyligi (soniya) |
result[*].incoming_count | int | Kiruvchi qo'ng'iroqlar soni |
result[*].incoming_duration | int | Kiruvchi umumiy davomiylik (soniya) |
result[*].incoming_conversation | int | Kiruvchi suhbat davomiyligi (soniya) |
Example
{
"status": "success",
"code": 200,
"result": [
{
"number": "101",
"outgoing_count": 45,
"outgoing_duration": 3600,
"outgoing_conversation": 3200,
"incoming_count": 78,
"incoming_duration": 6200,
"incoming_conversation": 5800
},
{
"number": "102",
"outgoing_count": 30,
"outgoing_duration": 2400,
"outgoing_conversation": 2100,
"incoming_count": 55,
"incoming_duration": 4500,
"incoming_conversation": 4100
}
],
"message": "Ok"
}Qo'ng'iroqlar tarixidan statistika
Endpoint
GET /statistic/calls-count-by-history
Qo'ng'iroqlar tarixiga asoslanib filtrlangan statistika. Call history endpointi bilan bir xil filter parametrlarini qabul qiladi.
Request
Call history filterlari bilan bir xil: filter.type, filter.status, filter.from, filter.to, filter.src, filter.dst, filter.external_number va boshqalar.