Lịch sử cuộc gọi

Quản lý thông tin lịch sử cuộc gọi

Danh sách

GET [URL]/api/call_transaction/list

Lấy danh sách lịch sửa cuộc gọi

Query Parameters

NameTypeDescription

agents

array

Mảng email nhân viên

is_auto_call

boolean

Bao gồm cuộc gọi tự động (true / false / NULL)

keyword

string

Từ khóa tìm kiếm

sip_user

string

Số nội bộ của nhân viên

disposition

string

Trạng thái : 'cancelled' : Không trả lời, 'answered' : Trả lời

direction

array

Hướng gọi ('outbound' : Gọi đi ; 'inbound' : Gọi đến; 'local' : Gọi nội bộ)

page

number

Trang : Bắt đầu từ 1 ( Mặc định là 1)

size

number

Số lượng record trên một trang. Mặc định 50

from_date

number

Từ ngày (Timestamp in milliseconds)

to_date

number

Đến ngày (Timestamp in milliseconds)

agents

array

Danh sách email nhân viên

queue_destination

array

Danh sách số nhóm nội bộ (Hàng đợi)

API Tổng đài >> Nhóm nội bộ

sip_numbers

array

Danh sách số hotline

user_uuids

Array

Username hoặc Usercode của bên thứ 3

Headers

NameTypeDescription

Content-type

string

application/json

Authorization

string

Access Token: Bearer 'token'

{
    "status_code": 9999,
    "instance_id": "stg",
    "instance_name": "DESKTOP-3I0NHO0",
    "payload": {
        "items": [
            {
                "transaction_id": "2159f8d9-5a6e-440f-8995-8d0f55c1xxx", // id 
                "direction": "outbound", // Loại cuộc gọi
                "source_number": "842899990338", // Số điện thoại gọi đi
                "destination_number": "0395187319", // Số điện thoại nhận
                "disposition": "answered", // answered : Trả lời, cancelled : Không trả lời
                "bill_sec": 5, // Thời lượng tính tiền
                "record_seconds" : 10, // Trả lời / không trả lời (số giây file ghi âm)
                "time_start_to_answer": 1575253218, //Thời gian bắt đầu cuộc gọi
                "recording_file": "https://drive.google.com/uc?id=6NZI5ZucJ6E-g9NcvXPU8D0&export=download", // Đường dẫn file ghi âm
                "sip_user": "142", // Số nội bộ
                "duration": 20, //Thời lượng tính từ khi bấm gọi
                "provider" : "viettel", // Nhà mạng
                "note": "Ghi chu cuoc goi",
                "tag":["hailong","dongy","vip"],
                "record_seconds": 5, // Số giây file ghi âm,
                "call_out_price": 2389, //Cước phí,
                "created_date": 1575253235933, // Ngày tạo
                "last_updated_date": 1575253239002, // Lần cập nhật cuối cùng
                "is_voicemail" : true/false, // Hộp thư thoại
                "recording_file_voicemail" : "", //File ghi âm hộp thư thoại
                "user": [ // Thông tin nhân viên
                    {
                        "full_name": "TRAN VAN TIEN",
                        "full_name_unsigned": "TRAN VAN TIEN",
                        "note" : "Ghi chú về cuộc gọi ở đây",
                        "tag" :[ // Danh sách thẻ tag cuộc gọi
                            {"name": "hailong"},
                            {"name": "dongy"},
                            {"name": "vip"}
                        ]
                    }
                ],
                "create_by":{ // Thông tin người gọi
                       "id":"6475adb3600dc522432610f0",
                       "name":"Nguyen Thi Hoa",
                       "contact_id":"6475adb0600dc522432610ef",
                       "avatar":null,
                       "gender":null,
                       "uuid":"0383459972",
                       "type":"extension"
                },
                "internal_destination":{ // Thông tin người nhận (cho gọi nội bộ)
                       "id":"6475ae1a600dc5224326111c",
                       "contact_id":"6475ae19600dc5224326111b",
                       "name":"Bui Chi Hau",
                       "uuid":"0344171555",
                       "extension":"6350",
                       "type":"extension"
                },
                "evaluations": null, // Chi tiết về ĐÁNH GIÁ cuộc gọi,
                "total_evaluate": null, // Điểm trung bình và số lần đánh giá
                "customer": { // Thông tin khách hàng
                    "full_name": "Trần Văn Tiến",
                    "full_name_unsigned": "Tran Van Tien"
                },
                "is_have_forward_out" : true, // Chuyển tiến ra sim true/false
                "bill_sec_forward_out" : 90 // Số giây chuyển tiếp ra bên ngoài 
            }
        ],
        "page_number": 1, // Trang
        "page_size": 50, // Kích thước trang
        "total_items": 943, // Tổng số records
        "total_pages": 19, // Tổng số trang
        "has_next": true,
        "next_page": 2,
        "has_previous": false,
        "previous_page": 1
    },
    "key_enabled": false
}

