v1

API Khách hàng version 1

Tìm kiếm khách hàng

POST [URL]/api/contacts/list

Tìm kiếm khách hàng

Query Parameters

Name
Type
Description

page

interger

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

size

interger

Kích thước trang. Mặc định là 50

Headers

Name
Type
Description

Content-type

string

application/json

Authorization

string

Bearer "Access token"

Request Body

Name
Type
Description

keyword

string

Từ khóa tìm kiếm. Có thể một trong các giá trị

  • Số điện thoại

  • Email

  • Họ và tên

filters

Array

Lọc "filters": [ { "field_code" : "contact_owner", // Người phụ trách "value":[

"unassigned", // chưa gán

"[email protected]" // Email nhân nhân viên

]

} ]

{
    "instance_id": "stg",
    "payload": {
        "items": [
            {
                "transaction_id": "09d43196-4ec7-4fba-80fe-c6aa1f3760b8",
                "tenant_id": "6391feada745be2a6aa18006",
                "direction": "outbound",
                "source_number": "84288xxxx",
                "destination_number": "0393xxx",
                "disposition": "answered",
                "bill_sec": 8,
                "record_seconds": 6,
                "time_start_to_answer": 1747128857,
                "recording_file": "/...",
                "recording_file_url": "...",
                "recording_data": null,
                "sip_user": "101",
                "created_date": 1747128866529,
                "last_updated_date": 1747128877414,
                "is_auto_call": false,
                "ivr": "none",
                "provider": "viettel",
                "duration": 9,
                "user": [
                    {
                        "full_name": "SenBac",
                        "full_name_unsigned": "senbac",
                        "note": "Số test",
                        "tag": [
                            {
                                "name": "Đã gọi"
                            }
                        ]
                    }
                ],
                "customer": null,
                "state": null,
                "call_uuid": null,
                "from_number": null,
                "to_number": null,
                "hotline": null,
                "is_have_forward_out": false,
                "bill_sec_forward_out": 0,
                "call_out_price": 106.664,
                "note": "Số test",
                "tag": [
                    "Đã gọi"
                ],
                "invite_failure_status": null,
                "answer_sec": 6,
                "autocall_uuid": null,
                "autocall_id": null,
                "sip_number": "84288xxxx",
                "phone_number": "0393xxx",
                "create_by": {
                    "id": "639202a8bf054d579109b35e",
                    "name": "SenBac",
                    "contact_id": "639202a8bf054d579109b35d",
                    "avatar": null,
                    "gender": null,
                    "uuid": null,
                    "type": "agent"
                },
                "transfer_histories": [],
                "user_data_str": null,
                "user_ref_code": null,
                "endby_name": "end_call_by_customer",
                "hangup_cause": "NORMAL_CLEARING",
                "sip_hangup_disposition": "send_bye",
                "hangup_cause_q850": null,
                "is_voicemail": false,
                "recording_file_voicemail": null,
                "domain_fusion": "demo20",
                "send_num_retry": 0,
                "time_start_call": 1747128857,
                "time_end_call": 1747128866,
                "out_of_working_time": false,
                "sip_number_tags": [],
                "evaluations": null,
                "total_evaluate": null,
                "internal_destination": null,
                "classifies": null,
                "collect_info_variables": null,
                "sip_number_forward_out": null,
                "is_same_network": false,
                "is_same_network_forward_out": false,
                "provider_of_number": "digitel",
                "provider_of_number_forward_out": null,
                "callbot_script_id": null,
                "criteria": null
            }
        ],
        "page_number": 1,
        "page_size": 1,
        "total_items": 265,
        "total_pages": 265,
        "has_next": true,
        "next_page": 2,
        "has_previous": false,
        "previous_page": 1,
        "extension": null
    },
    "instance_version": "1.2.164",
    "key_enabled": false,
    "status_code": 9999
}

Tạo mới khách hàng

POST [URL]/api/contacts/add

Tạo mới khách hàng

Headers

Name
Type
Description

Content-type

string

application/json

Authorization

string

Bearer "Access token"

Request Body

Name
Type
Description

tags

array

Danh sách thẻ tags Ví dụ : "tags" : ["Khách lẻ", "Khách có nhu cầu"]

more_infomation

array

Thông tin trường tùy chỉnh Ví dụ [ {value_type : "Cao", display_value: "1.75m"}, {value_type:"Nặng", display_value : "75kg"} {value_type:"Điểm", display_value: "90"} ]

