Lấy lịch sử cuộc gọi
API này dùng để lấy lịch sử cuộc gọi trên tenant
A successful response
POST $BASE_URL.Etelecom/ListCallLogs HTTP/1.1
Host:
Content-Type: application/json
Accept: */*
Content-Length: 403
{
"filter": {
"call_number": "text",
"call_state": "unknown",
"date_from": "2025-11-01T10:12:35.671Z",
"date_to": "2025-11-01T10:12:35.671Z",
"department_id": "text",
"direction": "unknown",
"duration": {
"comparison": "unknow",
"value": 1
},
"extension_ids": [
"text"
],
"external_id": "text",
"external_session_id": "text",
"hotline_ids": [
"text"
],
"user_id": "text"
},
"paging": {
"after": "text",
"before": "text",
"limit": 1,
"sort": "text"
}
}A successful response
{
"call_logs": [
{
"call_state": "unknown",
"call_status": "Z",
"call_targets": [
{
"add_time": "2025-11-01T10:12:35.671Z",
"answered_time": "2025-11-01T10:12:35.671Z",
"end_reason": "text",
"ended_time": "2025-11-01T10:12:35.671Z",
"fail_code": 1,
"ring_duration": 1,
"ring_time": "2025-11-01T10:12:35.671Z",
"status": "text",
"target_number": "text",
"trunk_name": "text"
}
],
"callee": "text",
"caller": "text",
"contact_id": "text",
"created_at": "2025-11-01T10:12:35.671Z",
"direction": "unknown",
"duration": 1,
"ended_at": "2025-11-01T10:12:35.671Z",
"extension_id": "text",
"external_id": "text",
"external_session_id": "text",
"id": "text",
"note": "text",
"recording_urls": [
"text"
],
"started_at": "2025-11-01T10:12:35.671Z",
"updated_at": "2025-11-01T10:12:35.671Z",
"user_id": "text"
}
],
"paging": {
"after": "text",
"before": "text",
"limit": 1,
"next": "text",
"prev": "text",
"sort": "text"
}
}Request:
curl --location '$BASE_URL.Etelecom/ListCallLogs' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer $API-KEY' \
--data '{
"filter": {
"call_number": "<string>",
"call_state": "not_answered",
"date_from": "<dateTime>",
"date_to": "<dateTime>",
"department_id": "<int64>",
"direction": "in",
"duration": {
"comparison": "less_than_or_equal_to",
"value": "<integer>"
},
"extension_ids": [
"<int64>",
"<int64>"
],
"external_id": "<string>",
"external_session_id": "<string>",
"hotline_ids": [
"<int64>",
"<int64>"
],
"user_id": "<int64>"
},
"paging": {
"after": "<string>",
"before": "<string>",
"limit": "<integer>",
"sort": "<string>"
}
}'Response:
{
"call_logs": [
{
"call_state": "unknown",
"call_status": "Z",
"call_targets": [
{
"add_time": "2019-08-24T14:15:22Z",
"answered_time": "2019-08-24T14:15:22Z",
"end_reason": "string",
"ended_time": "2019-08-24T14:15:22Z",
"fail_code": 0,
"ring_duration": 0,
"ring_time": "2019-08-24T14:15:22Z",
"status": "string",
"target_number": "string",
"trunk_name": "string"
}
],
"callee": "string",
"caller": "string",
"contact_id": "string",
"created_at": "2019-08-24T14:15:22Z",
"direction": "unknown",
"duration": 0,
"ended_at": "2019-08-24T14:15:22Z",
"extension_id": "string",
"external_id": "string",
"external_session_id": "string",
"id": "string",
"note": "string",
"recording_urls": [
"string"
],
"started_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"user_id": "string"
}
],
"paging": {
"after": "string",
"before": "string",
"limit": 0,
"next": "string",
"prev": "string",
"sort": "string"
}
}Cấu trúc body của request:
extension_ids
string[]
Danh sách máy nhánh
call_number
string
Số gọi
hotline_ids
string[]
Danh sách hotline
call_state
enum
Trạng thái cuộc gọi (unknown answered not_answered)
date_from
string
Ngày bắt đầu (VD: "2021-03-10T17:07:19+07:00")
date_to
string
Ngày kết thúc (VD: "2021-03-10T17:07:19+07:00")
external_id
string
Lấy được khi thực hiện cuộc gọi ở web/mobile
external_session_id
string
Lấy được khi thực hiện cuộc gọi ở web/mobile
Cấu trúc thuộc tính dữ liệu trả về:
extension_id
string
Id của máy nhánh
callee
string
Số điện thoại người nhận
caller
string
Số điện thoại người gọi
direction
enum
Hướng cuộc gọi (unknown in out ext ext_in ext_out)
call_targets
array
Danh sách các máy nhánh liên quan
recording_urls
array
File ghi âm
Lưu ý:
Response trả về theo kiểu phân trang. Thông thường:
100phần tử (call logs) / trang sắp xếp theo thứ tự mới nhất, truyềnlimitnếu muốn thay đổi.Response trả về sẽ kèm theo
pagingTruyền
nextvào query stringafterở request trên sẽ lấy được trang tiếp theo, ngược lại truyềnprevvào query stringafterở request trên sẽ lấy được trang trước (nếu có).
Last updated