Mã Lỗi

Mô tả

limit_request_30_minute

Các request cách nhau 30 phút

from_date_is_required

Từ ngày là bắt buộc

to_date_is_required

Đến ngày là bắt buộc

date_invalid

Từ ngày hoặc đến ngày không hợp lệ

date_is_too_long

Khoảng cách giữa từ ngày - đến ngày : Chỉ cho phép 30 ngày

Chi tiết cuộc gọi

GET [URL]/api/call_transaction/detail/:transaction_id

Lấy thông tin chi tiết cuộc gọi

Path Parameters

NameTypeDescription

transaction_id

string

Id cuộc gọi

Headers

NameTypeDescription

Content-type

string

application/json

Authorization

string

Access token: Bearer 'token'

{
    "status_code": 9999,
    "instance_id": "stg",
    "instance_name": "cloud-vihat-saas-sync-public-api-687664b69d-69mmh",
    "payload": {
        "transaction_id": "91d3e842-9da2-43ec-8bb1-979c17e817ad",
        "direction": "outbound",
        "source_number": "842727777787",
        "destination_number": "0979816773",
        "disposition": "answered",
        "bill_sec": 232,
        "record_seconds": 232,
        "time_start_to_answer": 1589015432,
        "recording_file": "https://drive.google.com/.......",
        "sip_user": "101",
        "created_date": 1589015675440,
        "last_updated_date": 1589015678726,
        "ivr": "none",
        "call_out_price": 2389,
        "note": "Ghi chu cuoc goi", // Ghi chu cuoc goi
        "tag":["hailong","dongy","vip"], // tag cuoc goi
        "provider": "viettel",
        "duration": 242,
        "user": [
            {
                "full_name": "TestBoss 123",
                "full_name_unsigned": "TestBoss 123",
                "note" : "Ghi chú về cuộc gọi ở đây",
                "tag" :[ // Danh sách thẻ tag cuộc gọi
                    {"name": "hailong"},
                    {"name": "dongy"},
                    {"name": "vip"}
                ]
            }
        ],
        "customer": {
            "full_name": "Trần Văn Tiến 1",
            "full_name_unsigned": "Tran Van Tien 1"
        },
        "is_have_forward_out" : true, // Chuyển tiến ra sim true/false
        "bill_sec_forward_out" : 90 // Số giây chuyển tiếp ra bên ngoài 
    },
    "key_enabled": false
}

Cập nhật thông tin cuộc gọi

POST [URL]/api/call_transaction/change/:transaction_id

- Cập nhật các thông tin bổ sung cho lịch sử cuộc gọi

Path Parameters

NameTypeDescription

transaction_id

string

Id cuộc gọi

Headers

NameTypeDescription

Content-type

string

application/json

Authorization

string

Access token: Bearer 'token'

Request Body

NameTypeDescription

tag

array

Danh sách Tag được gán với lịch sử cuộc gọi Ví dụ : tag : ["hailong","goilaisau"]

note

string

Ghi chú cuộc gọi