user_owner_email

string

Email nhân viên phụ trách

refId

string

Id của khách hàng bên đối tác

refCode

string

Mã của khách hàng bên đối tác

job_title

string

Công việc / chức vụ của khách hàng

note

string

Ghi chú về khách hàng

birthday

string

Ngày tháng năm sinh, định dạng : (dd/MM/yyyy)

gender

string

Giới tính gồm ( 'other' : Giới tính khác; 'male' : Nam; 'female' : Nữ)

fullName

string

Họ và tên

passport

string

Hộ chiếu hoặc Id card

address

string

Địa chỉ

emails

array

Danh sách đối tượng EMAIL Ví dụ : [{ data: "[email protected]", type : "home", // home, personal, office valueType: "Nhà" // Nhà, Cá nhân, Công ty }]

phones

array

Danh sách đối tượng PHONE Ví dụ : [{ data: "02525485xxx", type : "home", // home, personal, office valueType : "Nhà" // Nhà, Cá nhân, Công ty }]

Tạo nhiều khách hàng

POST [URL/api/contacts/add-more

Tạo danh nhiều khách hàng, Request Body là array Object đối tượng khách hàng lúc tạo mới. API xử lý bất đồng bộ

Headers

Name
Type
Description

Content-type

string

application/json

Authorization

string

Bearer "Access token"

Sửa thông tin khách hàng

POST [URL]/api/contacts/update

Sửa thông tin khách hàng

Headers

Name
Type
Description

Content-type

string

application/json

Authorization

string

Bearer "Access token"

Request Body

Name
Type
Description

tags

array

Danh sách thẻ tags Ví dụ : "tags" : ["Khách lẻ", "Khách có nhu cầu"]

refId

string

Id khách hàng

birthday

string

Ngày tháng năm sinh: định dạng (dd/MM/yyyy)

more_infomation

array

Thông tin trường tùy chỉnh [ {"value_type":"Điểm","display_value":"20"}, {"value_type":"Đơn","display_value":"10"}, {"value_type":"Tiền","display_value":"500000"} ]

user_owner_email

string

Email người phụ trách

fullName

string

Họ và tên

gender

string

Giới tính ('other' : Giới tính khác; 'male' : Nam; 'female' : Nữ)

gender

string

Giới tính gồm ( 'other' : Giới tính khác; 'male' : Nam; 'female' : Nữ)

passport

string

Hộ chiếu hoặc id card

address

string

Địa chỉ

note

string

Ghi chú

emails

array

Danh sách đối tượng EMAIL Ví dụ : [{ data: "[email protected]", type : "home", // home, personal, office valueType: "Nhà" // Nhà, Cá nhân, Công ty }]

phones

array

Danh sách đối tượng PHONE Ví dụ : [{ data: "02525485xxx", type : "home", // home, personal, office valueType : "Nhà" // Nhà, Cá nhân, Công ty }]

dynamic_attributes

array

Danh sách thuộc tính động

Ví dụ : [{ field_code: "vWabCEBkqM", field_type: "single_text",

dynamic_attribute_value:[{

display_value: "demo"

}] }]

Xóa khách hàng

DELETE [URL]/api/contacts/delete/:id

Xóa khách hàng thông qua Id

Path Parameters

Name
Type
Description

id

string

Id khách hàng

Headers

Name
Type
Description

Content-type

string

application/json

Authorization

string

Bearer "Access token"

Tạo tương tác ghi chú

POST [URL]/api/contacts/add-note

Tạo nhiều tương tác. Request Body là Mảng đối tượng chứa các thuộc tính bên dưới

Request Body

Name
Type
Description

note_by

string

Email nhân viên

content*

string

Nội dung ghi chú

phone*

string

Số điện thoại khách hàng

GET [URL]/api/contacts/get

Query Parameters

Name
Type
Description

phone

string

Số điện thoại

email

string

Email

ref_id

string

Id bên thứ 3

ref_code

string

Mã bên thứ 3

Lấy thông tin chi tiết của một khách hàng

GET [URL]/api/contacts/details/:id

Lấy thông tin chi tiết của một khách hàng

Path Parameters

Name
Type
Description

id

string

Id contact

Lấy danh sách các thuộc tính động

GET [URL]/api/source_contact_layout/get

Lấy danh sách thuộc tính động

Last updated