{
    "status_code": 9999,
    "payload": {
        "transaction_id": "91d3e842-9da2-43ec-8bb1-979c17e817ad",
        "direction": "outbound",
        "source_number": "842727777787",
        "destination_number": "0979816773",
        "disposition": "answered",
        "bill_sec": 232,
        "record_seconds": 232,
        "time_start_to_answer": 1589015432,
        "recording_file": "https://drive.google.com/uc?id=1Jry_LGzQM....",
        "sip_user": "101",
        "created_date": 1589015675440,
        "last_updated_date": 1589015678726,
        "ivr": "none",
        "note": null,
        "provider": "viettel",
        "note": "Ghi chu cuoc goi",
        "tag":["hailong","dongy","vip"],
        "duration": 242,
        "user": [
            {
                "full_name": "TestBoss 123",
                "full_name_unsigned": "TestBoss 123",
                "note": "Ghi chu cuoc goi",
                "tag" :[ // Danh sách thẻ tag cuộc gọi
                    {"name": "hailong"},
                    {"name": "dongy"},
                    {"name": "vip"}
                ]
            }
        ],
        "customer": {
            "full_name": "Trần Văn Tiến 1",
            "full_name_unsigned": "Tran Van Tien 1"
        }
    }
}

Thống kê cuộc gọi

GET [URL]/api/call_transaction/report

Thống kê tổng quan lịch sử cuộc gọi

Query Parameters

NameTypeDescription

numbers

array

Danh sách đầu số

sip_user

string

Số nội bộ nhân viên

to_date

number

Đến ngày (Timestamp in milliseconds)

from_date

number

Từ ngày (Timestamp in milliseconds)

agents

array

Danh sách email nhân viên

Headers

NameTypeDescription

Authorization

string

Access token: Bearer 'token'

Content-type

string

application/json

{
    "status_code": 9999,
    "instance_id": "stg",
    "instance_name": "cloud-vihat-saas-sync-public-api-5f7c4fc9d6-vjgrb",
    "payload": {
        "categorized_by_direction": [
            {
                "_id": "inbound", // Gọi vào
                "total_count": 1051, // Số cuộc 
                "total_time": 978 // Số giây
            },
            {
                "_id": "outbound", // Gọi ra
                "total_count": 138, // Số cuộc
                "total_time": 1658 // Số giây
            }
        ],
        "categorized_by_disposition": [
            {
                "_id": "cancelled", // Gọi không trả lời
                "total_count": 1177, // Tổng số cuộc
                "total_outbound": 133, // Số cuộc gọi ra
                "total_inbound": 1044 // Số cuộc gọi vào
            },
            {
                "_id": "answered", // Gọi trả lời
                "total_count": 12, // Tổng số cuộc
                "total_outbound": 5, // Số cuộc gọi ra
                "total_inbound": 7 // Số cuộc gọi vào
            }
        ],
        "categorized_by_local_direction": { // Gọi nội bộ
            "total_call": 23,  // Tổng số cuộc
            "total_call_answer": null // Tổng số trả lời
        }
    },
    "key_enabled": false
}

Danh sách tiêu chí đánh giá cuộc gọi

GET [URL]/api/evaluation_criteria/call/list

Headers

NameTypeDescription

Authorization*

String

Access token: Bearer 'token'

Lấy danh sách chi tiết lịch sử cuộc gọi

POST https://public-v1-stg.omicall.com/api/call_transaction/search

Danh sách chi tiết lịch sử cuộc gọi, lấy chi tiết rút gọn

Dữ liệu Body truyền lên dưới định dạng JSON. Ví dụ:

{

"from_date" : 1693846799000,

"to_date" : 1696438799000,

"user_uuids" : ["0123456789"]

}

Path Parameters

NameTypeDescription

page

int

Page cần get (= 1)

size

int

Số phần tử trong trang (max 50 item)

Headers

NameTypeDescription

x-api-key*

String

API key

Content-Type*

String

application/json

Request Body

NameTypeDescription

from_date*

String

Thời gian bắt đầu lấy log (milisecond)

to_date*

String

Thời gian kết thúc lấy log (milisecond)

user_uuids*

List<String>

Danh sách user UUID

direction

List<String>

Hướng gọi ("inbound", "outbound", "local")

disposition

List<String>

Trạng thái trả lời/không trả lời ("answered", "cancelled")

tags

List<String>

Danh sách ID tags

numbers

List<String>

Danh sách đầu số

// sample data
{
  "instance_id": "stg",
  "payload": {
    "items": [
      {
        "_id": "123400000000000000000000",
        "created_date": 946659600000,
        "last_updated_date": 946659600000,
        "create_by": {
          "id": "123400000000000000000000",
          "name": "Lorem ipsum dolor sit amet.",
          "contact_id": "123400000000000000000000",
          "type": "agent",
          "extension": "0123456"
        },
        "tenant_id": "123400000000000000000000",
        "transaction_id": "7125081d-288a-4d35-8eb1-012345678912",
        "direction": "local",
        "source_number": "0123456",
        "destination_number": "0123456",
        "disposition": "cancelled",
        "duration": 28,
        "bill_sec": 0,
        "record_seconds": 0,
        "time_start_call": 9466596000,
        "time_end_call": 9466596000,
        "time_start_to_answer": 9466596000,
        "ms_time_start_to_answer": 946659600000,
        "time_start_media": 9466596000,
        "wait_sec": 0,
        "hold_call_sec": 0,
        "hangup_cause": "ORIGINATOR_CANCEL",
        "hangup_cause_q850": 16,
        "customer": {
          "_id": "649e981afd4c703b39692f5f",
          "full_name": "Lorem ipsum dolor sit amet.",
          "full_name_unsigned": "Lorem ipsum dolor sit amet.",
          "uuid": "0123456789",
          "type": "extension",
          "extension": "0123456"
        },
        "user": [
          {
            "_id": "123400000000000000000000",
            "full_name": "Lorem ipsum dolor sit amet.",
            "full_name_unsigned": "Lorem ipsum dolor sit amet.",
            "tags_view": [],
            "note_created_date": 1696421425598
          }
        ],
        "sip_user": "0123456",
        "is_stop_ivr": false,
        "ivr": "none",
        "is_have_forward_out": false,
        "is_auto_call": false,
        "is_deleted": false,
        "rtp_audio_in_mos": 4.5,
        "is_callbot": false,
        "dial_status": "CANCEL",
        "answer_sec": 0,
        "domain_fusion": "Lorem ipsum dolor sit amet.",
        "sip_from_user": "1000071",
        "nation": "vn",
        "is_ai": false,
        "domain": "Lorem ipsum dolor sit amet.",
        "playback_seconds": 0,
        "pbx_type": "",
        "is_trunk": false,
        "suspicious_checked": false,
        "is_missed_call": false,
        "is_analyzed": false,
        "internal_destination": {
          "id": "123400000000000000000000",
          "contact_id": "649e981afd4c703b39692f5f",
          "name": "Lorem ipsum dolor sit amet.",
          "uuid": "0123456789",
          "extension": "0123456",
          "type": "extension"
        }
      }
    ],
    "pageNumber": 1,
    "pageSize": 20,
    "totalItems": 1000,
    "totalPages": 100,
    "hasNext": true,
    "nextPage": 2,
    "hasPrevious": false,
    "previousPage": 1
  },
  "instance_version": "1.0.0",
  "key_enabled": false,
  "status_code": 9999
}

Đánh giá cuộc gọi theo tiêu chí

POST [URL]/api/call_transaction/add_evaluation/:transaction_id

Path Parameters

NameTypeDescription

transaction_id*

String

Transaction Id cuộc gọi

Request Body

NameTypeDescription

user_uuid*

String

Id của User bên thứ 3 hoặc Số máy lẻ trong hệ thống

evaluation*

Object

Đối tượng chưa thông tin đánh giá, json format như sau

(Format như ảnh bên dưới )

Last updated