# Overview

### Hỗ trợ

Trường hợp bạn cần hỗ trợ hướng dẫn tích hợp hoặc chưa rõ các thông số trên tài liệu, hãy liên hệ với đội ngũ Tech của OMI qua Live Chat hoặc Hotline . Vui lòng cung cấp **Email chủ doanh nghiệp**, để đội ngũ biết&#x20;

{% hint style="success" %} <mark style="color:purple;">**Hỗ trợ tích hợp (Live Chat)**</mark> <mark style="color:purple;"></mark><mark style="color:purple;">:</mark> [<mark style="color:purple;">**https://omicrm.com**</mark>](https://omicrm.com/?lng=vi)
{% endhint %}

**HƯỚNG DẪN TÍCH HỢP OMICALL API CƠ BẢN**&#x20;

* **Xác thực**

{% hint style="info" %}
Mỗi DN sẽ có 1 API KEY . Dùng API KEY để lấy AccessToken.&#x20;

Access Token sẽ có giá trị trong vòng 24h. Hết hạn thì tiến hành lấy lại

LẤY API KEY và XÁC THỰC

<https://api.omicall.com/omicall-api/overview>

<https://api.omicall.com/omicall-api/authentication>
{% endhint %}

* **Tạo mới nhân viên , tạo mới tổng đài cho nhân viên**

{% hint style="success" %}
Mỗi nhân viên được định danh trong hệ thống qua&#x20;

số NỘI BỘ / EXTENSION / MÁY NHÁNH

Mỗi nhân viên sẽ có 3 giá trị để xác thực với tổng đài&#x20;

* **domain** : Domain tổng đài của doanh nghiệp
* **username** : Mã máy nhánh ví dụ : 101, 102, 103 ...&#x20;
* **password** : Mật khẩu máy nhánh&#x20;

Dùng API bên dưới để tạo 1 nhân viên, OMI sẽ response về thông tin tổng đài cho 1 nhân viên, bên thứ 3 có thể lưu vào hệ thống

<https://api.omicall.com/omicall-api/agent>

API : /api/agent/invite

Hoặc : Nếu nhân viên đã có ở OMI, mà không cần tạo mới thì có thể lấy dữ liệu tổng đài  qua API

<https://api.omicall.com/omicall-api/call-center>
{% endhint %}

* **Tích hợp WebSDK nghe và gọi trên phần mềm thứ 3**

{% hint style="success" %}
Sau khi có được 3 thông số : domain, username, password ở Bước 2

Tiến hành tích hợp websdk và điền 3 thông số trên vào WebSDK để nghe và gọi

WebSDK: <https://api.omicall.com/web-sdk/overview>

**Chú ý** : *Develop trên localhost có thể không cần https, nhưng khi đưa lên production bắt buộc phải là https (vì chỉ https mới mở được micro, sound trên trình duyệt)*
{% endhint %}

* **Nhận dữ liệu cuộc gọi**

{% hint style="success" %}
Sau khi kết thúc cuộc gọi, có thể lấy data cuộc gọi thông qua 2 cơ chế

**Webhook** : Nhận data cuộc gọi chủ động, lưu bên thứ 3

<https://api.omicall.com/webhooks/call-hooks>

API lịch sử : Nhận dữ liệu qua API của OMICall

<https://api.omicall.com/omicall-api/call-transaction>

{% endhint %}

{% content-ref url="/pages/-LukE1RTFP6cJw5d69dx" %}
[OMICALL API](/omicall-api/overview)
{% endcontent-ref %}

{% content-ref url="/pages/-LukE3LS4sZV7TpS6BQ7" %}
[WEBHOOKS](/webhooks/overview)
{% endcontent-ref %}

{% content-ref url="/pages/-LuksU4U5HAVPC8PiwrV" %}
[Web SDK](/sdk/web-sdk)
{% endcontent-ref %}


# Tổng quan

```
URL : https://public-v1-stg.omicall.com
Version : 2.1.03
Last Updated : 25/04/2021
```

## API Key

Đăng ký tài khoản tại : [https://sso.omicall.io/](https://sso.omicrm.com/)

* Truy cập **Tài khoản > Cấu hình > Quản lý API**
* Tạo Api key cho doanh nghiệp, yêu cầu và thu hồi

![Cấu hình >> Tích hợp >> API](https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2F0OhCmfDDSO00MPhwwOko%2FScreen%20Shot%202022-07-19%20at%2010.11.30%20PM.png?alt=media\&token=6b8d37d9-6859-4dcf-a8eb-ed3e91b903c6)

**Thuật ngữ và loại dữ liệu dùng trong OMI**

| Thuật ngữ         | Mô tả                                                                                                            |
| ----------------- | ---------------------------------------------------------------------------------------------------------------- |
| **OMICALL\_API**  | Hệ thống cho phép đối tác thao tác với dữ liệu của mình trên OMI thông qua API                                   |
| **ACCESS\_TOKEN** | Là token mà OMI cung cấp cho đối tác, để thao tác với OMICALL API. Token sẽ có thời gian timeout là **24** (giờ) |
| **API\_KEY**      | Là khóa định danh API cho mỗi doanh nghiệp, dùng để kết nối với OMICALL. Dùng API Key để lấy Access Token        |

**RESPONSE**

| STT | Code             | Type    | Description                                                                                         |
| --- | ---------------- | ------- | --------------------------------------------------------------------------------------------------- |
| 1   | **status\_code** | Integer | <p><strong>9999</strong> : Thao tác thành công</p><p><strong>-9999</strong> : Thao tác thất bại</p> |
| 2   | **message**      | String  | Mã lỗi hoặc thông báo lỗi                                                                           |
| 3   | **payload**      | Object  | Dữ liệu trả về sau xử lý                                                                            |

**ERROR CODE**

| Code                      | Description                                     |
| ------------------------- | ----------------------------------------------- |
| *api\_key\_is\_required*  | API Key là bắt buộc                             |
| *api\_key\_invalid*       | API Key không hợp lệ                            |
| *request\_body\_required* | Thiếu request body trong dữ liệu truyền lên api |

**DANH SÁCH TỐC ĐỘ ĐỌC AI BOT**

```
[
    {
        "label": "Bình thường",
        "value": 1
    },
    {
        "label": "Nhanh",
        "value": 0.8
    },
    {
        "label": "Nhanh vừa",
        "value": 0.9
    },
    {
        "label": "Chậm",
        "value": 1.2
    },
    {
        "label": "Chậm vừa",
        "value": 1.1
    }
]
```

**DANH SÁCH GIỌNG ĐỌC AI BOT**

```
[
  {
    "label": "Ngọc Anh",
    "value": "northern_female_ngocanh",
    "gender": "female",
    "region": "northern"
  },
  {
    "label": "Tiến Huy",
    "value": "southern_male_tienhuy",
    "gender": "male",
    "region": "southern"
  },
  {
    "label": "Anh Kiệt",
    "value": "northern_male_anhkiet",
    "gender": "male",
    "region": "northern"
  },
  {
    "label": "Khả Ngân",
    "value": "southern_female_khangan",
    "gender": "female",
    "region": "southern"
  }
]

```


# Xác thực

API dùng để lấy access token thông qua API KEY được cung cấp. AcessToken là chuỗi mã hóa chứa thông tin của doanh nghiệp, có thời gian hết hạn là 24 giờ

## Get AccessToken

<mark style="color:blue;">`GET`</mark> `[URL]/api/auth?apiKey=`

Lấy Access Token thông qua API KEY

#### Query Parameters

| Name   | Type   | Description                            |
| ------ | ------ | -------------------------------------- |
| apiKey | string | API key của doanh nghiệp được cung cấp |

#### Headers

| Name                                           | Type   | Description      |
| ---------------------------------------------- | ------ | ---------------- |
| Content-Type<mark style="color:red;">\*</mark> | string | application/json |

{% tabs %}
{% tab title="200 Khi yêu cầu API thành công" %}

```
{
    "status_code": 9999,
    "instance_id": "stg",
    "instance_name": "cloud-vihat-saas-sync-public-api-77689c7b9c",
    "payload": {
        "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9 ...",
        "access_type" : "normal",
        "token_type": "Bearer"
    },
    "key_enabled": false
}
```

{% endtab %}
{% endtabs %}

**Thông tin kết quả trả về payload**

| Tham số       | Mô tả                                                                                                                                                              |
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| access\_token | Access token truy cập                                                                                                                                              |
| access\_type  | <p>Có 2 loại </p><ul><li><strong>normal</strong> : Doanh nghiệp người dùng cuối</li><li><strong>bussiness</strong> : Doanh nghiệp là đối tác của OMICALL</li></ul> |
| token\_type   | Bearer                                                                                                                                                             |


# Doanh nghiệp

Quản lý doanh nghiệp

## Thông tin chi tiết

<mark style="color:blue;">`GET`</mark> `[URL]/api/tenant/detail`

Thông tin chi tiết doanh nghiệp

#### Headers

| Name          | Type   | Description         |
| ------------- | ------ | ------------------- |
| Authorization | string | Bearer Access Token |

{% tabs %}
{% tab title="200 Thông tin chi tiết doanh nghiệp" %}

```
{
    "status_code": 9999,
    "instance_id": "stg",
    "instance_name": "DESKTOP-1OB3SFM",
    "payload": {
        "full_name": "Omi Team",
        "email": "support@omicrm.com",
        "description": "Nâng cao trải nghiệm khách hàng, lấy sự hài lòng của khách hàng làm tiêu chí phấn đấu của doanh nghiệp",
        "enabled": true, //Đang hoạt động hoặc ngưng hoạt động
        "domain": "omiteam", // Tên miền truy cập OMI
        "domain_fusion": "omiteam", // Tên miền tổng đài
        "domain_expire": 1584606068154, // Ngày hết hạn domain
        "effective_date": 1583396482840, // Ngày kích hoạt
        "expire_date": 1614936981790, // Ngày hết hạn
        "phone": "0844441900", // SĐT chủ doanh nghiệp
        "status": "activated", // Trạng thái: Đã kích hoạt / Chưa kích hoạt
        "paid_type": "prepaid", // Hình thức thanh toán : prepaid : Trả trước, postpaid : Trả sau
        "nation": "vn", // Quốc gia
        "currency": "VND", // Tiền tệ
        "language": "vi", // Ngôn ngữ
        "balance": 3007855, // Số dư tài khoản
        "public_numbers": [
            {
                "number": "842877788056", // Số hotline
                "provider": "itel", // Nhà mạng
                "expire_date": 1602731734809, //Ngày hết hạn số
                "status": "active" // Tình trạng số
            }
        ],
        "service_package": {
            "code_name": "trial", // Mã gói
            "service_name": "Trial", // Tên gói
            "staff_num": 5, // Số lượng nhân viên
            "customer_num": 100, // Số lượng khách hàng
            "expiry_date": 1606300035002 // Ngày gói hết hạn
        }
    },
    "key_enabled": false
}
```

{% endtab %}
{% endtabs %}

## Danh sách phân quyền

<mark style="color:green;">`POST`</mark> `[URL]/api/tenant/role/list`

Danh sách phân quyền nhân viên của doanh nghiệp

#### Headers

| Name          | Type   | Description         |
| ------------- | ------ | ------------------- |
| Authorization | string | Bearer Access Token |

#### Request Params

| Name | Type    | Description                                   |
| ---- | ------- | --------------------------------------------- |
| page | Integer | Số thứ tự trang                               |
| size | Integer | Số lượng data lấy về trong 1 trang. Từ 1 - 50 |

#### Request Body

| Name    | Type   | Description      |
| ------- | ------ | ---------------- |
| keyword | string | Keyword tìm kiếm |

{% tabs %}
{% tab title="200 Danh sách phân quyền" %}

```
{
    "instance_id": "stg",
    "payload": {
        "items": [
            {
                "_id": "6732dc3d827b8d5c308bcc7c", // id phân quyền
                "name": "Sale", // tên phân quyền
                "name_unsigned": "sale",
                "description": ""
            },
            ...
        ],
        "page_number": 1,
        "page_size": 10,
        "total_items": 5,
        "total_pages": 1,
        "has_next": false,
        "next_page": 1,
        "has_previous": false,
        "previous_page": 1,
        "extension": null
    },
    "instance_version": "1.2.164",
    "key_enabled": false,
    "status_code": 9999
}
```

{% endtab %}
{% endtabs %}

## Danh sách gói dịch vụ

<mark style="color:blue;">`GET`</mark> `[URL]/api/tenant/service_package_tenant_v2/user/list`

Danh sách các gói dịch vụ cá nhân chưa được gán cho nhân viên

#### Headers

| Name          | Type   | Description         |
| ------------- | ------ | ------------------- |
| Authorization | string | Bearer Access Token |

{% tabs %}
{% tab title="200 Danh sách gói dịch vụ" %}

```
{
    "instance_id": "stg",
    "payload": [
        {
            "service_name": "OMNI Channel AI", // Tên gói
            "service_code": "omni_channel_ai", // Mã gói
            "ids": [ // danh sách id các gói khả dụng
                "67a4789e19a6ca32cbc4ca08",
                "67a4789e19a6ca32cbc4ca0c",
                "67a4789e19a6ca32cbc4ca0e",
                "67a4789e19a6ca32cbc4ca10",
                "67a4789e19a6ca32cbc4ca12"
            ],
            "agency": "omicrm.com",
            "total": 5 // tổng gói khả dụng
        },
        ...
    ],
    "instance_version": "1.2.164",
    "key_enabled": false,
    "status_code": 9999
}
```

{% endtab %}
{% endtabs %}


# Nhân viên

## Danh sách nhân viên

<mark style="color:blue;">`GET`</mark> `[URL]/api/agent/list`

Danh sách nhân viên của doanh nghiệp

<mark style="color:$primary;">\*</mark> <mark style="color:$primary;">Tạm dừng cập nhật từ ngày 01/04/2026, vui lòng sử dụng</mark> [<mark style="color:$primary;">API v3</mark>](https://api.omicall.com/omicall-api/nhan-vien#danh-sach-nhan-vien-v3)

#### Query Parameters

<table><thead><tr><th width="246">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>page</td><td>number</td><td>Page (mặc định là 1)</td></tr><tr><td>size</td><td>number</td><td>Size (kích thước trang) : mặc định là 50</td></tr><tr><td>keyword</td><td>string</td><td>Từ khóa tìm kiếm <br>- Họ và tên<br>- Email<br>- SĐT</td></tr></tbody></table>

#### Headers

| Name          | Type   | Description                  |
| ------------- | ------ | ---------------------------- |
| Authorization | string | Access token, Bearer 'token' |

{% tabs %}
{% tab title="200 Danh sách nhân viên" %}

```
{
    "status_code": 9999,
    "instance_id": "stg",
    "instance_version": "1.1.951",
    "payload": {
        "next_page": 2,
        "page_number": 1,
        "has_previous": false,
        "has_next": true,
        "total_pages": 3,
        "previous_page": 1,
        "items": [
            {
                "create_by": {
                    "name": "Omi Team"
                },
                "last_update_by": {
                    "name": "Omi Team"
                },
                "created_date": 1611889185166,
                "last_updated_date": 1611889185446,
                "public_id": null,
                "contact_type": "agent",
                "tags_view": [],
                "is_deleted": false,
                "tags": [],
                "is_active": true,
                "identify_info": "vietnam1@gmail.com",
                "attribute_structure": [
                    {
                        "identify": null,
                        "field_code": "full_name",
                        "field_type": "single_text",
                        "value": [
                            {
                                "display_value": "Tran Van Tien",
                                "data_type": "single_text",
                                "value_type": null
                            }
                        ]
                    },
                    {
                        "identify": null,
                        "field_code": "mail",
                        "field_type": "email",
                        "value": [
                            {
                                "display_value": "vietnam1@gmail.com",
                                "data_type": "personal",
                                "value_type": "Cá nhân"
                            }
                        ]
                    },
                    {
                        "identify": null,
                        "field_code": "gender",
                        "field_type": "radio",
                        "value": [
                            {
                                "display_value": "male",
                                "data_type": "male",
                                "value_type": "Nam"
                            }
                        ]
                    },
                    {
                        "identify": null,
                        "field_code": "phone_number",
                        "field_type": "phone",
                        "value": [
                            {
                                "display_value": null,
                                "data_type": "personal",
                                "value_type": "Cá nhân"
                            }
                        ]
                    }
                ]
            },
            {
                "create_by": {
                    "name": "Omi Team"
                },
                "last_update_by": {
                    "name": "Omi Team"
                },
                "created_date": 1608024393791,
                "last_updated_date": 1608024393791,
                "public_id": null,
                "contact_type": "agent",
                "tags_view": [],
                "is_deleted": false,
                "tags": [],
                "is_active": false,
                "identify_info": "hanhttm@vihat.vn",
                "attribute_structure": [
                    {
                        "identify": null,
                        "field_code": "full_name",
                        "field_type": "single_text",
                        "value": [
                            {
                                "display_value": "hanhttm",
                                "data_type": "single_text",
                                "value_type": null
                            }
                        ]
                    },
                    {
                        "identify": null,
                        "field_code": "mail",
                        "field_type": "email",
                        "value": [
                            {
                                "display_value": "hanhttm@vihat.vn",
                                "data_type": "personal",
                                "value_type": "Cá nhân"
                            }
                        ]
                    },
                    {
                        "identify": null,
                        "field_code": "gender",
                        "field_type": "radio",
                        "value": [
                            {
                                "display_value": "male",
                                "data_type": "male",
                                "value_type": "Nam"
                            }
                        ]
                    },
                    {
                        "identify": null,
                        "field_code": "phone_number",
                        "field_type": "phone",
                        "value": [
                            {
                                "display_value": null,
                                "data_type": "personal",
                                "value_type": "Cá nhân"
                            }
                        ]
                    }
                ]
            },
            {
                "create_by": {
                    "name": "Omi Team"
                },
                "last_update_by": {
                    "name": "Omi Team"
                },
                "created_date": 1607393421623,
                "last_updated_date": 1607393452508,
                "public_id": null,
                "contact_type": "agent",
                "tags_view": [],
                "is_deleted": false,
                "tags": [],
                "is_active": true,
                "identify_info": "minhnh@vihatgroup.com",
                "attribute_structure": [
                    {
                        "identify": null,
                        "field_code": "full_name",
                        "field_type": "single_text",
                        "value": [
                            {
                                "display_value": "minhnh",
                                "data_type": "single_text",
                                "value_type": null
                            }
                        ]
                    },
                    {
                        "identify": null,
                        "field_code": "mail",
                        "field_type": "email",
                        "value": [
                            {
                                "display_value": "minhnh@vihatgroup.com",
                                "data_type": "personal",
                                "value_type": "Cá nhân"
                            }
                        ]
                    },
                    {
                        "identify": null,
                        "field_code": "gender",
                        "field_type": "radio",
                        "value": [
                            {
                                "display_value": "male",
                                "data_type": "male",
                                "value_type": "Nam"
                            }
                        ]
                    },
                    {
                        "identify": null,
                        "field_code": "phone_number",
                        "field_type": "phone",
                        "value": [
                            {
                                "display_value": null,
                                "data_type": "personal",
                                "value_type": "Cá nhân"
                            }
                        ]
                    }
                ]
            }
        ],
        "total_items": 9,
        "page_size": 3
    },
    "key_enabled": false
}
```

{% endtab %}
{% endtabs %}

## Danh sách nhân viên (v3)

<mark style="color:green;">`POST`</mark> `[URL]/api/v3/agent/search?page=1&size=50`

Lấy danh sách nhân viên

#### Headers

| Name                                        | Type   | Description |
| ------------------------------------------- | ------ | ----------- |
| x-api-key<mark style="color:red;">\*</mark> | String | API Key     |

#### Request Params

| Name | Type    | Description                                              |
| ---- | ------- | -------------------------------------------------------- |
| page | Integer | Thứ tự phân trang, bắt đầu bằng 1                        |
| size | Integer | Giới hạn số lượng phân tử của danh sách trả về, max = 50 |

#### Request Body (optional)

| Name              | Type    | Description                           |
| ----------------- | ------- | ------------------------------------- |
| filter.emails     | Array   | Danh sách email nhân viên             |
| filter.phones     | Array   | Danh sách số điện thoại của nhân viên |
| filter.extensions | Array   | Danh sách số nội bộ                   |
| sort.field        | String  | Field cần sort                        |
| sort.isAsc        | Boolean | Thứ tự sort                           |

{% tabs %}
{% tab title="200 OK" %}

```json
{
  "instance_id": "stg",
  "payload": {
    "items": [
      {
        "_id": "6487dbeb1a309849f72056ad", // id nhân viên
        "create_by": {"name": "nhanvien1"},
        "last_update_by": {"name": "Admin"},
        "created_date": 1686625259248,
        "last_updated_date": 1773278136166,
        "public_id": null,
        "contact_type": "agent",
        "tags_view": [],
        "is_deleted": false,
        "tags": [],
        "is_active": true,
        "identify_info": "abc@gmail.com",
        "user_owner_email": null,
        "attribute_structure": [
          {
            "identify": null,
            "field_code": "full_name",
            "field_type": "single_text",
            "value": [
              {
                "display_value": "nhanvien1", // tên nhân viên
                "data_type"    : null,
                "value_type"   : null
              }
            ]
          },
          {
            "identify": null,
            "field_code": "mail",
            "field_type": "email",
            "value": [
              {
                "display_value": "abc@gmail.com", // email nhân viên
                "data_type"    : "personal",
                "value_type"   : null
              }
            ]
          },
          {
            "identify": null,
            "field_code": "gender",
            "field_type": "radio",
            "value": [
              {"display_value": "male", "data_type": null, "value_type": null} // giới tính
            ]
          },
          {
            "identify": null,
            "field_code": "phone_number",
            "field_type": "phone",
            "value": [
              {
                "display_value": "0123456789", // số điện thoại nhân viên
                "data_type"    : "personal",
                "value_type"   : null
              }
            ]
          },
          {
            "identify": null,
            "field_code": "avatar",
            "field_type": "image",
            "value": [
              {
                "display_value": "image.jpg", // avatar
                "data_type": null,
                "value_type": null
              }
            ]
          },
          {
            "identify": null,
            "field_code": "job_title",
            "field_type": "single_text",
            "value": [
              {"display_value": "", "data_type": null, "value_type": null}
            ]
          },
          {
            "identify": null,
            "field_code": "passport",
            "field_type": "single_text",
            "value": [
              {"display_value": "", "data_type": null, "value_type": null}
            ]
          },
          {
            "identify": null,
            "field_code": "address",
            "field_type": "single_text",
            "value": [
              {"display_value": "", "data_type": null, "value_type": null}
            ]
          },
          {
            "identify": null,
            "field_code": "more_infomation",
            "field_type": "customize",
            "value": []
          },
          {
            "identify": null,
            "field_code": "note",
            "field_type": "multi_text",
            "value": [
              {
                "display_value": "hvhvjbi",
                "data_type"    : null,
                "value_type"   : null
              }
            ]
          },
          {
            "identify": null,
            "field_code": "birthday",
            "field_type": "date",
            "value": [
              {"display_value": "", "data_type": null, "value_type": null}
            ]
          }
        ]
      }
    ],
    "page_number": 1,
    "page_size": 50,
    "total_items": 46,
    "total_pages": 1,
    "has_next": false,
    "next_page": 1,
    "has_previous": false,
    "previous_page": 1,
    "extension": null,
    "max_size": null
  },
  "instance_version": "1.2.164",
  "key_enabled": false,
  "status_code": 9999
}

```

{% endtab %}

{% tab title="Sample request body" %}

```json
{
    "filter": {
        "emails": ["abc@gmail.com"]
    },
    "sort": {
        "field": "created_date",
        "isAsc": false
    }
}
```

{% endtab %}
{% endtabs %}

## Mời nhân viên

<mark style="color:green;">`POST`</mark> `[URL]/api/agent/invite`

Mời nhân viên sử dụng tổng đài

#### Headers

| Name          | Type   | Description                   |
| ------------- | ------ | ----------------------------- |
| Authorization | string | Access token : Bearer 'token' |

#### Request Body

| Name            | Type   | Description                                                                                                                                                                                                                                                               |
| --------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| owner\_email    | string | Email nhân viên phụ trách                                                                                                                                                                                                                                                 |
| role\_name      | string | <p>Quyền . Mặt định là Sale<br>-  Sale<br>-  Trưởng nhóm sale<br>- Trưởng phòng Kinh Doanh<br>- Kế toán<br>- Giám đốc</p>                                                                                                                                                 |
| password        | string | Mật khẩu đăng nhập, khởi tạo ban đầu                                                                                                                                                                                                                                      |
| identify\_info  | string | Email định danh                                                                                                                                                                                                                                                           |
| full\_name      | string | Họ và tên nhân viên                                                                                                                                                                                                                                                       |
| uuid            | String | Mã user định danh từ bên thứ 3                                                                                                                                                                                                                                            |
| call\_timeout   | String | Thời gian chờ của nhân viên khi cuộc gọi chuyển tiếp tới                                                                                                                                                                                                                  |
| target\_forward | Object | <p>Kịch bản khi nhân viên không nghe máy hoặc không trực tuyến</p><p>{</p><p>    "target\_value":"", </p><p>     "target\_type":"" </p><p>}</p><p>target\_value : ID của thành phần </p><p>target\_type : Một trong các Type sau : </p><p>greeting : Lời chào báo bận</p> |
| group\_name     | String | Tên nhóm nhân viên                                                                                                                                                                                                                                                        |

{% tabs %}
{% tab title="200 Thông tin nhân viên " %}

```
{
    "status_code": 9999,
    "instance_id": "stg",
    "instance_name": "DESKTOP-1OB3SFM",
    "payload": {
        "agent": { // Thông tin nhân viên
            "full_name": "Tran Van Tien",
            "email": "vietnam12@gmail.com"
        },
        "pbx_account": { // Thông tin tổng đài
            "sip_user": "",
            "password": "",
            "domain": null,
            "outbound_proxy": null,
            "public_number": null,
            "full_name": "Tran Van Tien",
            "email": "vietnam12@gmail.com",
            "last_updated_date": 1597798326714,
            "created_date": 1597798326714
        }
    },
    "key_enabled": false
}
```

{% endtab %}
{% endtabs %}

| Mã lỗi                   | Mô tả                                                                                                                                          |
| ------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| full\_name\_is\_required | Họ và tên là bắt buộc                                                                                                                          |
| identify\_info\_invalid  | Email không hợp lệ                                                                                                                             |
| password\_invalid        | <p>Mật khẩu không hợp lệ , Mật khẩu bao gồm </p><ul><li>Ít nhất 8 ký tự</li><li>Ký tự in hoa, in thường</li><li>Số và ký tự đặc biệt</li></ul> |
| role\_is\_required       | Quyền là bắt buộc                                                                                                                              |
| agent\_exists            | Nhân viên đã tồn tại                                                                                                                           |
| limit\_agent             | Vượt quá giới hạn gói dịch vu                                                                                                                  |
| invite\_error            | Có lỗi xảy ra khi invite                                                                                                                       |
| agent\_uuid\_exists      | Nhân viên có mã uuid đã tồn tại trước đó                                                                                                       |

## Xóa nhân viên

<mark style="color:red;">`DELETE`</mark> `[URL]/api/agent/delete?identify_info=`

#### Path Parameters

| Name          | Type   | Description                 |
| ------------- | ------ | --------------------------- |
| Authorization | string | Access token Bearer 'token' |

#### Query Parameters

| Name           | Type   | Description     |
| -------------- | ------ | --------------- |
| identify\_info | string | Email nhân viên |

{% tabs %}
{% tab title="200 Xóa nhân viên thành công" %}

```
```

{% endtab %}
{% endtabs %}

## Mời nhân viên kèm theo gói dịch vụ&#x20;

<mark style="color:green;">`POST`</mark> `[URL]/api/agent/invite_with_package_v2`

Mời nhân viên sử dụng tổng đài có liên kết gói v2

#### Path Parameters

| Name          | Type   | Description                 |
| ------------- | ------ | --------------------------- |
| Authorization | string | Access token Bearer 'token' |

#### Request body

| Name                 | Type   | Description                                                                             |
| -------------------- | ------ | --------------------------------------------------------------------------------------- |
| owner\_email         | string | <p>Email nhân viên phụ trách </p><p>(nếu bỏ trống sẽ gán mặc định chủ doanh nghiệp)</p> |
| password             | string | Mật khẩu tối thiểu 8 kí tự, ít nhất 1 ký tự IN HOA, ít nhất 1 chữ số \[0-9]             |
| identify\_info       | string | Eemail nhân viên                                                                        |
| full\_name           | string | Tên nhân viên                                                                           |
| service\_package\_id | string | Id gói nhân viên v2                                                                     |
| role\_name           | string | Phân quyền (nếu bỏ trống mặc định là quyền Sale mặc định)                               |

{% tabs %}
{% tab title="Body" %}

<pre><code><strong>{
</strong>    "owner_email": "",
    "password": "13579Abc@",
    "identify_info": "abc@gmail.com",
    "full_name": "Nhân viên 1",
    "service_package_id": "664175f5dgda95e5cbce704e9",
    "role_name": "Giám đốc"
}
</code></pre>

{% endtab %}
{% endtabs %}

#### Response

{% tabs %}
{% tab title="200 Mời nhân viên thành công" %}

```
// Thông tin nhân viên đã mời
```

{% endtab %}
{% endtabs %}

## Cập nhật phân quyền nhân viên

<mark style="color:green;">`POST`</mark> `[URL]/api/agent/role/update`

Cập nhật thông tin phân quyền của một nhân viên

#### Path Parameters

| Name          | Type   | Description                 |
| ------------- | ------ | --------------------------- |
| Authorization | string | Access token Bearer 'token' |

#### Request body

| Name                                       | Type   | Description   |
| ------------------------------------------ | ------ | ------------- |
| id<mark style="color:red;">\*</mark>       | string | Id nhân viên  |
| role\_id<mark style="color:red;">\*</mark> | string | Id phân quyền |

{% tabs %}
{% tab title="Body" %}

```
{
    "id": "673422b9e9caa0299d7e9799",
    "role_id": "6732dc3d827b8d5c308bcc7c"
}
```

{% endtab %}
{% endtabs %}

#### Response

{% tabs %}
{% tab title="200 Cập nhật phân quyền thành công" %}

```
{
    "instance_id": "stg",
    "payload": {
        "id": "673422b9e9caa0299d7e9799",
        "tenant_id": "62d8b0d1a89196134b65409b",
        "contact_id": "673422b9e9caa0299d7e9798",
        "email": "test@gmail.com",
        "full_name": "test agent",
        "role_id": "6732dc3d827b8d5c308bcc7c",
        "type": "agent",
        "pbx_account": {
            "sip_user": "114",
            "sip_password": "3du1Qch6fm"
        }
    },
    "instance_version": "1.2.164",
    "key_enabled": false,
    "status_code": 9999
}
```

{% endtab %}
{% endtabs %}

## Cập nhật gói dịch vụ nhân viên

<mark style="color:green;">`POST`</mark> `[URL]/api/agent/service_package/update`

Cập nhật hoặc gỡ gói dịch vụ cho một nhân viên

#### Path Parameters

| Name          | Type   | Description                 |
| ------------- | ------ | --------------------------- |
| Authorization | string | Access token Bearer 'token' |

#### Request body

| Name                                 | Type   | Description                                                                              |
| ------------------------------------ | ------ | ---------------------------------------------------------------------------------------- |
| id<mark style="color:red;">\*</mark> | string | Id nhân viên                                                                             |
| service\_package\_id                 | string | Id gói dịch vụ được gán. Nếu muốn gỡ gói dịch vụ của nhân viên, không truyền tham số này |

{% tabs %}
{% tab title="Body" %}

```
{
    "id": "673422b9e9caa0299d7e9799",
    "service_package_id": "67a4789e19a6ca32cbc4ca08"
}
```

{% endtab %}
{% endtabs %}

#### Response

{% tabs %}
{% tab title="200 Cập nhật gói thành công" %}

```
{
    "instance_id": "stg",
    "payload": true, // true nếu cập nhật thành công
    "instance_version": "1.2.164",
    "key_enabled": false,
    "status_code": 9999
}
```

{% endtab %}
{% endtabs %}

## Lấy thông tin nhân viên qua Email

<mark style="color:green;">`POST`</mark> `[URL]/api/v2/agent/get-by-email`

#### Headers

| Name          | Type   | Description                   |
| ------------- | ------ | ----------------------------- |
| Authorization | String | Access token : Bearer 'token' |

#### Request Body

| Name  | Type   | Description     |
| ----- | ------ | --------------- |
| email | String | Email nhân viên |

{% tabs %}
{% tab title="200 Thông tin nhân viên " %}

```
{
    "status_code": 9999,
    "instance_id": "stg",
    "instance_name": "DESKTOP-1OB3SFM",
    "payload": {
        "id": "60e79bd864b64271a923affe", //Id của nhân viên,
        "tenant_id" : "60e79bd864b64271a923affb", //Id của doanh nghiệp,
        "contact_id": "60e79beb1b20043c4e7a68af", //Id contact của nhân viên
        "email" : "omi@vihatgroup.com", //Email nhân viên
        "phone" : "098xxxxxx", //Số điện thoại của nhân viên
        "full_name": "DEV ZONE", //Tên nhân viên
        "pbx_account": { // Thông tin tổng đài
            "sip_user": "999", // Số nội bộ
            "sip_password": "xxx" //Mật khẩu
        }
    },
    "key_enabled": false
}
```

{% endtab %}
{% endtabs %}

## Danh sách nhân viên

<mark style="color:green;">`POST`</mark> `[URL]/api/v2/agent/search`

<mark style="color:$primary;">\*</mark> <mark style="color:$primary;">Tạm dừng cập nhật từ ngày 01/04/2026, vui lòng sử dụng</mark> [<mark style="color:$primary;">API v3</mark>](https://api.omicall.com/omicall-api/nhan-vien#danh-sach-nhan-vien-v3)

#### Headers

| Name          | Type   | Description                   |
| ------------- | ------ | ----------------------------- |
| Authorization | String | Access token : Bearer 'token' |

#### Request Params

| Name | Type    | Description                                   |
| ---- | ------- | --------------------------------------------- |
| page | Integer | Số thứ tự trang                               |
| size | Integer | Số lượng data lấy về trong 1 trang. Từ 1 - 50 |
|      |         |                                               |

#### Request Body (optional)

| Name       | Type   | Description                                                                    |
| ---------- | ------ | ------------------------------------------------------------------------------ |
| emails     | List   | Danh sách email nhân viên                                                      |
| phones     | List   | Danh sách số điện thoại của nhân viên                                          |
| extensions | List   | Danh sách số nội bộ                                                            |
| sort       | Object | <p>{</p><p>      field: "created\_date", </p><p>      isAsc: true </p><p>}</p> |
|            |        |                                                                                |

{% tabs %}
{% tab title="200 Thông tin nhân viên " %}

```
{
    "status_code": 9999,
    "instance_id": "stg",
    "instance_name": "DESKTOP-1OB3SFM",
    "payload": {
        "items": [
            {
                "id": "60e79bd864b64271a923affe", //Id của nhân viên,
                "tenant_id" : "60e79bd864b64271a923affb", //Id của doanh nghiệp,
                "contact_id": "60e79beb1b20043c4e7a68af", //Id contact của nhân viên
                "email" : "omi@vihatgroup.com", //Email nhân viên
                "phone" : "098xxxxxx", //Số điện thoại của nhân viên
                "full_name": "DEV ZONE", //Tên nhân viên
                "pbx_account": { // Thông tin tổng đài
                    "sip_user": "999", // Số nội bộ
                    "sip_password": "xxx" //Mật khẩu
            },
            {
                ...
            }
        ],
        "page_number" : 1,
        "page_size" : 50.
        "total_items" : 1000,
        "total_pages" : 20,
        "has_next" : true,
        "next_page: 2,
        "has_previous: false,
        "previous_page" : 1
    },
    "key_enabled": false
}
```

{% endtab %}
{% endtabs %}

## Chuyển chủ sở hữu tài khoản nhân viên

<mark style="color:green;">`POST`</mark> `[URL]/api/v3/agent/transfer`

#### Headers

| Name      | Type   | Description |
| --------- | ------ | ----------- |
| x-api-key | String | API Key     |

#### Request Body

<table><thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>sourceEmail<mark style="color:red;">*</mark></td><td>String</td><td>Email liên kết với tài khoản gốc</td></tr><tr><td>targetEmail<mark style="color:red;">*</mark></td><td>String</td><td>Email liên kết mới (phải chưa tồn tại trên hệ thống)</td></tr><tr><td>targetInfo</td><td>Object</td><td><p>Thông tin nhân viên mới:</p><ul><li>fullName: tên nhân viên</li><li>phoneNumber: số điện thoại nhân viên</li></ul><pre class="language-json"><code class="lang-json">{
    "fullName": "agent",
    "phoneNumber": "0123456789"
}
</code></pre></td></tr><tr><td>callbackResultConfig</td><td>Object</td><td><p>Thông tin hook nhận kết quả sau khi hoàn tất tiến trình:</p><ul><li>url: url nhận hook</li><li>headers (optional): danh sách headers muốn gửi kèm khi nhận hook</li></ul><pre class="language-json"><code class="lang-json">{
    "url": "https://...",
    "headers": {
        "key1": "value1"
    }
}
</code></pre></td></tr></tbody></table>

{% tabs %}
{% tab title="202 Khởi tạo tiến trình thành công " %}

```json
{
    "instance_id": "stg",
    "payload": {
        "requestId": "270ea881-a6e1-44fb-9400-a89eb4ceab4b" // unique request id, trả về kèm theo webhook nếu có khai báo "callbackResultConfig"
    },
    "instance_version": "1.2.164",
    "key_enabled": false,
    "status_code": 9999
}
```

{% endtab %}

{% tab title="Webhook" %}

```json
{
  "requestId": "270ea881-a6e1-44fb-9400-a89eb4ceab4b", // unique request id
  "requestTimeMs": 1769163675593, // thời gian request
  "action": "AGENT_TRANSFER", // loại tiến trình
  "status": "SUCCESS", // trạng thái SUCCESS/ERROR
  "responseTimeMs": 1769163675890, // thời gian kết thúc
  "payload": { // Thông tin nhân viên mới
    "fullName": "agent",
    "phoneNumber": "0123456789",
    "email": "example@gmail.com"
  }
}
```

{% endtab %}
{% endtabs %}


# Khách hàng

API Khách hàng version 2

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

<mark style="color:green;">`POST`</mark> `[URL]/api/v2/contact/add`

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

#### Headers

<table><thead><tr><th width="247">Name</th><th width="101">Type</th><th>Description</th></tr></thead><tbody><tr><td>Content-Type</td><td>String</td><td>application/json</td></tr><tr><td>Authorization</td><td>String</td><td>Bearer Access: Bearer 'token'</td></tr></tbody></table>

#### Request Body

<table><thead><tr><th width="273">Name</th><th width="102">Type</th><th>Description</th></tr></thead><tbody><tr><td>refId*</td><td>String</td><td>Mã của khách hàng bên đối tác</td></tr><tr><td>tags</td><td>array</td><td>Danh sách tên thẻ tag. Ví dụ: ["Lead", "Contact"]</td></tr><tr><td>business</td><td>array</td><td>Danh sách tên các ngành. Ví dụ: ["Food", "Education"]</td></tr><tr><td>categories</td><td>array</td><td>Danh sách tên các nhóm. Ví dụ: ["High Prioriry", "Low Priority"]</td></tr><tr><td>userOwnerEmail</td><td>string</td><td>Email của nhân viên phụ trách</td></tr><tr><td>avatarUrl</td><td>string</td><td>Avatar của khách hàng</td></tr><tr><td>fullName*</td><td>string</td><td>Tên đầy đủ của khách hàng</td></tr><tr><td>gender</td><td>string</td><td>Giới tính của khách hàng. Chấp nhận 1 trong các giá trị sau: male, female, other</td></tr><tr><td>passport</td><td>string</td><td>Hộ chiếu hoặc ID card</td></tr><tr><td>jobTitlte</td><td>string</td><td>Nghề nghiệp</td></tr><tr><td>address</td><td>string</td><td>Địa chỉ</td></tr><tr><td>refCode</td><td>string</td><td>Mã code của khách hàng bên đối tác</td></tr><tr><td>refType</td><td>string</td><td>Type của khách hàng bên đối tác</td></tr><tr><td>note</td><td>string</td><td>Ghi chú </td></tr><tr><td>phones*</td><td>array</td><td><p>Danh sách đối tượng PHONE<br>Ví dụ:</p><p>[</p><p>      {</p><p>             data  : "0989xxxxxx",</p><p>             type  : "home",</p><p>             valueType : "Nhà"</p><p>      }</p><p>]</p><p>//type => home, personal, office</p><p>//valueType => "Nhà", "Cá nhân", "Công ty"</p></td></tr><tr><td>emails</td><td>array</td><td><p>Danh sách đối tượng EMAIL<br>Ví dụ:</p><p>[</p><p>      {</p><p>             data : "xxx@gmail.com",</p><p>             type  : "home",</p><p>             valueType : "Nhà"</p><p>      }</p><p>]</p><p>//type => home, personal, office</p><p>//valueType => "Nhà", "Cá nhân", "Công ty"</p></td></tr><tr><td>filterContacts</td><td>array</td><td><p>Phễu khách hàng </p><p>Ví dụ:</p><p>[</p><p>      {</p><p>             id : "xxx",</p><p>             index : 1,</p><p>             secondLevelIndex : 1</p><p>      }</p><p>]</p><p>//id: Id của phễu</p><p>//index: thứ tự trạng thái cấp 1</p><p>//secondLevelIndex : thứ tự trạng thái cấp 2 (nếu có)</p></td></tr><tr><td></td><td></td><td></td></tr></tbody></table>

{% tabs %}
{% tab title="200 Dữ liệu trả về khi yêu cầu thành công" %}

```
{
    "status_code": 9999,
    "instance_id": "stg",
    "instance_name": "DESKTOP-3I0NHO0",
    "payload": true /false,
    "key_enabled": false
}
```

{% endtab %}
{% endtabs %}

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

<mark style="color:green;">`POST`</mark> `[URL]/api/v2/contact/addMany`

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

#### Headers

<table><thead><tr><th width="247">Name</th><th width="101">Type</th><th>Description</th></tr></thead><tbody><tr><td>Content-Type</td><td>String</td><td>application/json</td></tr><tr><td>Authorization</td><td>String</td><td>Bearer Access: Bearer 'token'</td></tr></tbody></table>

#### Request Body

<table><thead><tr><th width="251">Name</th><th width="102">Type</th><th>Description</th></tr></thead><tbody><tr><td>data</td><td>array</td><td><p>Mảng thông tin các khách hàng cần thêm vào. Mẫu như sau:</p><p>[</p><p>      {</p><p>             refId : "",</p><p>             tags" : [],</p><p>             business : [],</p><p>             categories : [],</p><p>             userOwnerEmail : "",</p><p>             avatarUrl : "",</p><p>             fullName : "",</p><p>             gender  : "",</p><p>             passport : "",</p><p>             jobTitle : "",</p><p>             address : "",</p><p>             refCode : "",</p><p>             refType : "",</p><p>             note : "",</p><p>             phones : [],</p><p>             emails : [],</p><p>             filterContacts : []</p><p>      }</p><p>]</p><p>// kiểu giá trị của các trường tham khảo ở API Tạo mới khách hàng</p></td></tr><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td></tr></tbody></table>

{% tabs %}
{% tab title="200 Dữ liệu trả về khi yêu cầu thành công" %}

```
{
    "status_code": 9999,
    "instance_id": "stg",
    "instance_name": "DESKTOP-3I0NHO0",
    "payload": {"success" : true || "error" : {}},
    "key_enabled": false
}
```

{% endtab %}
{% endtabs %}

## Cập nhật khách hàng

<mark style="color:green;">`POST`</mark> `[URL]/api/v2/contact/update`

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

#### Headers

<table><thead><tr><th width="251">Name</th><th width="103">Type</th><th>Description</th></tr></thead><tbody><tr><td>Authorization</td><td>string</td><td>Access Token : Bearer 'token'</td></tr><tr><td>Content-type</td><td>string</td><td>application/json</td></tr></tbody></table>

#### Request Body

<table><thead><tr><th width="253">Name</th><th width="284">Type</th><th>Description</th></tr></thead><tbody><tr><td>refId</td><td>string</td><td>Mã của khách hàng bên đối tác</td></tr><tr><td>_id</td><td></td><td>Id định danh khách hàng ở phía OMI (Trong trường hợp không sử dụng refId)</td></tr><tr><td>tags</td><td>array</td><td>Danh sách tên thẻ tag cần thêm vào. Ví dụ: ["Company"]</td></tr><tr><td>business</td><td>array</td><td>Danh sách tên các ngành cần thêm vào. Ví dụ: ["E-Commerce"]</td></tr><tr><td>categories</td><td>array</td><td>Danh sách tên các nhóm. Ví dụ: ["Medium"]</td></tr><tr><td>tagRemoves</td><td>array</td><td>Danh sách tên thẻ tag cần xóa. Ví dụ: ["Contact"]</td></tr><tr><td>businessRemoves</td><td>array</td><td>Danh sách tên các ngành cần xóa. Ví dụ: ["Food"]</td></tr><tr><td>categoriesRemoves</td><td>array</td><td>Danh sách tên các nhóm cần xóa. Ví dụ: ["High Priority"]</td></tr><tr><td>userOwnerEmail</td><td>string</td><td>Email của nhân viên phụ trách</td></tr><tr><td>avatarUrl</td><td>string</td><td>Avatar khách hàng</td></tr><tr><td>fullName</td><td>string</td><td>Tên khách hàng</td></tr><tr><td>gender</td><td>string</td><td>Giới tính khách hàng. Chấp nhận 1 trong các giá trị sau: male, female, other</td></tr><tr><td>passport</td><td>String</td><td>Hộ chiếu hoặc ID card</td></tr><tr><td>jobTitle</td><td>String</td><td>Nghề nghiệp</td></tr><tr><td>address</td><td>String</td><td>Địa chỉ</td></tr><tr><td>note</td><td>String</td><td>Ghi chú</td></tr><tr><td>phones</td><td>array</td><td><p>Danh sách đối tượng PHONE<br>Ví dụ:</p><p>[</p><p>      {</p><p>             data  : "0989xxxxxx",</p><p>             type  : "home",</p><p>             valueType : "Nhà"</p><p>      }</p><p>]</p><p>//type => home, personal, office</p><p>//valueType => "Nhà", "Cá nhân", "Công ty"</p></td></tr><tr><td>emails</td><td>array</td><td><p>Danh sách đối tượng EMAIL<br>Ví dụ:</p><p>[</p><p>      {</p><p>             data : "xxx@gmail.com",</p><p>             type  : "home",</p><p>             valueType : "Nhà"</p><p>      }</p><p>]</p><p>//type => home, personal, office</p><p>//valueType => "Nhà", "Cá nhân", "Công ty"</p></td></tr><tr><td>filterContacts</td><td>array</td><td><p>Phễu khách hàng </p><p>Ví dụ:</p><p>[</p><p>      {</p><p>             id : "xxx",</p><p>             index : 1,</p><p>             secondLevelIndex : 1</p><p>      }</p><p>]</p><p>//id: Id của phễu</p><p>//index: thứ tự trạng thái cấp 1</p><p>//secondLevelIndex : thứ tự trạng thái cấp 2 (nếu có)</p></td></tr><tr><td>otherDynamicUpdates</td><td>array</td><td><p>Cập nhật các trường thuộc tính động khác.</p><p>Ví dụ:</p><p>[</p><p>      {</p><p>             fieldCode: "xxx",</p><p>             values:  [</p><p>                     {</p><p>                              data : "yyy",</p><p>                              type  : "",</p><p>                              valueType : ""</p><p>                      }</p><p>              ]</p><p>      }</p><p>]</p></td></tr></tbody></table>

{% tabs %}
{% tab title="200 Dữ liệu thông tin khách hàng trả về, khi sửa thông tin thành công" %}

```
{
    "status_code": 9999,
    "instance_id": "stg",
    "instance_name": "DESKTOP-3I0NHO0",
    "payload": {//Thông tin KH sau update},
    "key_enabled": false
}
```

{% endtab %}
{% endtabs %}

## Cập nhật Avatar khách hàng

<mark style="color:green;">`POST`</mark> `[URL]/api/v2/contact/changeAvatar`

Thay đổi Avatar KH V2

#### Headers

<table><thead><tr><th width="251">Name</th><th width="103">Type</th><th>Description</th></tr></thead><tbody><tr><td>Authorization</td><td>string</td><td>Access Token : Bearer 'token'</td></tr><tr><td>Content-type</td><td>string</td><td>application/json</td></tr></tbody></table>

#### Body FormData

<table><thead><tr><th width="253">Name</th><th width="284">Type</th><th>Description</th></tr></thead><tbody><tr><td>id</td><td>string</td><td>Id định danh khách hàng ở phía OMI</td></tr><tr><td></td><td>file</td><td>File avatar cần thay đổi</td></tr></tbody></table>

{% tabs %}
{% tab title="200 Dữ liệu thông tin khách hàng trả về, khi sửa thông tin thành công" %}

```
{
    "status_code": 9999,
    "instance_id": "stg",
    "instance_name": "DESKTOP-3I0NHO0",
    "payload": {//Thông tin KH sau update},
    "key_enabled": false
}
```

{% endtab %}
{% endtabs %}

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

<mark style="color:green;">`POST`</mark> `[URL]/api/v2/contact/search`

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

#### Query Parameters

<table><thead><tr><th width="259">Name</th><th width="107">Type</th><th>Description</th></tr></thead><tbody><tr><td>page</td><td>number</td><td>Trang. Bắt đầu từ 1. Mặc định là 1</td></tr><tr><td>size</td><td>number</td><td>Kích thước trang. Mặc định là 50</td></tr></tbody></table>

#### Headers

<table><thead><tr><th width="260">Name</th><th width="109">Type</th><th>Description</th></tr></thead><tbody><tr><td>Authorization</td><td>string</td><td>Bearer Access: Bearer 'token'</td></tr><tr><td>Content-type</td><td>string</td><td>application/json</td></tr></tbody></table>

#### Request Body

<table><thead><tr><th width="260">Name</th><th width="112">Type</th><th>Description</th></tr></thead><tbody><tr><td>keyword</td><td>String</td><td>Từ khóa tìm kiếm. Có thể một trong các giá trị<br>- Số điện thoại<br>- Email<br>- Họ và tên</td></tr><tr><td>tags</td><td>Array</td><td><p>Lọc theo tags</p><p>"tags": ["Demo"]</p></td></tr><tr><td>business</td><td>Array</td><td><p>Lọc theo ngành</p><p>"business": ["Demo"]</p></td></tr><tr><td>categories</td><td>Array</td><td>Lọc theo nhóm<br>"categories" :["Demo"]</td></tr><tr><td>ranges</td><td>Array</td><td><p>Lọc theo thời gian<br>"ranges" :[{</p><p>"field": "created_date",</p><p>"from": 1704819600000,</p><p>"to": 1704905999999</p><p>}]</p></td></tr><tr><td>includeIds</td><td>Array</td><td><p>Lọc khách hàng có id thuộc mảng</p><p>"includeIds":["123", "345"]</p></td></tr><tr><td>excludeIds</td><td>Array</td><td><p>Lọc khách hàng có id không thuộc mảng</p><p>"excludeIds":["123", "345"]</p></td></tr><tr><td>filterContactIds</td><td>Array</td><td>Lọc theo trạng thái khách hàng<br>"filterContactIds":["6465a66d61422d32ad0e4d40"]</td></tr></tbody></table>

{% tabs %}
{% tab title="200 Dữ liệu trả về thành công" %}

```
{
    "status_code": 9999,
    "instance_id": "stg",
    "instance_name": "DESKTOP-3I0NHO0",
    "payload": {
        "next_page": 1,
        "page_number": 1,
        "has_previous": false,
        "has_next": false,
        "total_pages": 1,
        "previous_page": 1,
        "total_items": 1,
        "page_size": 50
        "items": [
            {
                "public_id": "", // Id
                "create_by": {
                    "name": "TestBoss 123"
                },
                "last_update_by": {
                    "name": "TestBoss 123"
                },
                "created_date": 1576229754881,
                "last_updated_date": 1580807004410,
                "contact_type": "contact",
                "tags_view": null,
                "is_deleted": false, // Trạng thái
                "tags": [], // Thẻ tags khách hàng
                "attribute_structure": [
                    {
                        "identify": false,
                        "field_code": "full_name",
                        "field_type": "single_text",
                        "value": [
                            {
                                "display_value": "Trần Văn,
                                "data_type": null,
                                "value_type": null
                            }
                        ]
                    },
                    {
                        "identify": false,
                        "field_code": "job_title",
                        "field_type": "single_text",
                        "value": [
                            {
                                "display_value": "Giám đốc",
                                "data_type": null,
                                "value_type": null
                            }
                        ]
                    },
                    {
                        "identify": false,
                        "field_code": "gender",
                        "field_type": "radio",
                        "value": [
                            {
                                "display_value": "male",
                                "data_type": null,
                                "value_type": null
                            }
                        ]
                    },
                    {
                        "identify": false,
                        "field_code": "phone_number",
                        "field_type": "phone",
                        "value": [
                            {
                                "display_value": "0395187319",
                                "data_type": "personal",
                                "value_type": "Cá nhân"
                            }
                        ]
                    },
                    {
                        "identify": false,
                        "field_code": "mail",
                        "field_type": "email",
                        "value": [
                            {
                                "display_value": "tientv1212@gmail.com",
                                "data_type": "personal",
                                "value_type": "Cá nhân"
                            }
                        ]
                    },
                    {
                        "identify": false,
                        "field_code": "address",
                        "field_type": "single_text",
                        "value": [
                            {
                                "display_value": "Số 6 , đường 16, Hiệp Bình Chánh, Thủ Đức, HCM",
                                "data_type": null,
                                "value_type": null
                            }
                        ]
                    },
                    {
                        "identify": false,
                        "field_code": "passport",
                        "field_type": "single_text",
                        "value": [
                            {
                                "display_value": "",
                                "data_type": null,
                                "value_type": null
                            }
                        ]
                    },
                    {
                        "identify": false,
                        "field_code": "note",
                        "field_type": "multi_text",
                        "value": [
                            {
                                "display_value": "Khách hàng VIP, cần được chăm sóc kĩ",
                                "data_type": null,
                                "value_type": null
                            }
                        ]
                    },
                    {
                        "identify": false,
                        "field_code": "more_infomation",
                        "field_type": "customize",
                        "value": [
                            {
                                "display_value": "Nguyễn Văn B",
                                "data_type": "value1",
                                "value_type": "Người thân"
                            },
                            {
                                "display_value": "Vàng",
                                "data_type": "label2",
                                "value_type": "Màu sắc yêu thích"
                            }
                        ]
                    }
                ],
				"filter_contacts": [ //Thông tin trạng thái khách hàng, xem phần filter_contacts_view
                    {
                        "id": "62d8b0d1a89196134b65409c",
                        "index": 2,
                        "second_level_index": null,
                        "last_updated_date": 1715915262700,
                        "work_list": null,
                        "interactive_time": null,
                        "level": 99999,
                        "filter_contact": null,
                        "status_deals": null,
                        "total_deals": null,
                        "total_deals_rate": null,
                        "products": null,
                        "close_date_opportunity": null,
                        "rate": null,
                        "opportunity_expired": null,
                        "note": null,
                        "total_deals_string": null
                    },
                    {
                        "id": "62d91fa1b07a7920a8616693",
                        "index": 3,
                        "second_level_index": 2,
                        "last_updated_date": 1717138986593,
                        "work_list": [],
                        "interactive_time": null,
                        "level": 9999,
                        "filter_contact": null,
                        "status_deals": null,
                        "total_deals": null,
                        "total_deals_rate": null,
                        "products": null,
                        "close_date_opportunity": null,
                        "rate": null,
                        "opportunity_expired": null,
                        "note": null,
                        "total_deals_string": null
                    }
                ],
				"filter_contacts_view": [
                    {
                        "id": "62d8b0d1a89196134b65409c", //Id của bộ trạng thái
                        "name": "Trạng thái khách hàng", //Tên của bộ trạng thái
                        "first_index": 2, //Chỉ số hiện tại của bộ trạng thái
                        "first_name": "Có nhu cầu - Đang dùng thử" //Tên trạng thái hiện tại
                    },
                    {
                        "id": "62d91fa1b07a7920a8616693",//Id của bộ trạng thái
                        "name": "Trạng thái mới", //Tên của bộ trạng thái
                        "first_index": 3, //Chỉ số hiện tại của bộ trạng thái cấp 1
                        "first_name": "Có nhu cầu",//Tên trạng thái hiện tại cấp 1
                        "second_index": 2,//Chỉ số hiện tại của bộ trạng thái cấp 2
                        "second_name": "Đang dùng thử2"//Tên trạng thái hiện tại cấp 2
                    }
                ]
            }
        ]
    },
    "key_enabled": false
}
```

{% endtab %}
{% endtabs %}

## Xóa khách hàng

<mark style="color:red;">`DELETE`</mark> `[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                 |
| ------------- | ------ | --------------------------- |
| Authorization | string | AccessToken. Bearer 'token' |
| Content-type  | string | application/json            |

{% tabs %}
{% tab title="200 Xóa khách hàng thành công" %}

```
{
    "status_code": 9999,
    "instance_id": "stg",
    "instance_name": "DESKTOP-3I0NHO0",
    "payload": true,
    "key_enabled": false
}
```

{% endtab %}
{% endtabs %}

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

<mark style="color:green;">`POST`</mark> `[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                                  | Strig | Email nhân viên          |
| content<mark style="color:red;">\*</mark> | Sting | Nội dung ghi chú         |
| phone<mark style="color:red;">\*</mark>   | Strig | Số điện thoại khách hàng |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
    "status_code": 9999,
    "instance_id": "stg",
    "instance_version": "1.2.163",
    "payload": 1, // Số tương tác đã gửi đi
    "key_enabled": false
}
```

{% endtab %}
{% endtabs %}

## Chi tiết khách hàng

<mark style="color:blue;">`GET`</mark> `[URL]/api/v2/contact/get/: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  |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
    // Thông tin chi tiết 1 contact, xem mô tả trong phần API search
}
```

{% endtab %}
{% endtabs %}

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

<mark style="color:blue;">`GET`</mark> `[URL]/api/v2/contact/layout/list`

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

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
    // Thông tin các thuộc tính động
}
```

{% endtab %}
{% endtabs %}

## Danh sách bộ trạng thái khách hàng

<mark style="color:blue;">`GET`</mark> `[URL]/api/v2/contact/filterContact/list`

Lấy danh sách bộ trạng thái khách hàng

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
    // Thông tin các bộ trạng thái
}
```

{% endtab %}
{% endtabs %}

## Chuyển đổi nhân viên phụ trách khách hàng

<mark style="color:green;">`POST`</mark> `[URL]/api/v3/agent/contact/transfer`&#x20;

Chuyển toàn bộ khách hàng do nhân viên gốc phụ trách hoặc có liên quan đến nhân viên gốc sang cho nhân viên mới

#### Headers

| Name      | Type   | Description |
| --------- | ------ | ----------- |
| x-api-key | String | API Key     |

#### Request Body

<table><thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>sourceEmail<mark style="color:red;">*</mark></td><td>String</td><td>Email nhân viên gốc</td></tr><tr><td>targetEmail<mark style="color:red;">*</mark></td><td>String</td><td>Email nhân viên mới</td></tr><tr><td>previewChanges</td><td>Boolean</td><td><ul><li>true: Xem trước số lượng khách hàng sẽ bị thay đổi sau cập nhật (không khởi tạo tiến trình cập nhật) </li><li>false (mặc định): Khởi tạo tiến trình cập nhật</li></ul></td></tr><tr><td>callbackResultConfig</td><td>Object</td><td><p>Thông tin hook nhận kết quả sau khi hoàn tất tiến trình:</p><ul><li>url: url nhận hook</li><li>headers (optional): danh sách headers muốn gửi kèm khi nhận hook</li></ul><pre class="language-json"><code class="lang-json">{
    "url": "https://...",
    "headers": {
        "key1": "value1"
    }
}
</code></pre></td></tr></tbody></table>

{% tabs %}
{% tab title="202 Khởi tạo tiến trình thành công " %}

```json
{
    "instance_id": "stg",
    "payload": {
        "requestId": "270ea881-a6e1-44fb-9400-a89eb4ceab4b" // unique request id, trả về kèm theo webhook nếu có khai báo "callbackResultConfig"
    },
    "instance_version": "1.2.164",
    "key_enabled": false,
    "status_code": 9999
}
```

{% endtab %}

{% tab title="Webhook" %}

```json
{
  "requestId": "270ea881-a6e1-44fb-9400-a89eb4ceab4b", // unique request id
  "requestTimeMs": 1769163675593, // thời gian request
  "action": "CONTACT_AGENT_TRANSFER", // loại tiến trình
  "status": "SUCCESS", // trạng thái SUCCESS/ERROR
  "responseTimeMs": 1769163675890, // thời gian kết thúc
  "payload": {
    "updatedRecords": 8 // Số lượng record được cập nhật
  }
}
```

{% endtab %}
{% endtabs %}


# Tổng đài

Quản lý cấu hình tổng đài , số nội bộ

## Danh sách SỐ NỘI BỘ&#x20;

<mark style="color:blue;">`GET`</mark> `[URL]/api/call_center/internal_phone/list`

\- Lấy danh sách cấu hình số nội bộ\
\- **Cấu hình** > **Tổng đài** > **Số nội bộ**<br>

#### Query Parameters

| Name    | Type   | Description                      |
| ------- | ------ | -------------------------------- |
| keyword | string | Số nội bộ, email, full\_name     |
| page    | number | Trang, bắt đầu từ 1 (Mặc định 1) |
| size    | number | Kích thước trang, mặc định là 50 |

#### Headers

| Name                                            | Type   | Description                   |
| ----------------------------------------------- | ------ | ----------------------------- |
| Authorization<mark style="color:red;">\*</mark> | string | Access Token : Bearer 'token' |
| Content-type<mark style="color:red;">\*</mark>  | string | application/json              |

{% tabs %}
{% tab title="200 Lấy danh sách số nội bộ thành công" %}

```
{
    "status_code": 9999,
    "instance_id": "stg",
    "instance_name": "DESKTOP-3I0NHO0",
    "payload": {
        "items": [
            {
                "domain": "omiteam", // Domain tổng đài
                "outbound_proxy": "wss://wssvn.omicrm.com", // Outboud Proxy
                "sip_user": "147", // Số nội bộ
                "password": "XXXXXX", // Mật khẩu truy cập
                "full_name": "Đỗ Thị Hồng Vy", // Họ và tên
                "agent_id" : "xxx", // Id nhân viên
                "email": "dohongvyzyt@gmail.com", // Email
                "public_number":"84256336xxxx", // Đầu số đang sử dụng
                "last_updated_date": 1575269373331, //Cập nhật lần cuối
                "created_date": 1575251355778 // Ngày tạo
            },
            {
                "domain": "omiteam", // Domain tổng đài
                "outbound_proxy": "wss://wssvn.omicrm.com", // Outboud Proxy
                "sip_user": "145",
                "password": "kiyyzsefxx",
                "full_name": "Hồng Ngọc",
                "agent_id" : "xxx", // Id nhân viên
                "email": "vykh252tn1998@gmail.com",
                "public_number":"84256336xxxx",
                "last_updated_date": 1574999296765,
                "created_date": 1574133910912
            }
        ],
        "page_number": 1,
        "page_size": 2,
        "total_items": 30,
        "total_pages": 15,
        "has_next": true,
        "next_page": 2,
        "has_previous": false,
        "previous_page": 1
    },
    "key_enabled": false
}
```

{% endtab %}
{% endtabs %}

## Cập nhật trạng thái số máy lẻ

<mark style="color:orange;">`PUT`</mark> `[URL]/api/call_center/internal_phone/status?enabled=&sip_user=`

Thay đổi trạng thái số máy lẻ : Hoạt đồng hoặc / Ngưng hoạt động

#### Query Parameters

| Name                                        | Type   | Description                                        |
| ------------------------------------------- | ------ | -------------------------------------------------- |
| sip\_user<mark style="color:red;">\*</mark> | string | Số máy lẻ nhân viên                                |
| enabled<mark style="color:red;">\*</mark>   | string | <p>true : Hoạt động<br>false : Ngưng hoạt động</p> |

#### Headers

| Name                                            | Type   | Description  |
| ----------------------------------------------- | ------ | ------------ |
| Authorization<mark style="color:red;">\*</mark> | string | Bearer token |

{% tabs %}
{% tab title="200 " %}

```
```

{% endtab %}
{% endtabs %}

## Danh sách đầu số đang hoạt động và cho phép gọi ra

<mark style="color:blue;">`GET`</mark> `[URL]/api/call_center/hotline/list?extension=`

Lấy danh sách đầu số đang hoạt động và cho phép gọi ra của một số nội bộ

#### Query Parameters

| Name      | Type   | Description         |
| --------- | ------ | ------------------- |
| extension | string | Số máy lẻ nhân viên |

#### Headers

| Name                                            | Type   | Description  |
| ----------------------------------------------- | ------ | ------------ |
| Authorization<mark style="color:red;">\*</mark> | string | Bearer token |

{% tabs %}
{% tab title="200 " %}

```
{
    "status_code": 9999,
    "instance_id": "stg",
    "instance_version": "1.2.163",
    "payload": [
        "024********",
        "842*********"
    ],
    "key_enabled": false
}
```

{% endtab %}
{% endtabs %}

## Danh sách số hotline

<mark style="color:green;">`GET`</mark> `[URL]/api/call_center/hotline/search`

Lấy danh sách số hotline

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Query Parameters**

| Name      | Type   | Description                                              |
| --------- | ------ | -------------------------------------------------------- |
| `page`    | number | Thứ tự phân trang, bắt đầu bằng 1                        |
| `size`    | number | Giới hạn số lượng phân tử của danh sách trả về, max = 50 |
| `keyword` | string | Số hotline, name                                         |

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
    "instance_id": "stg",
    "payload": {
        "items": [
            {
                "number": "842871002283",
                "status": "active",
                "expire_date": 1743440340000,
                "created_date": 1730172218174,
                "last_updated_date": 1736270113875,
                "configs": {
                    "allow_call_in": true, // Cho phép gọi vào
                    "allow_call_out": true, // Cho phép gọi ra
                    "default_script": "677d6052f762e43be043ac35", // Kịch bản mặc định
                    "working_days": [
                        {
                            "weekday": 2,
                            "type": "full_day",
                            "script": "677d6052f762e43be043ac35",
                            "time_frames": [
                                {
                                    "from": "",
                                    "to": "",
                                    "script": ""
                                }
                            ]
                        },
                        {
                            "weekday": 3,
                            "type": "full_day",
                            "script": "677d6052f762e43be043ac35",
                            "time_frames": [
                                {
                                    "from": "",
                                    "to": "",
                                    "script": ""
                                }
                            ]
                        },
                        {
                            "weekday": 4,
                            "type": "full_day",
                            "script": "677d6052f762e43be043ac35",
                            "time_frames": [
                                {
                                    "from": "",
                                    "to": "",
                                    "script": ""
                                }
                            ]
                        },
                        {
                            "weekday": 5,
                            "type": "full_day",
                            "script": "677d6052f762e43be043ac35",
                            "time_frames": [
                                {
                                    "from": "",
                                    "to": "",
                                    "script": ""
                                }
                            ]
                        },
                        {
                            "weekday": 6,
                            "type": "full_day",
                            "script": "677d6052f762e43be043ac35",
                            "time_frames": [
                                {
                                    "from": "",
                                    "to": "",
                                    "script": ""
                                }
                            ]
                        },
                        {
                            "weekday": 7,
                            "type": "full_day",
                            "script": "677d6052f762e43be043ac35",
                            "time_frames": [
                                {
                                    "from": "",
                                    "to": "",
                                    "script": ""
                                }
                            ]
                        },
                        {
                            "weekday": 1,
                            "type": "full_day",
                            "script": "677d6052f762e43be043ac35",
                            "time_frames": [
                                {
                                    "from": "",
                                    "to": "",
                                    "script": ""
                                }
                            ]
                        }
                    ],
                    "special_days": [],
                    "call_configs": null
                },
                "access_type": "applies_to_all_employees",
                "number_type": "fixed",
                "accesses": [], // Phân quyền gọi ra
                "disable_by_time_frame": false,
                "outbound_config": null
            }
        ],
        "page_number": 1,
        "page_size": 50,
        "total_items": 1,
        "total_pages": 1,
        "has_next": false,
        "next_page": 1,
        "has_previous": false,
        "previous_page": 1
    },
    "instance_version": "1.2.164",
    "key_enabled": false,
    "status_code": 9999
}
```

{% endtab %}
{% endtabs %}

## Thông tin số hotline

<mark style="color:green;">`GET`</mark> `[URL]/api/call_center/hotline/by-phone`

Thông tin cấu hình của số hotline

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Query Parameters**

| Name      | Type   | Description |
| --------- | ------ | ----------- |
| `hotline` | string | Số hotline  |

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
    "instance_id": "stg",
    "payload": {
        "number": "842871002283",
        "status": "active",
        "expire_date": 1743440340000,
        "created_date": 1730172218174,
        "last_updated_date": 1736270113875,
        "configs": {
            "allow_call_in": true, // Cho phép gọi vào
            "allow_call_out": true, // Cho phép gọi ra
            "default_script": "677d6052f762e43be043ac35", // Kịch bản mặc định
            "working_days": [
                {
                    "weekday": 2,
                    "type": "full_day",
                    "script": "677d6052f762e43be043ac35",
                    "time_frames": [
                        {
                            "from": "",
                            "to": "",
                            "script": ""
                        }
                    ]
                },
                {
                    "weekday": 3,
                    "type": "full_day",
                    "script": "677d6052f762e43be043ac35",
                    "time_frames": [
                        {
                            "from": "",
                            "to": "",
                            "script": ""
                        }
                    ]
                },
                {
                    "weekday": 4,
                    "type": "full_day",
                    "script": "677d6052f762e43be043ac35",
                    "time_frames": [
                        {
                            "from": "",
                            "to": "",
                            "script": ""
                        }
                    ]
                },
                {
                    "weekday": 5,
                    "type": "full_day",
                    "script": "677d6052f762e43be043ac35",
                    "time_frames": [
                        {
                            "from": "",
                            "to": "",
                            "script": ""
                        }
                    ]
                },
                {
                    "weekday": 6,
                    "type": "full_day",
                    "script": "677d6052f762e43be043ac35",
                    "time_frames": [
                        {
                            "from": "",
                            "to": "",
                            "script": ""
                        }
                    ]
                },
                {
                    "weekday": 7,
                    "type": "full_day",
                    "script": "677d6052f762e43be043ac35",
                    "time_frames": [
                        {
                            "from": "",
                            "to": "",
                            "script": ""
                        }
                    ]
                },
                {
                    "weekday": 1,
                    "type": "full_day",
                    "script": "677d6052f762e43be043ac35",
                    "time_frames": [
                        {
                            "from": "",
                            "to": "",
                            "script": ""
                        }
                    ]
                }
            ],
            "special_days": [],
            "call_configs": null
        },
        "access_type": "applies_to_all_employees",
        "number_type": "fixed",
        "accesses": [], // Phân quyền gọi ra
        "disable_by_time_frame": false,
        "outbound_config": null
    },
    "instance_version": "1.2.164",
    "key_enabled": false,
    "status_code": 9999
}
```

{% endtab %}
{% endtabs %}

## Cập nhật đầu số hotline

<mark style="color:green;">`POST`</mark> `[URL]/api/call_center/hotline/update`

Cập nhật thông tin cấu hình GỌI RA, GỌI VÀO cơ bản của đầu số hotline

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Body**

<table><thead><tr><th>Name</th><th width="152">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>hotline</code></td><td>string</td><td>Số hotline của doanh nghiệp</td></tr><tr><td><code>extensions</code></td><td>Array String</td><td><p><code>["101","200","301"]</code></p><p></p><p>Phân quyền được dùng đầu số để gọi ra cho những </p><p>extensions trong danh sách</p></td></tr><tr><td><code>group_ids</code></td><td>Array String</td><td><p><code>["6333d3d3f4bfc27c57841093","XXXX"]</code></p><p></p><p>Phân quyền được dùng đầu số này gọi ra theo danh sách Id nhóm nội bộ trong danh sách (Tham khảo API danh sách nhóm nội bộ)</p></td></tr><tr><td><code>call_script</code></td><td>String</td><td><p></p><p>ID Kịch bản gọi vào, tiếp nhận cuộc gọi (Tham khảo API danh sách kịch bản cuộc gọi)</p><p>Kịch bản sẽ chạy 1 kịch bản mặc định cho các ngày trong tuần</p></td></tr><tr><td><code>allow_call_in</code></td><td>String</td><td>Bật/tắt chiều gọi vào của đầu số</td></tr><tr><td><code>allow_call_out</code></td><td>String</td><td>Bật/tắt chiều gọi ra của đầu số</td></tr><tr><td><code>access_type</code></td><td>String</td><td><p>"applies_to_all_employees": Áp dụng cho toàn bộ nhân viên.<br>"applies_according_to_employee_criteria": Áp dụng theo phân quyền</p><p></p></td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json

{
    "instance_id": "stg",
    "payload": true,
    "instance_version": "1.2.164",
    "key_enabled": false,
    "status_code": 9999
}
```

{% endtab %}
{% endtabs %}

## Cài đặt 1 đầu số, chỉ dùng cho 1 máy nhánh (Extension)

<mark style="color:green;">`POST`</mark> `[URL]/api/call_center/hotline/extension/update`

#### Request Body

| Name                                          | Type   | Description                                                                          |
| --------------------------------------------- | ------ | ------------------------------------------------------------------------------------ |
| hotline<mark style="color:red;">\*</mark>     | String | Số hotline                                                                           |
| user\_email<mark style="color:red;">\*</mark> | String | Email nhân viên dùng tổng đài                                                        |
| directions<mark style="color:red;">\*</mark>  | Array  | <p>outbound : Cài đặt cho chiều gọi ra</p><p>inbound : Cài đặt cho chiều gọi vào</p> |

{% tabs %}
{% tab title="200: OK " %}

{% endtab %}
{% endtabs %}

## Thông tin số nội bộ&#x20;

<mark style="color:blue;">`GET`</mark> `[URL]/api/call_center/extensions/detail?type=&keyword=`

#### Query Parameters

| Name                                      | Type   | Description                                                                                                                                                                                                                              |
| ----------------------------------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| type<mark style="color:red;">\*</mark>    | String | <p>Gồm các giá trị sau tương ứng với keyword được search </p><p><strong>usr\_uuid</strong> : Username từ bên thứ 3</p><p><strong>sip\_user</strong> : Số máy lẻ tổng đài </p><p><strong>user\_email</strong>: Email nhân viên</p><p></p> |
| keyword<mark style="color:red;">\*</mark> | String | Giá trị tìm kiếm tương ứng với type ở trên                                                                                                                                                                                               |

{% tabs %}
{% tab title="200: OK " %}

```json
{
    "instance_id": "stg",
    "payload": {
        "extension": "6349",
        "full_name": "Nguyen Tien",
        "mail": "contact18_usr_1685433772610@omicallpbx.com",
        "pbx_account": {
            "display_name": "6349",
            "sip_user": "6349",
            "sip_password": "rvld582289",
            "sip_web_socket_server": "wss://vh.omicrm.com:7443",
            "sip_realm": "contact18",
            "sip_proxy": "<sip:171.244.138.14;transport=udp>",
            "sip_proxy_port": "",
            "stun_servers": [],
            "transport": [
                "tcp",
                "udp",
                "ws",
                "wss"
            ],
            "use_opus": true,
            "opus_quality": 1
        },
        "uuid": "tientv11"
    },
    "instance_version": "1.2.164",
    "key_enabled": false,
    "status_code": 9999
}
```

{% endtab %}
{% endtabs %}

## Cập nhật thông tin số nội bộ

<mark style="color:blue;">`POST`</mark> `[URL]/api/call_center/internal_phone/update`

#### Headers

| Name          | Value             |
| ------------- | ----------------- |
| Authorization | `Bearer <token>`  |
| Content-Type  | `application/jso` |

#### Request Body

| Name                                        | Type   | Description                                              |
| ------------------------------------------- | ------ | -------------------------------------------------------- |
| sip\_user<mark style="color:red;">\*</mark> | String | Số máy lẻ nhân viên                                      |
| password                                    | String | Mật khẩu số máy lẻ nhân viên                             |
| call\_timeout                               | String | Thời gian chờ của nhân viên khi cuộc gọi chuyển tiếp tới |

{% tabs %}
{% tab title="200: OK" %}

```
{
   
}
```

{% endtab %}
{% endtabs %}

## Làm mới số nội bộ

<mark style="color:blue;">`GET`</mark> `[URL]/api/call_center/internal_phone/refresh`

Cho phép thu hồi lại các cấu hình tổng đài đã cài đặt cho user.  Đưa User trở lại trạng thái như lúc ban đầu tạo mới

#### Query Parameters

| Name         | Type   | Description         |
| ------------ | ------ | ------------------- |
| sip\_user \* | String | Số máy lẻ nhân viên |

#### Headers

| Name          | Type   | Description  |
| ------------- | ------ | ------------ |
| Authorization | String | Bearer Token |

{% tabs %}
{% tab title="200: OK" %}

```
{

}
```

{% endtab %}
{% endtabs %}

## Danh sách nhóm nội bộ

<mark style="color:blue;">`GET`</mark> `[URL]/api/call_center/internal_group/list`

#### Query Parameters

| Name    | Type    | Description                         |
| ------- | ------- | ----------------------------------- |
| keyword | String  | Từ khoá tìm kiếm                    |
| page    | Integer | Trang (Bắt đầu từ 1). Mặc định là 1 |
| size    | Integer | Kích thước trang (mặc định là 10)   |

#### Headers

| Name          | Type   | Description  |
| ------------- | ------ | ------------ |
| Authorization | String | Bearer Token |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
    "status_code": 9999,
    "instance_id": "stg",
    "instance_version": "1.2.163",
    "payload": {
        "items": [
            {
                "_id": "62ff11b208d4bf3ea694a6f3",
                "tenant_id": "6209c98461c1cb163ded25f7",
                "group_name": "Nhóm Tech",
                "group_name_unsigned": "Nhom Tech",
                "group_number": "38011",
                "created_date": 1660883378087,
                "last_updated_date": 1661221667904,
                "create_by": {
                    "id": "6209c98561c1cb163ded25fa",
                    "name": "OMI Hotline"
                },
                "last_update_by": {
                    "id": "6209c98561c1cb163ded25fa",
                    "name": "OMI Hotline"
                },
                "is_deleted": false,
                "note": null,
                "members": [
                    {
                        "agent_id": "62d563113127de2eac6b8cbf",
                        "contact_id": "62d563113127de2eac6b8cbe",
                        "order": 0,
                        "view": null,
                        "timeout": 30,
                        "sip_user": null,
                        "hold_music_id": null
                    },
                    {
                        "agent_id": "6209c98561c1cb163ded25fa",
                        "contact_id": "6209c98c067f745da47367d1",
                        "order": 0,
                        "view": null,
                        "timeout": 30,
                        "sip_user": null,
                        "hold_music_id": null
                    }
                ],
                "is_forward_to_user_owner": null,
                "is_forward_to_outer_group": false,
                "outer_group_id": null,
                "strategy": "enterprise",
                "ring_back_id": "",
                "ring_back_name": null,
                "is_answer": "false",
                "target_timeout_type": "",
                "target_timeout": "",
                "target_timeout_name": null,
                "ring_group_type": 0,
                "ring_group_wait_time": 0,
                "ring_group_wait_time_sequence": 2,
                "ring_group_type_result": null,
                "enable_criteria": false,
                "criterias": []
            },
            {
                "_id": "62ff11a208d4bf3ea694a539",
                "tenant_id": "6209c98461c1cb163ded25f7",
                "group_name": "Nhóm Sales",
                "group_name_unsigned": "Nhom Sales",
                "group_number": "62714",
                "created_date": 1660883362155,
                "last_updated_date": 1667615822209,
                "create_by": {
                    "id": "6209c98561c1cb163ded25fa",
                    "name": "OMI Hotline"
                },
                "last_update_by": {
                    "id": "6209c98561c1cb163ded25fa",
                    "name": "OMI Hotline"
                },
                "is_deleted": false,
                "note": null,
                "members": [
                    {
                        "agent_id": "62d563113127de2eac6b8cbf",
                        "contact_id": "62d563113127de2eac6b8cbe",
                        "order": 0,
                        "view": null,
                        "timeout": 30,
                        "sip_user": null,
                        "hold_music_id": null
                    },
                    {
                        "agent_id": "6209c98561c1cb163ded25fa",
                        "contact_id": "6209c98c067f745da47367d1",
                        "order": 0,
                        "view": null,
                        "timeout": 30,
                        "sip_user": null,
                        "hold_music_id": null
                    }
                ],
                "is_forward_to_user_owner": null,
                "is_forward_to_outer_group": false,
                "outer_group_id": null,
                "strategy": "enterprise",
                "ring_back_id": "",
                "ring_back_name": null,
                "is_answer": "false",
                "target_timeout_type": "",
                "target_timeout": "",
                "target_timeout_name": null,
                "ring_group_type": 0,
                "ring_group_wait_time": 0,
                "ring_group_wait_time_sequence": 0,
                "ring_group_type_result": null,
                "enable_criteria": false,
                "criterias": []
            },
            {
                "_id": "62ff119508d4bf3ea694a44a",
                "tenant_id": "6209c98461c1cb163ded25f7",
                "group_name": "Nhóm CSKH",
                "group_name_unsigned": "Nhom CSKH",
                "group_number": "54807",
                "created_date": 1660883349783,
                "last_updated_date": 1660883349783,
                "create_by": {
                    "id": "6209c98561c1cb163ded25fa",
                    "name": "OMI Hotline"
                },
                "last_update_by": null,
                "is_deleted": false,
                "note": null,
                "members": [
                    {
                        "agent_id": "6209c98561c1cb163ded25fa",
                        "contact_id": "6209c98c067f745da47367d1",
                        "order": 0,
                        "view": null,
                        "timeout": 30,
                        "sip_user": null,
                        "hold_music_id": null
                    }
                ],
                "is_forward_to_user_owner": null,
                "is_forward_to_outer_group": false,
                "outer_group_id": null,
                "strategy": "enterprise",
                "ring_back_id": "",
                "ring_back_name": null,
                "is_answer": "false",
                "target_timeout_type": "",
                "target_timeout": "",
                "target_timeout_name": null,
                "ring_group_type": 0,
                "ring_group_wait_time": 0,
                "ring_group_wait_time_sequence": 2,
                "ring_group_type_result": null,
                "enable_criteria": false,
                "criterias": []
            },
            {
                "_id": "6209c99b067f745da47367f4",
                "tenant_id": "6209c98461c1cb163ded25f7",
                "group_name": "Nhóm nhân viên mặc định",
                "group_name_unsigned": "Nhom nhan vien mac dinh",
                "group_number": "54919",
                "created_date": 1644808603212,
                "last_updated_date": 1662705652281,
                "create_by": {
                    "id": "6209c98561c1cb163ded25fa",
                    "name": "OMI Hotline"
                },
                "last_update_by": {
                    "id": "6209c98561c1cb163ded25fa",
                    "name": "OMI Hotline"
                },
                "is_deleted": false,
                "note": null,
                "members": [
                    {
                        "agent_id": "6209c98561c1cb163ded25fa",
                        "contact_id": "6209c98c067f745da47367d1",
                        "order": 0,
                        "view": null,
                        "timeout": 30,
                        "sip_user": null,
                        "hold_music_id": null
                    }
                ],
                "is_forward_to_user_owner": null,
                "is_forward_to_outer_group": false,
                "outer_group_id": null,
                "strategy": "enterprise",
                "ring_back_id": "",
                "ring_back_name": null,
                "is_answer": "false",
                "target_timeout_type": "Voice_mail",
                "target_timeout": "62da34652a310904dfbbf13b",
                "target_timeout_name": null,
                "ring_group_type": 0,
                "ring_group_wait_time": 0,
                "ring_group_wait_time_sequence": 0,
                "ring_group_type_result": null,
                "enable_criteria": false,
                "criterias": []
            }
        ],
        "page_number": 1,
        "page_size": 10,
        "total_items": 4,
        "total_pages": 1,
        "has_next": false,
        "next_page": 1,
        "has_previous": false,
        "previous_page": 1,
        "extension": null
    },
    "key_enabled": false
}
```

{% endtab %}
{% endtabs %}

## Tạo nhóm nội bộ

<mark style="color:green;">`POST`</mark> `[URL]/api/call_center/internal_group/add`

#### Request Body

<table><thead><tr><th width="205">Name</th><th width="133">Type</th><th>Description</th></tr></thead><tbody><tr><td>group_name<mark style="color:red;">*</mark></td><td>String</td><td>Tên nhóm</td></tr><tr><td>strategy<mark style="color:red;">*</mark></td><td>String</td><td><p>Hình thức đổ chuông của nhóm, Một trong các giá trị dưới</p><p><strong>enterprise</strong> : Đồng thời </p><p><strong>rollover</strong> : Tuần tự</p><p><strong>random</strong> : Ngẫu nhiên</p></td></tr><tr><td>sip_members<mark style="color:red;">*</mark></td><td>Array</td><td>Danh sách số máy lẻ nhân viên cần thêm vào nhóm</td></tr><tr><td>timeout<mark style="color:red;">*</mark></td><td>Integer</td><td>Thời gian chờ từng nhân viên</td></tr><tr><td>ring_group_type</td><td>Integer</td><td><p>Loại tiêu chí trong nhóm, áp dụng cho kịch bản tuần tự</p><p>1: Ưu tiên NV rảnh cao nhất</p><p>4: Ưu tiên nhân viên có tổng cuộc gọi trả lời trong ngày ít nhất</p><p>0: Không tiêu chí</p></td></tr><tr><td>target_timeout_type</td><td>String</td><td><p>Loại kịch bản sẽ chuyển tiếp khi kết thúc nhóm </p><p><strong>Recording</strong> : Lời chào</p><p><strong>Ivr_menu</strong> : Tương tác phím</p><p><strong>Ring_group</strong> : Nhóm</p></td></tr><tr><td>target_timeout</td><td>String</td><td>Id theo từng loại dữ liệu của <strong>target_timeout_type</strong></td></tr><tr><td>call_queue_config</td><td>Object</td><td>Cấu hình hàng đợi<br>{<br> "enable": true, //Bật tắt chức năng<br> "is_in_call": true, //Nhân viên bận<br> "is_offline": true, //Nhân viên không trực tuyến<br> "waiting_time": 90 //Thời gian chờ(s)<br> }</td></tr></tbody></table>

{% tabs %}
{% tab title="200: OK " %}

```json
{
  "status_code": 9999,
  "instance_id": "stg",
  "instance_version": "1.2.163",
  "payload": {
    "_id": "6391f5be232ce4664531e0cc",
    "tenant_id": "6209c98461c1cb163ded25f7",
    "group_name": "tientv11",
    "group_name_unsigned": "tientv11",
    "group_number": "22412",
    "created_date": 1670510011881,
    "last_updated_date": 1670510011881,
    "create_by": {
      "id": "6209c98561c1cb163ded25fa",
      "name": "OMI Hotline"
    },
    "last_update_by": null,
    "is_deleted": false,
    "note": null,
    "members": [
      {
        "agent_id": "6209c98561c1cb163ded25fa",
        "contact_id": "6209c98c067f745da47367d1",
        "order": 0,
        "view": null,
        "timeout": 30,
        "sip_user": null,
        "hold_music_id": null
      }
    ],
    "is_forward_to_user_owner": null,
    "is_forward_to_outer_group": false,
    "outer_group_id": null,
    "strategy": "random",
    "ring_back_id": null,
    "ring_back_name": null,
    "is_answer": null,
    "target_timeout_type": null,
    "target_timeout": null,
    "target_timeout_name": null,
    "ring_group_type": null,
    "ring_group_wait_time": 30,
    "ring_group_wait_time_sequence": 30,
    "ring_group_type_result": null,
    "enable_criteria": null,
    "criterias": null,
    "sip_members": [
      "100"
    ],
    "timeout": 30,
    "call_queue_config": {
      "enable": true,
      "is_in_call": true,
      "is_offline": true,
      "waiting_time": 90
    }
  },
  "key_enabled": false
}
```

{% endtab %}
{% endtabs %}

## Cập nhật nhóm nội bộ

<mark style="color:green;">`POST`</mark> `[URL]/api/call_center/internal_group/update/:id`

#### Path Parameters

| Name                                 | Type   | Description        |
| ------------------------------------ | ------ | ------------------ |
| id<mark style="color:red;">\*</mark> | String | Id của NHÓM NỘI BỘ |

#### Request Body

<table><thead><tr><th width="220">Name</th><th width="127">Type</th><th>Description</th></tr></thead><tbody><tr><td>group_name<mark style="color:red;">*</mark></td><td>String</td><td>Tên nhóm</td></tr><tr><td>strategy<mark style="color:red;">*</mark></td><td>String</td><td><p>Hình thức đổ chuông của nhóm, Một trong các giá trị dưới</p><p><strong>enterprise</strong> : Đồng thời </p><p><strong>rollover</strong> : Tuần tự</p><p><strong>random</strong> : Ngẫu nhiên</p></td></tr><tr><td>sip_members<mark style="color:red;">*</mark></td><td>String</td><td>Danh sách số máy lẻ nhân viên cần thêm vào nhóm</td></tr><tr><td>timeout<mark style="color:red;">*</mark></td><td>Integer</td><td>Thời gian chờ từng nhân viên</td></tr><tr><td>target_timeout_type</td><td>String</td><td><p>Loại kịch bản sẽ chuyển tiếp khi kết thúc nhóm </p><p><strong>Recording</strong> : Lời chào</p><p><strong>Ivr_menu</strong> : Tương tác phím</p><p><strong>Ring_group</strong> : Nhóm</p></td></tr><tr><td>target_timeout</td><td>String</td><td>Id theo từng loại dữ liệu của <strong>target_timeout_type</strong></td></tr><tr><td>ring_group_type</td><td>Integer</td><td><p>Loại tiêu chí trong nhóm, áp dụng cho kịch bản tuần tự</p><p>1: Ưu tiên NV rảnh cao nhất</p><p>4: Ưu tiên nhân viên có tổng cuộc gọi trả lời trong ngày ít nhất</p><p>0: Không tiêu chí</p></td></tr><tr><td>call_queue_config</td><td>Object</td><td>Cấu hình hàng đợi<br>{<br> "enable": true, //Bật tắt chức năng<br> "is_in_call": true, //Nhân viên bận<br> "is_offline": true, //Nhân viên không trực tuyến<br> "waiting_time": 90 //Thời gian chờ(s)<br> }</td></tr></tbody></table>

{% tabs %}
{% tab title="200: OK " %}

```json
{
  "status_code": 9999,
  "instance_id": "stg",
  "instance_version": "1.2.163",
  "payload": {
    "_id": "6391f5be232ce4664531e0cc",
    "tenant_id": "6209c98461c1cb163ded25f7",
    "group_name": "tientv11",
    "group_name_unsigned": "tientv11",
    "group_number": "22412",
    "created_date": 1670510011881,
    "last_updated_date": 1670510011881,
    "create_by": {
      "id": "6209c98561c1cb163ded25fa",
      "name": "OMI Hotline"
    },
    "last_update_by": null,
    "is_deleted": false,
    "note": null,
    "members": [
      {
        "agent_id": "6209c98561c1cb163ded25fa",
        "contact_id": "6209c98c067f745da47367d1",
        "order": 0,
        "view": null,
        "timeout": 30,
        "sip_user": null,
        "hold_music_id": null
      }
    ],
    "is_forward_to_user_owner": null,
    "is_forward_to_outer_group": false,
    "outer_group_id": null,
    "strategy": "random",
    "ring_back_id": null,
    "ring_back_name": null,
    "is_answer": null,
    "target_timeout_type": null,
    "target_timeout": null,
    "target_timeout_name": null,
    "ring_group_type": null,
    "ring_group_wait_time": 30,
    "ring_group_wait_time_sequence": 30,
    "ring_group_type_result": null,
    "enable_criteria": null,
    "criterias": null,
    "sip_members": [
      "100"
    ],
    "timeout": 30,
    "call_queue_config": {
      "enable": true,
      "is_in_call": true,
      "is_offline": true,
      "waiting_time": 90
    }
  },
  "key_enabled": false
}
```

{% endtab %}
{% endtabs %}

## Thêm nhân viên vào nhóm nội bộ

<mark style="color:green;">`POST`</mark> `[URL]/api/call_center/internal_group/add-members`

#### Request Body

| Name                                         | Type   | Description                             |
| -------------------------------------------- | ------ | --------------------------------------- |
| group\_id<mark style="color:red;">\*</mark>  | String | Id của nhóm nội bộ                      |
| sip\_users<mark style="color:red;">\*</mark> | Array  | Danh sách các số máy lẻ , thêm vào nhóm |

## Xoá nhân viên khỏi nhóm nội bộ

<mark style="color:green;">`POST`</mark> `[URL]/api/call_center/internal_group/remove-members`

#### Request Body

| Name                                         | Type   | Description                           |
| -------------------------------------------- | ------ | ------------------------------------- |
| group\_id<mark style="color:red;">\*</mark>  | String | Id của nhóm nội bộ                    |
| sip\_users<mark style="color:red;">\*</mark> | Array  | Danh sách số máy lẻ nhân viên cần xoá |

## Xoá nhóm nội bộ

<mark style="color:red;">`DELETE`</mark> `[URL]/api/call_center/internal_group/delete/:id`

#### Path Parameters

| Name                                 | Type   | Description |
| ------------------------------------ | ------ | ----------- |
| id<mark style="color:red;">\*</mark> | String | Id của nhóm |

## Danh sách kịch bản bấm phím

<mark style="color:blue;">`GET`</mark> `[URL]/api/call_center/key-interaction/list`

#### Query Parameters

| Name                                   | Type    | Description      |
| -------------------------------------- | ------- | ---------------- |
| keyword                                | String  | Từ khoá tìm kiếm |
| page<mark style="color:red;">\*</mark> | Integer | Trang            |
| size<mark style="color:red;">\*</mark> | Integer | Kích thước trang |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
   "status_code":9999,
   "instance_id":"stg",
   "instance_version":"1.2.163",
   "payload":{
      "items":[
         {
            "_id":"632969ce7534d97b0933d51d",
            "tenant_id":"6209c98461c1cb163ded25f7",
            "script_name":"KỊCH BẢN BẤM PHÍM",
            "script_name_unsigned":"KICH BAN BAM PHIM",
            "script_number":"166780",
            "greeting_id":"6209c99b067f745da47367f3",
            "greeting_name":null,
            "greeting_short_id":"",
            "greeting_short_name":null,
            "note":null,
            "created_date":1663658446348,
            "created_by":{
               "id":"6209c98561c1cb163ded25fa",
               "name":"OMI Hotline"
            },
            "last_updated_date":1663658542212,
            "last_updated_by":{
               "id":"6209c98561c1cb163ded25fa",
               "name":"OMI Hotline"
            },
            "is_deleted":false,
            "scripts":[
               {
                  "key":null,
                  "action_type":"Ring_group",
                  "action":"62ff119508d4bf3ea694a44a",
                  "action_name":null,
                  "ivr":"1"
               },
               {
                  "key":null,
                  "action_type":"Ring_group",
                  "action":"62ff119508d4bf3ea694a44a",
                  "action_name":null,
                  "ivr":"2"
               },
               {
                  "key":null,
                  "action_type":"",
                  "action":"",
                  "action_name":null,
                  "ivr":"3"
               },
               {
                  "key":null,
                  "action_type":"",
                  "action":"",
                  "action_name":null,
                  "ivr":"4"
               },
               {
                  "key":null,
                  "action_type":"",
                  "action":"",
                  "action_name":null,
                  "ivr":"5"
               }
            ],
            "time_out":3,
            "action_type":"",
            "action":"",
            "action_name":null,
            "invalid_sound_id":"",
            "invalid_sound_name":null,
            "max_failure":1,
            "ivr_direct_menu_dial":null
         }
      ],
      "page_number":1,
      "page_size":10,
      "total_items":1,
      "total_pages":1,
      "has_next":false,
      "next_page":1,
      "has_previous":false,
      "previous_page":1,
      "extension":null
   },
   "key_enabled":false
}
```

{% endtab %}
{% endtabs %}

## Tạo mới kịch bản bấm phím

<mark style="color:green;">`POST`</mark> `[URL]/api/call_center/key-interaction/add`

#### Request Body

| Name                                           | Type    | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| ---------------------------------------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| script\_name<mark style="color:red;">\*</mark> | String  | Tên kịch bản bấm phím (Chú ý không được trùng)                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| max\_failure<mark style="color:red;">\*</mark> | Integer | Số lần nhấn sai phím                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| time\_out<mark style="color:red;">\*</mark>    | Integer | Thời gian chờ KH bấm phím,  hoặc Khi  kết thúc file ghi âm                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| scripts<mark style="color:red;">\*</mark>      | Array   | <p>Danh sách mảng đối tượng phím</p><p>Cách loại kịch bản đi kèm với phím bấm.<br><strong>Thành phần là nhóm nội bộ</strong></p><p>{</p><p>   "ivr" : "", //Tên phím 1,2,3..</p><p>    "action": "xxxxxxxx" // Id của nhóm nội bộ</p><p>  "action\_type":"<em>Ring\_group</em>"</p><p>}</p><p><strong>Thành phần là kịch bản bấm phím</strong> </p><p>{</p><p>   "ivr" : "", //Tên phím 1,2,3..</p><p>    "action": "xxxxxxxx" // Id Kịch bản bấm phím.</p><p>  "action\_type":"<em>Ivr\_menu</em>"</p><p>}</p><p></p> |
| greeting\_id<mark style="color:red;">\*</mark> | String  | Id của file ghi âm (API upload file ghi âm)                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| greeting\_short\_id                            | String  | Id của file ghi âm( Nhạc chờ khi trở lại tương tác bấm phím)                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| invalid\_sound\_id                             | String  | Id của file ghi âm (Nhạc chờ khi nhấn sai phím)                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| action                                         | String  | Id của hành động action\_type theo các loại tương ứng                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| action\_type                                   | String  | <p>Loại hành động khi không nhấn phím, hoặc nhấn sai phím quá số lần cho phép</p><p>Ring\_group : Nhóm nội bộ</p><p>Ivr\_menu : Kịch bản bấm phím </p><p>Recording : Lời chào</p>                                                                                                                                                                                                                                                                                                                                      |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
   "status_code":9999,
   "instance_id":"stg",
   "instance_version":"1.2.163",
   "payload":{
      "_id":"632969ce7534d97b0933d51d",
      "tenant_id":"6209c98461c1cb163ded25f7",
      "script_name":"KỊCH BẢN BẤM PHÍM",
      "script_name_unsigned":"KICH BAN BAM PHIM",
      "script_number":"166780",
      "greeting_id":"62da34652a310904dfbbf13b",
      "greeting_name":null,
      "greeting_short_id":"",
      "greeting_short_name":null,
      "note":null,
      "created_date":1663658446348,
      "created_by":{
         "id":"6209c98561c1cb163ded25fa",
         "name":"OMI Hotline"
      },
      "last_updated_date":1670644627322,
      "last_updated_by":{
         "id":"6209c98561c1cb163ded25fa",
         "name":"OMI Hotline"
      },
      "is_deleted":false,
      "scripts":[
         {
            "key":null,
            "action_type":"Ivr_menu",
            "action":"6391fa5f44b0fb4429b580c0",
            "action_name":null,
            "ivr":"1"
         },
         {
            "key":null,
            "action_type":"",
            "action":"",
            "action_name":null,
            "ivr":"5"
         }
      ],
      "time_out":3,
      "action_type":"",
      "action":"",
      "action_name":null,
      "invalid_sound_id":"6209c99b067f745da47367f3",
      "invalid_sound_name":null,
      "max_failure":1,
      "ivr_direct_menu_dial":"false"
   },
   "key_enabled":false
}
```

{% endtab %}
{% endtabs %}

## Cập nhật kịch bản bấm phím

<mark style="color:green;">`POST`</mark> `[URL]/api/call_center/key-interaction/update/:id`

#### Path Parameters

| Name | Type   | Description |
| ---- | ------ | ----------- |
| id   | String | Id kịch bản |

#### Request Body

| Name                                           | Type    | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| ---------------------------------------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| script\_name<mark style="color:red;">\*</mark> | String  | Tên kịch bản bấm phím                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| greeting\_id<mark style="color:red;">\*</mark> | String  | Id file ghi âm                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| max\_failure<mark style="color:red;">\*</mark> | Integer | Số lần nhấn sai phím                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| time\_out<mark style="color:red;">\*</mark>    | Integer | Thời gian chờ KH nhấn phím hoặc lời chào kết thúc                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| scripts<mark style="color:red;">\*</mark>      | Array   | <p>Danh sách mảng đối tượng phím</p><p>Cách loại kịch bản đi kèm với phím bấm.<br><strong>Thành phần là nhóm nội bộ</strong></p><p>{</p><p>   "ivr" : "", //Tên phím 1,2,3..</p><p>    "action": "xxxxxxxx" // Id của nhóm nội bộ</p><p>  "action\_type":"<em>Ring\_group</em>"</p><p>}</p><p><strong>Thành phần là kịch bản bấm phím</strong> </p><p>{</p><p>   "ivr" : "", //Tên phím 1,2,3..</p><p>    "action": "xxxxxxxx" // Id Kịch bản bấm phím.</p><p>  "action\_type":"<em>Ivr\_menu</em>"</p><p>}</p><p></p> |
| action\_type                                   | String  | <p>Loại hành động khi không nhấn phím, hoặc nhấn sai phím quá số lần cho phép</p><p>Ring\_group : Nhóm nội bộ</p><p>Ivr\_menu : Kịch bản bấm phím </p><p>Recording : Lời chào</p><p></p><p></p>                                                                                                                                                                                                                                                                                                                        |
| action                                         | String  | Id của hành động action\_type theo các loại tương ứng                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| invalid\_sound\_id                             | String  | Id của file ghi âm (Nhạc chờ khi nhấn sai phím)                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| greeting\_short\_id                            | String  | Id của file ghi âm( Nhạc chờ khi trở lại tương tác bấm phím)                                                                                                                                                                                                                                                                                                                                                                                                                                                           |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
   "status_code":9999,
   "instance_id":"stg",
   "instance_version":"1.2.163",
   "payload":{
      "_id":"632969ce7534d97b0933d51d",
      "tenant_id":"6209c98461c1cb163ded25f7",
      "script_name":"KỊCH BẢN BẤM PHÍM",
      "script_name_unsigned":"KICH BAN BAM PHIM",
      "script_number":"166780",
      "greeting_id":"62da34652a310904dfbbf13b",
      "greeting_name":null,
      "greeting_short_id":"",
      "greeting_short_name":null,
      "note":null,
      "created_date":1663658446348,
      "created_by":{
         "id":"6209c98561c1cb163ded25fa",
         "name":"OMI Hotline"
      },
      "last_updated_date":1670644627322,
      "last_updated_by":{
         "id":"6209c98561c1cb163ded25fa",
         "name":"OMI Hotline"
      },
      "is_deleted":false,
      "scripts":[
         {
            "key":null,
            "action_type":"Ivr_menu",
            "action":"6391fa5f44b0fb4429b580c0",
            "action_name":null,
            "ivr":"1"
         },
         {
            "key":null,
            "action_type":"",
            "action":"",
            "action_name":null,
            "ivr":"5"
         }
      ],
      "time_out":3,
      "action_type":"",
      "action":"",
      "action_name":null,
      "invalid_sound_id":"6209c99b067f745da47367f3",
      "invalid_sound_name":null,
      "max_failure":1,
      "ivr_direct_menu_dial":"false"
   },
   "key_enabled":false
}
```

{% endtab %}
{% endtabs %}

## XOÁ kịch bản bấm phím

<mark style="color:red;">`DELETE`</mark> `[URL]/api/call_center/key-interaction/delete/:id`

#### Path Parameters

| Name                                 | Type   | Description     |
| ------------------------------------ | ------ | --------------- |
| id<mark style="color:red;">\*</mark> | String | Id của kịch bản |

## Danh sách file ghi âm

<mark style="color:blue;">`GET`</mark> `[URL]/api/call_center/greeting/list`

#### Query Parameters

| Name                                   | Type    | Description                    |
| -------------------------------------- | ------- | ------------------------------ |
| page<mark style="color:red;">\*</mark> | Integer | Trang (bắt đầu từ 1)           |
| size<mark style="color:red;">\*</mark> | Integer | Kích thước trang (mặc định 10) |

{% tabs %}
{% tab title="200: OK " %}

````javascript

{
    "status_code": 9999,
    "instance_id": "stg",
    "instance_version": "1.2.163",
    "payload": {
        "items": [
            {
                "_id": "6391f975b4c5c92743725fa3",
                "created_date": 1670510965969,
                "last_updated_date": 1670510965977,
                "create_by": null,
                "last_update_by": null,
                "tenant_id": "6209c98461c1cb163ded25f7",
                "greeting_name": "Name 1",
                "greeting_name_unsigned": "name 1",
                "formality": "Robot đọc",
                "recording_file": "6c0d4c55-d837-4ae5-835e-c16180b09e51.mp3",
                "content": "Name 1",
                "voice": "banmai",
                "speed": 0,
                "is_deleted": false,
                "is_hidden_in_list": null
            },
            {
                "_id": "634944c8df71333e7787e03d",
                "created_date": 1665746120033,
                "last_updated_date": 1665746120033,
                "create_by": null,
                "last_update_by": null,
                "tenant_id": "6209c98461c1cb163ded25f7",
                "greeting_name": "Thêm mới thành công",
                "greeting_name_unsigned": "them moi thanh cong",
                "formality": "Robot đọc",
                "recording_file": "d1969275-e403-438f-935c-6425d1550692.mp3",
                "content": "Thêm mới thành công",
                "voice": "banmai",
                "speed": 0,
                "is_deleted": false,
                "is_hidden_in_list": null
            },
            {
                "_id": "634944a5823f5332401ec9c3",
                "created_date": 1665746085884,
                "last_updated_date": 1665746085884,
                "create_by": null,
                "last_update_by": null,
                "tenant_id": "6209c98461c1cb163ded25f7",
                "greeting_name": "Thêm mới",
                "greeting_name_unsigned": "them moi",
                "formality": "Robot đọc",
                "recording_file": "d8bc922b-cabf-4e28-8198-6021f5b82c14.mp3",
                "content": "Thêm mới thành công hay thất bại",
                "voice": "banmai",
                "speed": 0,
                "is_deleted": false,
                "is_hidden_in_list": null
            }
        ],
        "page_number": 1,
        "page_size": 3,
        "total_items": 13,
        "total_pages": 5,
        "has_next": true,
        "next_page": 2,
        "has_previous": false,
        "previous_page": 1,
        "extension": null
    },
    "key_enabled": false
}
```
````

{% endtab %}
{% endtabs %}

## Upload file ghi âm

<mark style="color:green;">`POST`</mark> `[URL]/api/call_center/greeting/upload`

Chú ý : **Request là form-data và chỉ hỗ trợ mp3**

#### Query Parameters

| Name           | Type   | Description |
| -------------- | ------ | ----------- |
| greeting\_name | String | Tên file    |

#### Request Body

| Name                                   | Type   | Description      |
| -------------------------------------- | ------ | ---------------- |
| file<mark style="color:red;">\*</mark> | Binary | Dữ liệu của file |

## Upload file ghi âm : Robot đọc (Text To Speech)

<mark style="color:green;">`POST`</mark> `[URL]/api/call_center/greeting/upload-text-to-speech`

#### Query Parameters

| Name                                             | Type   | Description     |
| ------------------------------------------------ | ------ | --------------- |
| greeting\_name<mark style="color:red;">\*</mark> | String | Tên file ghi âm |

#### Request Body

| Name                                    | Type   | Description                                                                                                                                                                           |
| --------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| text<mark style="color:red;">\*</mark>  | String | Nội dung cần đọc **< 300 ký tự**                                                                                                                                                      |
| speed<mark style="color:red;">\*</mark> | String | <p>Tốc độ đọc, Giá trị từ  -3 - 3<br>- 3 : Cực kì chậm<br>-2 : Rất chậm<br>-1 : Chậm<br>0 : Bình thường<br>1 : Nhanh<br>...</p><p></p>                                                |
| voice<mark style="color:red;">\*</mark> | String | ID giọng đọc mặc định là 'northern\_female\_ngocanh'. Danh sách ID các giọng đọc: northern\_female\_ngocanh southern\_male\_tienhuy northern\_male\_anhkiet southern\_female\_khangan |

{% tabs %}
{% tab title="200: OK " %}

````javascript
{
    "status_code": 9999,
    "instance_id": "stg",
    "instance_version": "1.2.163",
    "payload": {
        "file": {
            "_id": "639981151ee2ed6f5bbeea90",
            "created_date": 1671004437213,
            "last_updated_date": 1671004437213,
            "create_by": null,
            "last_update_by": null,
            "tenant_id": "6209c98461c1cb163ded25f7",
            "greeting_name": "Nhắc lịch đào tạo",
            "greeting_name_unsigned": "Nhac lich dao tao",
            "formality": "Robot đọc",
            "recording_file": "a6c2edd9-9af1-4e71-98a7-657c3c1e0466.mp3",
            "content": "Bạn có một lịch họp sắp đến giờ, bạn vui lòng chú ý thời gian để đến đúng giờ",
            "voice": "banmai",
            "speed": 0,
            "is_deleted": false,
            "is_hidden_in_list": null
        }
    },
    "key_enabled": false
}
```
````

{% endtab %}
{% endtabs %}

## Xoá file ghi âm

<mark style="color:red;">`DELETE`</mark> `[URL]/api/call_center/greeting/delete/:id`

#### Path Parameters

| Name                                 | Type   | Description    |
| ------------------------------------ | ------ | -------------- |
| id<mark style="color:red;">\*</mark> | String | Id file ghi âm |

## Danh sách kịch bản

<mark style="color:green;">`GET`</mark> `[URL]/api/call_center/call_script/list?page=&size=`

Danh sách kịch bản cuộc gọi

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Request Params**

| Name | Type    | Description      |
| ---- | ------- | ---------------- |
| page | Integer | Trang            |
| size | Integer | Kích thước trang |

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
    "instance_id": "stg",
    "payload": {
        "items": [
            {
                "_id": "6333d3d3f4bfc27c57841093",
                "extension": "3638325",
                "created_date": 1664340947781,
                "last_updated_date": 1736159391976,
                "create_by": {
                    "id": "6209c98561c1cb163ded25fa",
                    "name": "Trần Văn Tiến"
                },
                "last_update_by": {
                    "id": "6209c98561c1cb163ded25fa",
                    "name": "Trần Văn Tiến"
                },
                "tenant_id": "6209c98461c1cb163ded25f7",
                "script_name": "Nhóm CSKH",
                "script_name_unsigned": "Nhom CSKH",
                "note": "",
                "is_deleted": false,
                "callscript_type": 0,
                "callscript_wait_time": 5,
                "scripts": [
                    {
                        "action_type": "Ring_group",
                        "action_id": "62ff119508d4bf3ea694a44a",
                        "order": 0,
                        "action_name": null,
                        "voice": null,
                        "callbot_script_uuid": null
                    }
                ],
                "enable_criteria": true,
                "criterias": [
                    {
                        "type": "2",
                        "wait_time": "10",
                        "timeout_time": "10"
                    }
                ]
            }
        ],
        "page_number": 1,
        "page_size": 10,
        "total_items": 1,
        "total_pages": 1,
        "has_next": false,
        "next_page": 1,
        "has_previous": false,
        "previous_page": 1,
        "extension": null
    },
    "instance_version": "1.2.164",
    "key_enabled": false,
    "status_code": 9999
}
```

{% endtab %}
{% endtabs %}

## Tạo mới kịch bản cuộc gọi

<mark style="color:green;">`POST`</mark> `[URL]/api/call_center/call_script/add`

Tạo mới kịch bản cuộc gọi

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Body**

<table><thead><tr><th width="155">Name</th><th width="132">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>script_name *</code></td><td>string</td><td>Tên kịch bản</td></tr><tr><td><code>note</code></td><td>string</td><td>Mô tả về kịch bản</td></tr><tr><td>scripts *</td><td>Array Object</td><td><pre><code><strong>[{
</strong>    "action_id":"",
    "action_type":""
 }]
</code></pre><p>Là thành phần bên trong kịch bản. Ví dụ khi cần chuyển tiếp tới nhân viên, nhóm , hoặc tương tác phím. Chúng được quy định bởi : </p><p><strong>action_id : Là id của thành phần</strong> </p><p><strong>action_type : Là loại thành phần :</strong> </p><pre class="language-json"><code class="lang-json">Extension : Tới nhân viên
Ivr_menu : Tương tác phím
Ring_group : Nhóm nội bộ
Recording : Lời chào
</code></pre></td></tr><tr><td><p></p><p>criterias</p></td><td>Array Object</td><td>[<br>{<br>"type": "2",<br>"timeout_time": "10",<br>"wait_time": "10"<br>},<br>{<br>"type": "3",<br>"timeout_time": "10",<br>"wait_time": "10"<br>},<br>{<br>"type": "4",<br>"timeout_time": "10",<br>"wait_time": "10"<br>}<br>]<br>Là tiêu chí kịch bản.<br>"type" : "2" là tiêu chí nhân viên quản lý khách hàng<br>"type" : "3" là tiêu chí nhân viên từng gọi điện cho khách hàng đó<br>"type" : "4" là tiêu chí nhân viên có cuộc gọi nhỡ với khách hàng đó<br>"timeout_time" là thời gian chờ của nhân viên (s)<br>"wait_time" là thời gian chờ khi không trực tuyến (s)<br></td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
    "instance_id": "stg",
    "payload": {
        "_id": "677cc34c7af28d0abf247aff",
        "extension": "4187167",
        "created_date": 1736229708336,
        "last_updated_date": 1736229708336,
        "create_by": {
            "id": "6209c98561c1cb163ded25fa",
            "name": "Trần Văn Tiến"
        },
        "last_update_by": null,
        "tenant_id": "6209c98461c1cb163ded25f7",
        "script_name": "KB demo Api",
        "script_name_unsigned": "KB demo Api",
        "note": "",
        "is_deleted": false,
        "callscript_type": 0,
        "callscript_wait_time": 5,
        "scripts": [
            {
                "action_type": "Ring_group",
                "action_id": "62ff119508d4bf3ea694a44a",
                "order": 0,
                "action_name": null,
                "voice": null,
                "callbot_script_uuid": null
            }
        ],
        "enable_criteria": false,
        "criterias": []
    },
    "instance_version": "1.2.164",
    "key_enabled": false,
    "status_code": 9999
}
```

{% endtab %}
{% endtabs %}

## Cập nhật kịch bản

<mark style="color:green;">`PUT`</mark> `[URL]/api/call_center/call_script/update/:id`

\<Description of the endpoint>

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Path Parameters**

|    |        |                              |
| -- | ------ | ---------------------------- |
| id | string | Id của kịch bản cần cập nhật |

**Body**

<table><thead><tr><th width="166">Name</th><th width="137">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>name *</code></td><td>string</td><td>Tên kịch bản</td></tr><tr><td><code>note</code></td><td>string</td><td>Ghi chú về kịch bản</td></tr><tr><td>scripts *</td><td>Array Object</td><td><p></p><pre><code><strong>[{
</strong>    "action_id":"",
    "action_type":""
 }]
</code></pre><p>Là thành phần bên trong kịch bản. Ví dụ khi cần chuyển tiếp tới nhân viên, nhóm , hoặc tương tác phím. Chúng được quy định bởi : </p><p><strong>action_id : Là id của thành phần</strong> </p><p><strong>action_type : Là loại thành phần :</strong> </p><pre class="language-json"><code class="lang-json">Extension : Tới nhân viên
Ivr_menu : Tương tác phím
Ring_group : Nhóm nội bộ
Recording : Lời chào
</code></pre></td></tr><tr><td>criterias</td><td>Array Object</td><td>[<br>{<br>"type": "2",<br>"timeout_time": "10",<br>"wait_time": "10"<br>},<br>{<br>"type": "3",<br>"timeout_time": "10",<br>"wait_time": "10"<br>},<br>{<br>"type": "4",<br>"timeout_time": "10",<br>"wait_time": "10"<br>}<br>]<br>Là tiêu chí kịch bản.<br>"type" : "2" là tiêu chí nhân viên quản lý khách hàng<br>"type" : "3" là tiêu chí nhân viên từng gọi điện cho khách hàng đó<br>"type" : "4" là tiêu chí nhân viên có cuộc gọi nhỡ với khách hàng đó<br>"timeout_time" là thời gian chờ của nhân viên (s)<br>"wait_time" là thời gian chờ khi không trực tuyến (s)</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
    "instance_id": "stg",
    "payload": {
        "_id": "677cc34c7af28d0abf247aff",
        "extension": "4187167",
        "created_date": 1736229708336,
        "last_updated_date": 1736229708336,
        "create_by": {
            "id": "6209c98561c1cb163ded25fa",
            "name": "Trần Văn Tiến"
        },
        "last_update_by": null,
        "tenant_id": "6209c98461c1cb163ded25f7",
        "script_name": "KB demo Api",
        "script_name_unsigned": "KB demo Api",
        "note": "",
        "is_deleted": false,
        "callscript_type": 0,
        "callscript_wait_time": 5,
        "scripts": [
            {
                "action_type": "Ring_group",
                "action_id": "62ff119508d4bf3ea694a44a",
                "order": 0,
                "action_name": null,
                "voice": null,
                "callbot_script_uuid": null
            }
        ],
        "enable_criteria": false,
        "criterias": []
    },
    "instance_version": "1.2.164",
    "key_enabled": false,
    "status_code": 9999
}
```

{% endtab %}
{% endtabs %}

## Xoá kịch bản cuộc gọi

<mark style="color:green;">`DELETE`</mark> `[URL]/api/call_center/call_script/delete/:id`

Xoá kịch bản cuộc gọi

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Path Parameters**

| Name | Type   | Description      |
| ---- | ------ | ---------------- |
| `id` | string | Name of the user |

**Response**

{% tabs %}
{% tab title="200" %}

```json

{
    "instance_id": "stg",
    "payload": true,
    "instance_version": "1.2.164",
    "key_enabled": false,
    "status_code": 9999
}
```

{% endtab %}
{% endtabs %}


# Lịch sử cuộc gọi

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


# v2

## Danh sách

<mark style="color:blue;">`POST`</mark>`[URL]`/api/v2/callTransaction/search

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

<mark style="color:$primary;">\*</mark> <mark style="color:$primary;">Tạm dừng cập nhật từ ngày 01/04/2026, vui lòng sử dụng</mark> [<mark style="color:$primary;">API v3</mark>](https://api.omicall.com/omicall-api/call-transaction/v2#danh-sach-v3)

#### Path Parameters

| Name | Type    | Description                                              |
| ---- | ------- | -------------------------------------------------------- |
| page | integer | Thứ tự phân trang, bắt đầu bằng 1                        |
| size | int     | Giới hạn số lượng phân tử của danh sách trả về, max = 50 |

#### Request Body

| Name                  | Type    | Description                                                  |
| --------------------- | ------- | ------------------------------------------------------------ |
| fromDate              | long    | Thời gian bắt đầu                                            |
| toDate                | long    | Thời gian kết thúc                                           |
| directions            | array   | Hướng cuộc gọi gồm: outbound, inbound, local                 |
| tagIds                | array   | Danh sách ID của tag cần lọc                                 |
| sipNumbers            | array   | Danh sách đầu số                                             |
| sipUsers              | array   | Danh sách số nội bộ của nhân viên                            |
| phoneNumbers          | array   | Danh sách số điện thoại khách hàng                           |
| transactionIds        | array   | Danh sách call UUID của cuộc gọi                             |
| agentEmails           | array   | Danh sách email của nhân viên thực hiện cuộc gọi             |
| agentUuids            | array   | Danh sách UUID nhân viên, không kết hợp lọc cùng agentEmails |
| isAutoCall            | Boolean | Lọc cuộc gọi tự động                                         |
| isCallBot             | Boolean | Lọc cuộc gọi voiceBot                                        |
| autoCallIds           | array   | Danh sách ID phiên gọi tự động thường hoặc voiceBot          |
| isAnswer              | Boolean | Lọc cuộc gọi có trả lời                                      |
| queueDestinations     | array   | Danh sách nhóm nội bộ                                        |
| outerGroups           | array   | Danh sách nhóm ngoài                                         |
| keyInteractiveScripts | array   | Danh sách số nội bộ của kịch bản tương tác phím              |
| keyword               | String  | Từ khóa tìm kiếm lớn hơn 3 ký tự                             |
| sortField             | String  | Field cần sort                                               |
| sortAsc               | Boolean | Thứ tự sort                                                  |

#### Headers

| Name          | Type   | Description                  |
| ------------- | ------ | ---------------------------- |
| Content-type  | string | application/json             |
| Authorization | string | Access Token: Bearer 'token' |

{% tabs %}
{% tab title="200 Danh sách cuộc gọi" %}

```

{
    "instance_id": "stg",
    "payload": {
        "items": [
            {
                "transaction_id": "", //Call UUID cuộc gọi
                "tenant_id": "", //ID của DN
                "direction": "outbound", //Hướng gọi
                "source_number": "xxx", //Số nguồn
                "destination_number": "xxx", //Số đích
                "bill_sec": 5, //Thời lượng cuộc gọi
                "record_seconds": 3, //Thời lượng file ghi âm
                "time_start_call": 1776849067, // Thời gian bắt đầu cuộc gọi
                "time_answer_start": 1776849073, // Thời gian bắt đầu trả lời
                "time_end_call": 1776849079, // Thời gian kết thúc cuộc gọi
                "time_ringing_start": 1776849073, // Thời gian bắt đầu đổ chuông cho nhân viên
                "recording_file": "",
                "recording_file_url": "", //Link file ghi âm
                "recording_data": null,
                "sip_user": "999", //Số nội bộ nhân viên thực hiện
                "created_date": 1729870397069, //Ngày tạo
                "last_updated_date": 1730788680689, //Ngày cập nhật
                "is_auto_call": false, //Cờ đánh dấu cuộc gọi tự động
                "ivr": "none",
                "provider": "viettel", //Nhà mạng số điện thoại KH
                "duration": 10, //Tổng thời gian
                "user": [ //Thông tin nhân viên liên quan đến cuộc gọi
                    {
                        "full_name": "DEV ZONE",
                        "full_name_unsigned": "DEV ZONE",
                        "note": null,
                        "tag": null
                    },
                    {
                        "full_name": "DEV ZONE",
                        "full_name_unsigned": "dev zone",
                        "note": "OMIDEV",
                        "tag": [
                            {
                                "name": "ATC_01"
                            }
                        ]
                    }
                ],
                "customer": {//Thông tin khách hàng
                    "full_name": "Trần Đình Tâm",
                    "full_name_unsigned": "tran dinh tam"
                },
                "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": 66.000, //Cước gọi
                "note": null, //Thông tin ghi chú cuộc gọi
                "tag": [ //Danh sách ID tag cuộc gọi
                    "63c0bb010748c865ba321c53"
                ],
                "invite_failure_status": null,
                "answer_sec": 3, //Thời gian trả lời
                "autocall_uuid": null, //Mã UUID mapping thông tin chi tiết cuộc gọi auto call
                "autocall_id": null, //ID phiên gọi auto call
                "sip_number": "842499950291", //Đầu số
                "phone_number": "0983223566", //Số điện thoại khách hàng
                "create_by": { //Nhân viên thực hiện cuộc gọi
                    "id": "60e79bd864b64271a923affe",
                    "name": "DEV ZONE",
                    "contact_id": "60e79beb1b20043c4e7a68af",
                    "avatar": null,
                    "gender": null,
                    "uuid": null,
                    "type": "agent"
                },
                "transfer_histories": [], //Danh sách luồng cuộc gọi
                "user_data_str": null,
                "user_ref_code": null,
                "endby_name": "end_call_by_customer", //Nguyên nhân tắt máy
                "hangup_cause": "NORMAL_CLEARING",
                "sip_hangup_disposition": "send_bye",
                "hangup_cause_q850": 16,
                "is_voicemail": false, //Cờ đánh dấu cuộc gọi vào hộp thư thoại
                "recording_file_voicemail": null,
                "domain_fusion": "omicalltest1",
                "send_num_retry": 0,
                "out_of_working_time": true,
                "sip_number_tags": [],
                "evaluations": null,
                "total_evaluate": null,
                "internal_destination": null,
                "classifies": null,
                "collect_info_variables": null //Danh sách kết quả thu thập cuộc gọi voice bot
            }
        ],
        "page_number": 1,
        "page_size": 50,
        "total_items": 1,
        "total_pages": 1,
        "has_next": false,
        "next_page": 1,
        "has_previous": false,
        "previous_page": 1,
        "extension": null
    },
    "instance_version": "1.2.164",
    "key_enabled": false,
    "status_code": 9999
}

```

{% endtab %}
{% endtabs %}

<table data-header-hidden><thead><tr><th width="229">Mã Lỗi</th><th>Mô tả</th></tr></thead><tbody><tr><td>Mã Lỗi</td><td>Mô tả</td></tr><tr><td><em>missing_time_query</em></td><td>Thiếu bộ lọc thời gian</td></tr><tr><td><em>date_is_too_long</em></td><td>Khoảng cách thời gian quá lớn, giới hạn trong 3 tháng gần nhất</td></tr><tr><td><em>email_agent_not_found</em></td><td>Bộ lọc email nhân viên không đúng hoặc không có giữ liệu nhân viên</td></tr><tr><td><em>uuid_agent_not_found</em></td><td>Bộ lọc agentUuids không đúng hoặc không có giữ liệu nhân viên </td></tr></tbody></table>

## Danh sách (v3)

<mark style="color:blue;">`POST`</mark>`[URL]/api/v3/call-transaction/search?page=1&size=50`

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

#### Request Parameters

| Name | Type    | Description                                              |
| ---- | ------- | -------------------------------------------------------- |
| page | Integer | Thứ tự phân trang, bắt đầu bằng 1                        |
| size | Integer | Giới hạn số lượng phân tử của danh sách trả về, max = 50 |

#### Request Body

| Name                                              | Type    | Description                                         |
| ------------------------------------------------- | ------- | --------------------------------------------------- |
| filter.fromDate<mark style="color:red;">\*</mark> | Long    | Thời gian bắt đầu                                   |
| filter.toDate<mark style="color:red;">\*</mark>   | Long    | Thời gian kết thúc                                  |
| filter.directions                                 | Array   | Hướng cuộc gọi gồm: outbound, inbound, local        |
| filter.tagIds                                     | Array   | Danh sách ID của tag cần lọc                        |
| filter.sipNumbers                                 | Array   | Danh sách đầu số                                    |
| filter.sipUsers                                   | Array   | Danh sách số nội bộ của nhân viên                   |
| filter.phoneNumbers                               | Array   | Danh sách số điện thoại khách hàng                  |
| filter.transactionIds                             | Array   | Danh sách call UUID của cuộc gọi                    |
| filter.agentIds                                   | Array   | Danh sách id của nhân viên thực hiện cuộc gọi       |
| filter.isAutoCall                                 | Boolean | Lọc cuộc gọi tự động                                |
| filter.isCallBot                                  | Boolean | Lọc cuộc gọi voiceBot                               |
| filter.autoCallIds                                | Array   | Danh sách ID phiên gọi tự động thường hoặc voiceBot |
| filter.isAnswer                                   | Boolean | Lọc cuộc gọi có trả lời                             |
| filter.queueDestinations                          | Array   | Danh sách nhóm nội bộ                               |
| filter.outerGroups                                | Array   | Danh sách nhóm ngoài                                |
| filter.keyInteractiveScripts                      | Array   | Danh sách số nội bộ của kịch bản tương tác phím     |
| sort.field                                        | String  | Field cần sort                                      |
| sort.isAsc                                        | Boolean | Thứ tự sort                                         |

#### Headers

| Name                                        | Type   | Description      |
| ------------------------------------------- | ------ | ---------------- |
| Content-type                                | String | application/json |
| x-api-key<mark style="color:red;">\*</mark> | String | API Key          |

{% tabs %}
{% tab title="200 OK" %}

```json
{
    "items": [
      {
        "transaction_id": "13a09408-db5d-49a0-b262-4100b2718836", // unique id của cuộc gọi
        "tenant_id": "6487dbe6572b7b17fcc8e511",
        "direction": "outbound", // hướng cuộc gọi
        "source_number": "84123456778",  // đầu số gọi đi
        "destination_number": "0234567891", // đầu số nhận cuộc gọi
        "disposition": "answered", // trạng thái trả lời
        "bill_sec": 90,
        "time_start_call": 1776849067, // Thời gian bắt đầu cuộc gọi
        "time_answer_start": 1776849073, // Thời gian bắt đầu trả lời
        "time_end_call": 1776849079, // Thời gian kết thúc cuộc gọi
        "time_ringing_start": 1776849073, // Thời gian bắt đầu đổ chuông cho nhân viên
        "record_seconds": 88,
        "recording_file": "https://4100b2718836.mp3",
        "recording_file_url": "https://4100b2718836",
        "recording_data": null,
        "sip_user": "100",
        "created_date": 1773139222456,
        "last_updated_date": 1773139405421,
        "is_auto_call": false,
        "ivr": "none",
        "provider": "mobifone", // nhà mạng
        "duration": 97, // thời lượng cuộc gọi (second)
        "user": [
          {
            "full_name"         : "nhanvien1",
            "full_name_unsigned": "nhanvien1",
            "note"              : null,
            "tag"               : null
          }
        ],
        "customer": {
          "_id"               : "66602774ec7f2b235cad1a3d",
          "full_name"         : "Vihat",
          "full_name_unsigned": "vihat"
        },
        "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": 900.000,
        "note": null,
        "tag": [],
        "invite_failure_status": null,
        "answer_sec": 88,
        "autocall_uuid": null,
        "autocall_id": null,
        "sip_number": "84123456778", // đầu số
        "phone_number": "0234567891", // số điện thoại khách hàng
        "create_by": { // thông tin nhân viên thực hiện hoặc nhận cuộc gọi
          "id"        : "6487dbe7572b7b17fcc8e514",
          "name"      : "nhanvien1",
          "contact_id": "6487dbeb1a309849f72056ad", // id nhân viên
          "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": "test",
        "send_num_retry": 0,
        "out_of_working_time": true,
        "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": "itel",
        "provider_of_number_forward_out": null,
        "callbot_script_id": null,
        "criteria": null,
        "users_status": null,
        "call_stacks": [
          {
            "from": "100",
            "to": "0234567891",
            "sip_number": "84123456778",
            "phone_number": "0234567891",
            "type": "external",
            "at": 1773139126018,
            "bye_at": 1773139222118,
            "index": 1,
            "is_answer": false
          }
        ],
        "call_script": null,
        "hold_call_sec": 0
      }
    ],
    "page_number": 1,
    "page_size": 50,
    "total_items": 201,
    "total_pages": 5,
    "has_next": true,
    "next_page": 2,
    "has_previous": false,
    "previous_page": 1,
    "extension": null,
    "max_size": null
}
```

{% endtab %}

{% tab title="400 Bad Request" %}

```json
{
    "message": "missing_time_query", // mã lỗi
    "status_code": 400,
    "timestamp": 1773334799999
}
```

{% endtab %}

{% tab title="Sampe request body" %}

```json
{
    "filter": {
        "fromDate": 1772557200000,
        "toDate": 1773334799999
    },
    "sort": {
        "field": "created_date",
        "isAsc": false
    }
}
```

{% endtab %}
{% endtabs %}

<table data-header-hidden><thead><tr><th width="229">Mã Lỗi</th><th>Mô tả</th></tr></thead><tbody><tr><td>Mã Lỗi</td><td>Mô tả</td></tr><tr><td><em>missing_time_query</em></td><td>Thiếu bộ lọc thời gian</td></tr><tr><td><em>date_is_too_long</em></td><td>Khoảng cách thời gian quá lớn, giới hạn trong 3 tháng gần nhất</td></tr><tr><td><em>email_agent_not_found</em></td><td>Bộ lọc email nhân viên không đúng hoặc không có giữ liệu nhân viên</td></tr><tr><td><em>uuid_agent_not_found</em></td><td>Bộ lọc agentUuids không đúng hoặc không có giữ liệu nhân viên </td></tr><tr><td><em>internal_server_error</em></td><td>Lỗi hệ thống</td></tr></tbody></table>

## Chi tiết cuộc gọi

<mark style="color:blue;">`POST`</mark>`[URL]`/api/v2/callTransaction/getByTransactionId

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

#### Request Body

| Name          | Type   | Description        |
| ------------- | ------ | ------------------ |
| transactionId | String | Call UUID cuộc gọi |

#### Headers

| Name          | Type   | Description                  |
| ------------- | ------ | ---------------------------- |
| Content-type  | string | application/json             |
| Authorization | string | Access token: Bearer 'token' |

{% tabs %}
{% tab title="200 Yêu cầu thành công" %}

```
{
    "instance_id": "stg",
    "payload": {
        "transaction_id": "", //Call UUID cuộc gọi
        "tenant_id": "", //ID của DN
        "direction": "outbound", //Hướng gọi
        "source_number": "xxx", //Số nguồn
        "destination_number": "xxx", //Số đích
        "bill_sec": 5, //Thời lượng cuộc gọi
        "time_start_call": 1776849067, // Thời gian bắt đầu cuộc gọi
        "time_answer_start": 1776849073, // Thời gian bắt đầu trả lời
        "time_end_call": 1776849079, // Thời gian kết thúc cuộc gọi
        "time_ringing_start": 1776849073, // Thời gian bắt đầu đổ chuông cho nhân viên
        "record_seconds": 3, //Thời lượng file ghi âm
        "recording_file": "",
        "recording_file_url": "", //Link file ghi âm
        "recording_data": null,
        "sip_user": "999", //Số nội bộ nhân viên thực hiện
        "created_date": 1729870397069, //Ngày tạo
        "last_updated_date": 1730788680689, //Ngày cập nhật
        "is_auto_call": false, //Cờ đánh dấu cuộc gọi tự động
        "ivr": "none",
        "provider": "viettel", //Nhà mạng số điện thoại KH
        "duration": 10, //Tổng thời gian
        "user": [ //Thông tin nhân viên liên quan đến cuộc gọi
            {
                "full_name": "DEV ZONE",
                "full_name_unsigned": "DEV ZONE",
                "note": null,
                "tag": null
            },
            {
                "full_name": "DEV ZONE",
                "full_name_unsigned": "dev zone",
                "note": "OMIDEV",
                "tag": [
                    {
                        "name": "ATC_01"
                    }
                ]
            }
        ],
        "customer": {//Thông tin khách hàng
            "full_name": "Trần Đình Tâm",
            "full_name_unsigned": "tran dinh tam"
        },
        "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": 66.000, //Cước gọi
        "note": null, //Thông tin ghi chú cuộc gọi
        "tag": [ //Danh sách ID tag cuộc gọi
            "63c0bb010748c865ba321c53"
        ],
        "invite_failure_status": null,
        "answer_sec": 3, //Thời gian trả lời
        "autocall_uuid": null, //Mã UUID mapping thông tin chi tiết cuộc gọi auto call
        "autocall_id": null, //ID phiên gọi auto call
        "sip_number": "842499950291", //Đầu số
        "phone_number": "0983223566", //Số điện thoại khách hàng
        "create_by": { //Nhân viên thực hiện cuộc gọi
            "id": "60e79bd864b64271a923affe",
            "name": "DEV ZONE",
            "contact_id": "60e79beb1b20043c4e7a68af",
            "avatar": null,
            "gender": null,
            "uuid": null,
            "type": "agent"
        },
        "transfer_histories": [], //Danh sách luồng cuộc gọi
        "user_data_str": null,
        "user_ref_code": null,
        "endby_name": "end_call_by_customer", //Nguyên nhân tắt máy
        "hangup_cause": "NORMAL_CLEARING",
        "sip_hangup_disposition": "send_bye",
        "hangup_cause_q850": 16,
        "is_voicemail": false, //Cờ đánh dấu cuộc gọi vào hộp thư thoại
        "recording_file_voicemail": null,
        "domain_fusion": "omicalltest1",
        "send_num_retry": 0,
        "out_of_working_time": true,
        "sip_number_tags": [],
        "evaluations": null,
        "total_evaluate": null,
        "internal_destination": null,
        "classifies": null,
        "collect_info_variables": null //Danh sách kết quả thu thập cuộc gọi voice bot
            },
        "call_stacks": [
             {
                "from": "0909689867", // Vị trí khởi tạo của leg call (stack)
                "to": "70759-118", //Nhân viên thuộc nhóm nội bộ
                "phone_number": "0909689867", //Số điện thoại khách hàng
                "type": "criteria-script", //Tiêu chí
                "at": 1757408394, //Thời điểm cuộc gọi đi vào nhánh
                "ringing_at": 1757408394, //Thời điểm cuộc gọi bắt đầu ring đến user
                "answer_at": 1757408400, //Thời điểm user bắt máy
                "bye_at": 1757408408, //Thời điểm kết thúc nhánh (stack)
                "index": 1,
                "is_answer": true, //Trạng thái trả lời
                "is_online": true, //Trạng thái trực tuyến
                "is_busy": false, //Trạng thái bận (user đang trong cuộc gọi khác)
                "is_dnd": false, //Trạng thái không làm phiền
                "timeout": 30
            },
    "instance_version": "1.2.164",
    "key_enabled": false,
    "status_code": 9999
}
```

{% endtab %}
{% endtabs %}

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

<mark style="color:green;">`POST`</mark> `[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

| Name            | Type   | Description |
| --------------- | ------ | ----------- |
| transaction\_id | string | Id cuộc gọi |

#### Headers

| Name          | Type   | Description                  |
| ------------- | ------ | ---------------------------- |
| Content-type  | string | application/json             |
| Authorization | string | Access token: Bearer 'token' |

#### Request Body

| Name | Type   | Description                                                                                                |
| ---- | ------ | ---------------------------------------------------------------------------------------------------------- |
| tag  | array  | <p>Danh sách Tag được gán với lịch sử cuộc gọi <br>Ví dụ : <code>tag : \["hailong","goilaisau"]</code></p> |
| note | string | Ghi chú cuộc gọi                                                                                           |

{% tabs %}
{% tab title="200 " %}

```
{
    "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"
        }
    }
}
```

{% endtab %}
{% endtabs %}

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

<mark style="color:blue;">`GET`</mark> `[URL]/api/evaluation_criteria/call/list`

<mark style="color:$primary;">\*</mark> <mark style="color:$primary;">Tạm dừng cập nhật từ ngày 01/04/2026, vui lòng sử dụng</mark> [<mark style="color:$primary;">API v3</mark>](https://api.omicall.com/omicall-api/call-transaction/v2#danh-sach-tieu-chi-danh-gia-cuoc-goi-v3)

#### Headers

<table><thead><tr><th>Name</th><th>Type</th><th width="250">Description</th></tr></thead><tbody><tr><td>Authorization<mark style="color:red;">*</mark></td><td>String</td><td>Access token: Bearer 'token'</td></tr></tbody></table>

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

<mark style="color:blue;">`GET`</mark> `[URL]/api/v3/call-transaction/evaluation-criteria/list`

Lấy danh sách tiêu chí đánh giá cuộc gọi

#### Headers

<table><thead><tr><th>Name</th><th>Type</th><th width="250">Description</th></tr></thead><tbody><tr><td>x-api-key<mark style="color:red;">*</mark></td><td>String</td><td>API Key</td></tr></tbody></table>

{% tabs %}
{% tab title="200 OK" %}

```json
[
        {
            "_id": "69b0f739ff79726b819d7915", // id tiêu chí
            "name": "Chất lượng cuộc gọi" // tên tiêu chí
        }
]
```

{% endtab %}
{% endtabs %}

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

<mark style="color:green;">`POST`</mark> `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

<mark style="color:$primary;">\*</mark> <mark style="color:$primary;">Tạm dừng cập nhật từ ngày 01/04/2026, vui lòng sử dụng</mark> [<mark style="color:$primary;">API v3</mark>](https://api.omicall.com/omicall-api/call-transaction/v2#danh-sach-v3)

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

{

&#x20; "from\_date" : 1693846799000,

&#x20; "to\_date" : 1696438799000,

&#x20; "user\_uuids" : \["0123456789"]

}

#### Path Parameters

| Name | Type | Description                          |
| ---- | ---- | ------------------------------------ |
| page | int  | Page cần get (= 1)                   |
| size | int  | Số phần tử trong trang (max 50 item) |

#### Headers

| Name                                           | Type   | Description      |
| ---------------------------------------------- | ------ | ---------------- |
| x-api-key<mark style="color:red;">\*</mark>    | String | API key          |
| Content-Type<mark style="color:red;">\*</mark> | String | application/json |

#### Request Body

| Name                                          | Type          | Description                                                |
| --------------------------------------------- | ------------- | ---------------------------------------------------------- |
| from\_date<mark style="color:red;">\*</mark>  | String        | Thời gian bắt đầu lấy log (milisecond)                     |
| to\_date<mark style="color:red;">\*</mark>    | String        | Thời gian kết thúc lấy log (milisecond)                    |
| user\_uuids<mark style="color:red;">\*</mark> | 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ố                                           |

{% tabs %}
{% tab title="200: OK Dữ liệu trả về thành công (JSON format)" %}

```json
// 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": 1776849067, // Thời gian bắt đầu cuộc gọi
        "time_answer_start": 1776849073, // Thời gian bắt đầu trả lời
        "time_end_call": 1776849079, // Thời gian kết thúc cuộc gọi
        "time_ringing_start": 1776849073, // Thời gian bắt đầu đổ chuông cho nhân viên
        "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
}
```

{% endtab %}
{% endtabs %}

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

<mark style="color:green;">`POST`</mark> `[URL]/api/call_transaction/add_evaluation/:transaction_id`

<mark style="color:$primary;">\*</mark> <mark style="color:$primary;">Tạm dừng cập nhật từ ngày 01/04/2026, vui lòng sử dụng</mark> [<mark style="color:$primary;">API v3</mark>](https://api.omicall.com/omicall-api/call-transaction/v2#danh-gia-cuoc-goi-theo-tieu-chi-v3)

#### Path Parameters

| Name                                              | Type   | Description             |
| ------------------------------------------------- | ------ | ----------------------- |
| transaction\_id<mark style="color:red;">\*</mark> | String | Transaction Id cuộc gọi |

#### Request Body

| Name                                         | Type   | Description                                                                                                              |
| -------------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------ |
| user\_uuid<mark style="color:red;">\*</mark> | String | Id của User bên thứ 3 hoặc Số máy lẻ trong hệ thống                                                                      |
| evaluation<mark style="color:red;">\*</mark> | Object | <p>Đối tượng chưa thông tin đánh giá, json format như sau</p><p><em><strong>(Format như ảnh bên dưới )</strong></em></p> |

{% tabs %}
{% tab title="200: OK Thông tin cuộc gọi + đánh giá" %}

{% endtab %}

{% tab title="201 " %}

{% endtab %}
{% endtabs %}

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FzMPJzoVKEuIPfudbXHDX%2FScreen%20Shot%202023-04-27%20at%208.30.23%20AM.png?alt=media&amp;token=f283f0b8-473c-45bd-8e82-3f682cacd8ed" alt=""><figcaption></figcaption></figure>

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

<mark style="color:green;">`POST`</mark> `[URL]/api/v3/call-transaction/add-evaluation`

Tạo đánh giá cuộc gọi theo tiêu chí

#### Request Body

<table><thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>transactionId<mark style="color:red;">*</mark></td><td>String</td><td>Transaction Id cuộc gọi</td></tr><tr><td>agentId<mark style="color:red;">*</mark></td><td>String</td><td>Id nhân viên trong hệ thống, có được thông qua API danh sách nhân viên hoặc danh sách lịch sử cuộc gọi</td></tr><tr><td>evaluation<mark style="color:red;">*</mark></td><td>Object</td><td><p>Đối tượng chưa thông tin đánh giá, json format như sau</p><pre class="language-json"><code class="lang-json">{
    "comment": "test",
    "values": [
        {
            "criteriaId": "648bcc156372f32909540b58", // id tiêu chí
            "name": "Đánh giá chất lượng", // tên tiêu chí
            "point": 3
        }
    ]
}
</code></pre></td></tr></tbody></table>

{% tabs %}
{% tab title="200: OK" %}

```json
{
        "transaction_id": "13a09408-db5d-49a0-b262-4100b2718836", // unique id của cuộc gọi
        "tenant_id": "6487dbe6572b7b17fcc8e511",
        "direction": "outbound", // hướng cuộc gọi
        "source_number": "84123456778",  // đầu số gọi đi
        "destination_number": "0234567891", // đầu số nhận cuộc gọi
        "disposition": "answered", // trạng thái trả lời
        "bill_sec": 90,
        "record_seconds": 88,
        "time_start_to_answer": 1773139125,
        "recording_file": "https://4100b2718836.mp3",
        "recording_file_url": "https://4100b2718836",
        "recording_data": null,
        "sip_user": "100",
        "created_date": 1773139222456,
        "last_updated_date": 1773139405421,
        "is_auto_call": false,
        "ivr": "none",
        "provider": "mobifone", // nhà mạng
        "duration": 97, // thời lượng cuộc gọi (second)
        "user": [
          {
            "full_name"         : "nhanvien1",
            "full_name_unsigned": "nhanvien1",
            "note"              : null,
            "tag"               : null
          }
        ],
        "customer": {
          "_id"               : "66602774ec7f2b235cad1a3d",
          "full_name"         : "Vihat",
          "full_name_unsigned": "vihat"
        },
        "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": 900.000,
        "note": null,
        "tag": [],
        "invite_failure_status": null,
        "answer_sec": 88,
        "autocall_uuid": null,
        "autocall_id": null,
        "sip_number": "84123456778", // đầu số
        "phone_number": "0234567891", // số điện thoại khách hàng
        "create_by": { // thông tin nhân viên thực hiện hoặc nhận cuộc gọi
          "id"        : "6487dbe7572b7b17fcc8e514",
          "name"      : "nhanvien1",
          "contact_id": "6487dbeb1a309849f72056ad", // id nhân viên
          "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": "test",
        "send_num_retry": 0,
        "time_start_call": 1773139125,
        "time_end_call": 1773139222,
        "out_of_working_time": true,
        "sip_number_tags": [],
        "evaluations": [
            {
                "leg": null,
                "point": 3.0, // điểm số đánh giá
                "comment": "test", // bình luận
                "created_date": 1773205305532,
                "create_by": {
                    "id": "6487dbe7572b7b17fcc8e514",
                    "name": "nhanvien1",
                    "contact_id": "6487dbeb1a309849f72056ad", // id nhân viên
                    "avatar": null,
                    "gender": null,
                    "uuid": null,
                    "type": null,
                    "extension": null
                },
                "attribute_id": "ZMXQPJrQ2",
                "values": [
                    {
                        "criteria_id": "648bcc156372f32909540b58", // id tiêu chí
                        "name": "Đánh giá chất lượng", // tên tiêu chí
                        "point": 3.0 // điểm đánh giá
                    }
                ]
            }
        ],
        "total_evaluate": {
            "point": 3.0, // tổng điểm đánh giá trung bình
            "total": 1 // tổng số lượt đánh giá
        },
        "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": "itel",
        "provider_of_number_forward_out": null,
        "callbot_script_id": null,
        "criteria": null,
        "users_status": null,
        "call_stacks": [
          {
            "from": "100",
            "to": "0234567891",
            "sip_number": "84123456778",
            "phone_number": "0234567891",
            "type": "external",
            "at": 1773139126018,
            "bye_at": 1773139222118,
            "index": 1,
            "is_answer": false
          }
        ],
        "call_script": null,
        "hold_call_sec": 0
}
```

{% endtab %}

{% tab title="400 Bad Request" %}

```json
{
    "message": "invalid_param", // mã lỗi
    "status_code": 400,
    "timestamp": 1773334799999
}
```

{% endtab %}

{% tab title="204 No Content" %}
Không tìm thấy lịch sử cuộc gọi với transactionId
{% endtab %}
{% endtabs %}

<table><thead><tr><th>Mã Lỗi</th><th>Mô tả</th><th data-hidden></th></tr></thead><tbody><tr><td><em>invalid_param</em></td><td>Request Body thiếu hoặc sai format</td><td></td></tr><tr><td><em>agent_not_found</em></td><td>Không tìm thấy nhân viên với agentId trong hệ thống</td><td></td></tr><tr><td><em>internal_server_error</em></td><td>Lỗi hệ thống</td><td></td></tr></tbody></table>

## Báo cáo tổng quan cuộc gọi

<mark style="color:green;">`GET`</mark> `[URL]/api/v3/call-transaction/report`

Thống kê các thông số liên quan đến lịch sử cuộc gọi

#### Request param

| Name     | Type   | Description                                                          |
| -------- | ------ | -------------------------------------------------------------------- |
| fromDate | Number | Từ ngày (Epoch Time Milliseconds). VD: 1780246800000                 |
| toDate   | Number | Đến ngày (Epoch Time Milliseconds). Giới hạn 12 tháng kể từ fromDate |

#### Headers

| Name          | Type   | Description                  |
| ------------- | ------ | ---------------------------- |
| Content-type  | String | application/json             |
| Authorization | String | Access token: Bearer 'token' |

#### Request Body

{% tabs %}
{% tab title="200: OK" %}

```json
{
    "byDirections": { // Thông số cuộc gọi theo hướng gọi
        "outbound": { // Gọi ra
            "docCount": 69, // Tổng cuộc gọi
            "totalBillSec": 4808.0, // Tổng số giây tích cước
            "byDates": { // Thông số theo ngày
                "01-06-2026": {
                    "docCount": 46, // Tổng cuộc gọi
                    "totalAnswered": 39, // Tổng cuộc gọi có trả lời
                    "totalCancelled": 7, // Tổng cuộc gọi không trả lời
                    "totalBillSec": 2591.0, // Tổng số giây tính cước
                    "totalAnswerSec": 1507.0 // Tổng số giây trả lời
                },
                "02-06-2026": {
                    "docCount": 23,
                    "totalAnswered": 19,
                    "totalCancelled": 4,
                    "totalBillSec": 2217.0,
                    "totalAnswerSec": 2143.0
                }
            },
            "workingTimeResult": { // Thống kê theo khung giờ
                "totalInWorkingTime": 69, // Tổng cuộc gọi trong khung giờ
                "totalBillSecInWorkingTime": 4808.0, // Tổng số giây tính cước trong khung giờ
                "totalAnswerSecInWorkingTime": 3650.0, // Tổng số giây trả lời trong khung giờ
                "totalOutWorkingTime": 0, // Tổng cuộc gọi ngoài khung giờ
                "totalBillSecOutWorkingTime": 0.0, // Tổng số giây tính cước ngoài khung giờ
                "totalAnswerSecOutWorkingTime": 0.0 // Tổng số giây trả lời ngoài khung giờ
            }
        },
        "inbound": { // Gọi vào
            "docCount": 26,
            "totalBillSec": 803.0,
            "byDates": {
                "01-06-2026": {
                    "docCount": 11,
                    "totalAnswered": 8,
                    "totalCancelled": 3,
                    "totalBillSec": 614.0,
                    "totalAnswerSec": 597.0
                },
                "02-06-2026": {
                    "docCount": 1,
                    "totalAnswered": 0,
                    "totalCancelled": 1,
                    "totalBillSec": 60.0,
                    "totalAnswerSec": 0.0
                },
                "03-06-2026": {
                    "docCount": 10,
                    "totalAnswered": 1,
                    "totalCancelled": 9,
                    "totalBillSec": 65.0,
                    "totalAnswerSec": 1.0
                },
                "04-06-2026": {
                    "docCount": 4,
                    "totalAnswered": 0,
                    "totalCancelled": 4,
                    "totalBillSec": 64.0,
                    "totalAnswerSec": 0.0
                }
            },
            "workingTimeResult": {
                "totalInWorkingTime": 26,
                "totalBillSecInWorkingTime": 803.0,
                "totalAnswerSecInWorkingTime": 598.0,
                "totalOutWorkingTime": 0,
                "totalBillSecOutWorkingTime": 0.0,
                "totalAnswerSecOutWorkingTime": 0.0
            }
        }
    },
    "byDispositions": { // Thông số cuộc gọi theo trạng thái
        "true": { // Có trả lời
            "docCount": 67,
            "totalBillSec": 5424.0,
            "directionCount": {
                "outbound": 58,
                "inbound": 9
            },
            "byDates": {
                "01-06-2026": {
                    "docCount": 47,
                    "totalAnswered": 47,
                    "totalCancelled": 0,
                    "totalBillSec": 3205.0,
                    "totalAnswerSec": 2104.0
                },
                "02-06-2026": {
                    "docCount": 19,
                    "totalAnswered": 19,
                    "totalCancelled": 0,
                    "totalBillSec": 2217.0,
                    "totalAnswerSec": 2143.0
                },
                "03-06-2026": {
                    "docCount": 1,
                    "totalAnswered": 1,
                    "totalCancelled": 0,
                    "totalBillSec": 2.0,
                    "totalAnswerSec": 1.0
                }
            },
            "workingTimeResult": {
                "totalInWorkingTime": 67,
                "totalBillSecInWorkingTime": 5424.0,
                "totalAnswerSecInWorkingTime": 4248.0,
                "totalOutWorkingTime": 0,
                "totalBillSecOutWorkingTime": 0.0,
                "totalAnswerSecOutWorkingTime": 0.0
            }
        },
        "false": { // Không trả lời
            "docCount": 28,
            "totalBillSec": 187.0,
            "directionCount": {
                "inbound": 17,
                "outbound": 11
            },
            "byDates": {
                "01-06-2026": {
                    "docCount": 10,
                    "totalAnswered": 0,
                    "totalCancelled": 10,
                    "totalBillSec": 0.0,
                    "totalAnswerSec": 0.0
                },
                "02-06-2026": {
                    "docCount": 5,
                    "totalAnswered": 0,
                    "totalCancelled": 5,
                    "totalBillSec": 60.0,
                    "totalAnswerSec": 0.0
                },
                "03-06-2026": {
                    "docCount": 9,
                    "totalAnswered": 0,
                    "totalCancelled": 9,
                    "totalBillSec": 63.0,
                    "totalAnswerSec": 0.0
                },
                "04-06-2026": {
                    "docCount": 4,
                    "totalAnswered": 0,
                    "totalCancelled": 4,
                    "totalBillSec": 64.0,
                    "totalAnswerSec": 0.0
                }
            },
            "workingTimeResult": {
                "totalInWorkingTime": 28,
                "totalBillSecInWorkingTime": 187.0,
                "totalAnswerSecInWorkingTime": 0.0,
                "totalOutWorkingTime": 0,
                "totalBillSecOutWorkingTime": 0.0,
                "totalAnswerSecOutWorkingTime": 0.0
            }
        }
    },
    "totalAnswerCall": 67, // Tổng cuộc gọi trả lời
    "totalAnswerSec": 4248.0, // Tổng số giây trả lời
    "totalCallToQueue": 4, // Tổng cuộc gọi vào hàng đợi
    "totalHoldCall": 0, 
    "totalHoldSec": 0.0,
    "totalIvrTime": 6.0, // Tổng thời gian IVR
    "totalWaitCall": 9, // Tổng cuộc gọi chờ
    "totalWaitSec": 69.0 // Tổng số giây chờ
}
```

{% endtab %}

{% tab title="400 Bad Request" %}

```json
{
    "message": "invalid_param", // mã lỗi
    "status_code": 400,
    "timestamp": 1773334799999
}
```

{% endtab %}
{% endtabs %}

<table><thead><tr><th>Mã Lỗi</th><th>Mô tả</th><th data-hidden></th></tr></thead><tbody><tr><td><em>missing_time_query</em></td><td>Thiếu thời gian fromDate hoặc toDate</td><td></td></tr><tr><td>invalid_date_range</td><td>Khoảng thời gian không hợp lệ</td><td></td></tr><tr><td><em>date_range_exceed_12_months</em></td><td>Khoảng thời gian vượt quá giới hạn cho phép</td><td></td></tr></tbody></table>


# Gọi tự động

API gọi tự động

## Gọi tự động tới một số điện thoại khách hàng

<mark style="color:green;">`POST`</mark> `[URL]/api/auto_call/execute_by_phone`

Tạo phiên gọi tự động dựa trên cấu hình & thực thi

#### Headers

| Name          | Type   | Description               |
| ------------- | ------ | ------------------------- |
| Content-type  | string | application/json          |
| Authorization | string | Access Token Bearer token |

#### Request Body

| Name                                                  | Type    | Description                                                                                                                                                                                                                                                                                                         |
| ----------------------------------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| speed                                                 | number  | <p>Tốc độ đọc.Từ chậm : -3. Đến nhanh : 3. </p><p>Mặc định là 0</p>                                                                                                                                                                                                                                                 |
| voice                                                 | string  | <p>Giọng đọc, có thể một trong các giá trị sau<br><strong>banmai</strong> : Giọng nữ miền Bắc<br><strong>leminh</strong> : Giọng nam miền Bắc<br><strong>lannhi</strong> : Giọng nữ miền Nam</p>                                                                                                                    |
| cid                                                   | string  | <p>Đầu số dùng để gọi tự động. <br><em>Nếu không truyền, mặc định ưu tiên gọi nội mạng</em></p>                                                                                                                                                                                                                     |
| name                                                  | string  | Tên của phiên gọi tự động                                                                                                                                                                                                                                                                                           |
| template\_dialplans                                   | array   | <p>Cấu trúc phiên gọi tự động theo loại. (tham khảo ví dụ)<br><em>1. Phiên gọi tự động với file ghi âm</em><br><br><em>2. Phiên gọi tự động  với Text To Speech</em><br><br><em>3. Phiên gọi tự động với file ghi âm và Text To Speech.</em> </p><p></p><p><em>4. Phiên gọi tự động với kịch bản bấm phím</em> </p> |
| variables                                             | string  | <p>Mảng giá trị cho Text To Speech<br><em>Ví dụ</em> <br><code>\[</code> <br> <code>"Đơn hàng của bạn là ",</code><br> <code>"CKHDKD00203",</code><br> <code>"Số tiền",</code><br> <code>"900000",</code><br> <code>"Đã được bàn giao cho đối tác vận chuyển"</code><br><code>]</code></p>                          |
| phone\_number\_list<mark style="color:red;">\*</mark> | Array   | Danh sách số điện thoại cần gọi                                                                                                                                                                                                                                                                                     |
| num\_retry                                            | Integer | Số lần gọi lại khi không nghe máy. Mặc định là 0                                                                                                                                                                                                                                                                    |
| num\_per\_call                                        | Integer | Số cuộc gọi mỗi lần. Mặc định là 15                                                                                                                                                                                                                                                                                 |
| distance\_per\_call                                   | Integer | Khoảng cách thời gian , giữa các lần gọi. Mặc định là 30s                                                                                                                                                                                                                                                           |
| distance\_retry                                       | Integer | Khoảng cách giữa các lần gọi lại . Mặc định là 0                                                                                                                                                                                                                                                                    |

{% tabs %}
{% tab title="200 Thông tin phiên gọi tự động" %}

```
{
    "status_code": 9999,
    "payload": {
        "autocall_id": "91d3e842-9da2-43ec-8bb1-979c17e817ad",
        "name": "Chiến dịch giới thiệu sản phẩm mới"
    }
}
```

{% endtab %}
{% endtabs %}

## Gọi tự động tới 1 máy nhánh (extension) của tổng đài

<mark style="color:green;">`POST`</mark> `[URL]/api/auto_call/execute_by_extension`

#### Request Body

| Name                                                  | Type   | Description                                                                                                                                                                                                                                                                                                                                   |
| ----------------------------------------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| template\_dialplans<mark style="color:red;">\*</mark> | Array  | <p>Cấu trúc của cuộc gọi , tham khảo ví dụ bên dưới<br><em>1. Phiên gọi tự động với file ghi âm</em></p><p></p><p><em>2. Phiên gọi tự động  với Text To Speech</em></p><p></p><p><em>3. Phiên gọi tự động với file ghi âm và Text To Speech. Thực thi theo thứ tự</em> </p><p></p><p><em>4. Phiên gọi tự động với kịch bản bấm phím</em> </p> |
| variables<mark style="color:red;">\*</mark>           | Array  | Mãng giá trị chuỗi, chứa nội dung văn bản cần đọc , nếu kịch bản có chứa Text To Speech                                                                                                                                                                                                                                                       |
| extensions<mark style="color:red;">\*</mark>          | Array  | Danh sách các số máy lẻ nhận cuộc gọi                                                                                                                                                                                                                                                                                                         |
| cid<mark style="color:red;">\*</mark>                 | String | Số hotline gọi ra định danh cho cuộc gọi                                                                                                                                                                                                                                                                                                      |
| brand\_name                                           | String | Tên thương hiệu cần hiển thị, thay vì đầu số hotline                                                                                                                                                                                                                                                                                          |

{% tabs %}
{% tab title="200: OK " %}

```json
{
    "instance_id": "stg",
    "payload": {
        "autocall_uuids": [
            "f5d39f30-fef7-49df-9ef6-697bf5353983"
        ],
        "autocall_id": "64b8117691447377aecac985"
    },
    "instance_version": "1.2.164",
    "key_enabled": false,
    "status_code": 9999
}
```

{% endtab %}
{% endtabs %}

**Ví dụ** :Tham số một phiên gọi tự động với **File ghi âm**

```
{
   "name":"Chiến dịch giới thiệu sản phẩm mới",
   "speed" : 0
   "template_dialplans":[
      {
         "target_type":"Recording",
         "target":"5ed0c6dffb7b390007e5211"
      }
   ],
   "variables":[]
}
```

**Ví dụ** : Tham số một phiên gọi tự động với **Text To Speech**

```
{
   "name":"Thông báo đơn hàng",
   "template_dialplans":[
      {"target_type":"Text_variable"},
      {"target_type":"Text_variable"},
      {"target_type":"Text_variable"},
      {"target_type":"Text_variable"}
   ],
   "variables":[
      "Đơn hàng của bạn là",
      "HHKKK",
      "Tổng giá trị",
      "90000"
   ]
}
```

**Ví dụ** :Tham số một phiên gọi tự động **File ghi âm và Text To Speech**&#x20;

```
{
   "name":"Tên phiên gọi tự động",
   "template_dialplans":[
     {"target_type":"Text_variable"},
     {"target_type":"Text_variable"},
     {"target_type":"Text_variable"},
     {"target_type":"Text_variable"},
     { 
       "target_type":"Recording",   
       "target":"5e9eac95e44159000710f0xxx" 
    }],
   "variables" : [
      "Đơn hàng của bạn là",
      "HHKKK",
      "Tổng giá trị",
      "90000"
   ]
}
```

Ví dụ về phiên gọi tự động : **Kịch bản bấm phím**

```
{
   "name":"Tên phiên gọi tự động",
   "template_dialplans":[
     { 
       "target_type":"Ivr_menu",   
       // Id phiên bấm phím,
       // API : Tổng đài >> Danh sách kịch bản bấm phím
       "target":"5e9eac95e44159000710f0xxx"  
    }],
   "variables" : [
   ]
}
```

| Mã lỗi                   | Mô tả                                                                                                                                                    |
| ------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| limit\_service           | Giới hạn gói dịch vụ. Gói trải nghiệm không cho phép thực thi Auto Call                                                                                  |
| limit\_word              | <p>Vượt quá giới hạn từ trong 1 phiên hoặc tổng số từ trong ngày </p><p>(<strong>300 ký tự / phiên</strong> và <strong>3.000 ký tự / ngày</strong> )</p> |
| limit\_word\_session     | Vượt quá số lượng ký tự text to speech. Chỉ hỗ trợ 300 ký tự / 1 phiên                                                                                   |
| balance\_is\_not\_enough | Số dư không đủ để thực hiện                                                                                                                              |


# Gọi tự động sử dụng callBot

API gọi tự động

## Gọi tự động tới một số điện thoại khách hàng

<mark style="color:green;">`POST`</mark> `[URL]/api/call_bot/execute_by_phone`

Tạo một phiên callBot với tham số đầu vào là một kịch bản callbot và 1 danh sách các thông tin liên hệ

#### Query Parameters

| Name                                  | Type   | Description                                                                                               |
| ------------------------------------- | ------ | --------------------------------------------------------------------------------------------------------- |
| cid<mark style="color:red;">\*</mark> | String | <p>Số hotline hay số SIP sẽ thực hiện chạy phiên.</p><p></p><p>Nếu gọi nội mạng, truyền giá trị rỗng.</p> |

#### Headers

| Name                                        | Type   | Description               |
| ------------------------------------------- | ------ | ------------------------- |
| Content-type                                | string | application/json          |
| Authorization                               | string | Access Token Bearer token |
| x-api-key<mark style="color:red;">\*</mark> | String | API key được cung cấp     |

#### Request Body

<table><thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>speed</td><td>number</td><td><p>Tốc độ đọc.Từ chậm : -3. Đến nhanh : 3. </p><p>Mặc định là 0</p></td></tr><tr><td>voice</td><td>string</td><td><p>Giọng đọc, có thể một trong các giá trị sau<br>+ "northern_female_ngocanh" : Ngọc Anh</p><p>+ "southern_female_honganh" : Hồng Anh</p><p>+ "southern_male_tienhuy" : Tiến HuyQ</p></td></tr><tr><td>cid</td><td>string</td><td>Đầu số dùng để gọi tự động. <br><em>Nếu không truyền, mặc định ưu tiên gọi nội mạng</em></td></tr><tr><td>name</td><td>string</td><td>Tên của phiên gọi tự động</td></tr><tr><td>num_retry</td><td>Integer</td><td>Số lần gọi lại khi không nghe máy. Mặc định là 0</td></tr><tr><td>num_per_call</td><td>Integer</td><td>Số cuộc gọi mỗi lần. Mặc định là 15 </td></tr><tr><td>distance_per_call</td><td>Integer</td><td>Khoảng cách thời gian , giữa các lần gọi. Mặc định là 30s</td></tr><tr><td>distance_retry</td><td>Integer</td><td>Khoảng cách giữa các lần gọi lại . Mặc định là 0</td></tr><tr><td>bot_script_id</td><td>String</td><td>Id kịch bản, được lấy ở danh sách trong hệ thống</td></tr><tr><td>send_time</td><td>Number</td><td><p>Thời gian thực hiện phiên (milisecond)</p><p></p><p>Nếu không truyền giá trị, sẽ thực hiện gọi ngay</p></td></tr><tr><td>contact_info<mark style="color:red;">*</mark></td><td>Array</td><td><p>Danh sách contact cần gọi</p><p>Giá trị:</p><pre><code>{
            "phone":"0395187***",
            "email":"",
            "ext_contact_code":"",
            "mapping_variables":{
                "gender1":"Anh",
                "full_name":"Trần Văn Tiến",
                "address":"Phan Huy Ích",
                "mail":"tientv@***.com",
                "birthday":"11/10/19***"
            }
        }
</code></pre><ul><li>phone : Số điện thoại KH</li><li>email: Email khách hàng nếu có</li><li>ext_contact_code : Mã KH bên thứ 03</li><li>mapping_variables : Hỗ trợ cho phép truyền biến động từ đối tác. Danh sách và chi tiết biến động cần truyền trong (API lấy danh sách KB Callbot)</li></ul></td></tr><tr><td>ext_session_id</td><td>String</td><td><p>Mã định danh phiên bên ngoài CRM (tránh trường hợp lên trùng phiên do double summit)</p><p>Nếu có giá trị field này, mới kiểm tra trùng</p></td></tr><tr><td>auto_pause</td><td>Boolean (true, false)</td><td>Cho phép phiên tự động dừng khi không có nhân viên hiệu lực không. Cấu hình này chỉ áp dụng cho kịch bản gọi vào nhóm nội bộ</td></tr></tbody></table>

{% tabs %}
{% tab title="200 Thông tin phiên gọi tự động" %}

```
{
    "instance_id": "stg",
    "payload": {
        "bot_script_id": "653b155db0f794**********",
        "autocall_id": "6552de1891be25**********",
        "errors" : [
		    	{
		  	  	"phone" : "09xxxxxxxx",
		  	  	"error_code" : "number_dnc",
		    		"message" : "Number DNC"
		    	}
	    	]
    },
    "instance_version": "1.2.164",
    "key_enabled": false,
    "status_code": 9999
}
```

{% endtab %}
{% endtabs %}

Hướng dẫn liên kết biến động trong CallBot AI

## Tạo phiên gọi tự động v2

<mark style="color:green;">`POST`</mark> `[URL]/api/v2/call-bot/request`

Tạo một phiên gọi tự động bằng callBot với danh sách khách hàng, kịch bản gọi và cấu hình callback kết quả (không bắt buộc).

#### Headers

| Name          | Type   | Required | Description                  |
| ------------- | ------ | -------- | ---------------------------- |
| Authorization | String | Yes      | Access token: Bearer 'token' |
| Content-Type  | String | Yes      | `application/json`           |

#### Request Body

| Field                         | Type   | Required | Description                                                                          |
| ----------------------------- | ------ | -------- | ------------------------------------------------------------------------------------ |
| contacts                      | Array  | Yes      | Danh sách khách hàng cần gọi                                                         |
| contacts\[].phoneNumber       | String | Yes      | Số điện thoại khách hàng                                                             |
| contacts\[].extendVariableMap | Object | No       | Biến động để map vào kịch bản callBot                                                |
| contacts\[].refId             | String | No       | Reference Id trả về trong callback (nếu có cấu hình callback)                        |
| sipNumbers                    | Array  | Yes      | Danh sách số SIP/đầu số thực hiện gọi                                                |
| scriptId                      | String | Yes      | ID kịch bản callBot                                                                  |
| sessionName                   | String | No       | Tên phiên gọi                                                                        |
| voice                         | String | No       | Giọng đọc, ví dụ: `northern_female_ngocanh`                                          |
| timeSlots                     | Array  | No       | Danh sách khung giờ gọi. Mỗi phần tử có dạng `{\"from\":\"HH:mm\",\"to\":\"HH:mm\"}` |
| numberRetryCall               | Number | No       | Số lần gọi lại khi chưa kết nối thành công                                           |
| retryCallAfterSeconds         | Number | No       | Số giây chờ trước khi gọi lại                                                        |
| callbackResultConfig          | Object | No       | Cấu hình callback nhận kết quả                                                       |
| callbackResultConfig.url      | String | No       | URL webhook nhận callback kết quả gọi                                                |

#### Example cURL

```bash
curl --location '[URL]/api/v2/call-bot/request' \
--header 'x-api-key: <your_api_key>' \
--header 'Content-Type: application/json' \
--data '{
    "contacts" : [
        {
            "phoneNumber" : "0123456789",
            "extendVariableMap" : {
                "var1" : "test"
            }
        }
    ],
    "sipNumbers" : ["0238923xxx"],
    "scriptId" : "6915460746197d6920ca1xxx",
    "sessionName" : "Test session",
    "voice" : "northern_female_ngocanh",
    "timeSlots" : [],
    "numberRetryCall" : 1,
    "retryCallAfterSeconds" : 120,
    "callbackResultConfig" : {
        "url" : "hook_url"
    }
}'
```

#### Response

{% tabs %}
{% tab title="200: OK" %}

```json
{
    "instance_id": "stg",
    "payload": true,
    "instance_version": "1.2.164",
    "key_enabled": false,
    "status_code": 9999
}
```

{% endtab %}
{% endtabs %}

#### Webhook response (nếu có config webhook)

{% tabs %}
{% tab title="Init session" %}

```json
 {
    "type": "INIT_SESSION",
    "data": {
      "tenantId"     : "",
      "sessionId"    : "",
      "sessionName"  : "",
      "sessionTimeMs": 1776798232000,
      "details"      : [
        {
          "phoneNumber": "",
          "recordId"   : "",
          "refId"      : "",
          "status"     : "",
          "errorCode"  : ""
        }
      ]
    }
  }
```

{% endtab %}

{% tab title="Init call" %}

```json
{
    "type": "INIT_CALL",
    "data": {
      "tenantId"     : "",
      "sessionId"    : "",
      "sessionName"  : "",
      "sessionTimeMs": 1776798232000,
      "details"      : [
        {
          "isSuccess"   : true,
          "errorCode"   : "",
          "errorMessage": "",
          "recordId"    : "",
          "refId"       : "",
          "sipNumber"   : "",
          "phoneNumber" : ""
        }
      ]
    }
  }
```

{% endtab %}

{% tab title="Complete call" %}

```json
{
    "type": "COMPLETE_CALL",
    "data": {
      "tenantId"     : "",
      "sessionId"    : "",
      "sessionName"  : "",
      "sessionTimeMs": 1776798232000,
      "details"      : [
        {
          "recordId"   : "",
          "refId"      : "",
          "sipNumber"  : "",
          "phoneNumber": "",
          "status"     : ""
        }
      ]
    }
  }
```

{% endtab %}
{% endtabs %}

## Lấy danh sách kịch bản bot

<mark style="color:blue;">`GET`</mark> `[URL]/api/call_bot/script/list`

Lấy danh sách kịch bản callBot do khách hàng thiết lập

{% tabs %}
{% tab title="200: OK " %}

```json
{
	"instance_id": "stg",
	"payload": [
		{
			"id": "64915bc76a690c0edad14723",
			"name": "Thông báo điểm thi",
			"variables": [
				{
					"field_name": "tên thí sinh",
					"field_code": "tên thí sinh",
					"field_value": "",
					"field_type": "",
					"type": "",
					"is_dynamic_attribute": true
				},
				{
					"field_name": "Toán",
					"field_code": "uB131frQEU",
					"field_value": "",
					"field_type": "single_text",
					"type": "CONTACT",
					"is_dynamic_attribute": true
				}
			]
		},
		{
			"id": "64a922f61900954f5419d503",
			"name": "Cảnh báo từ khóa tiêu cực",
			"variables": [
				{
					"field_name": "",
					"field_code": "nhanvien",
					"field_value": "",
					"field_type": "",
					"type": "",
					"is_dynamic_attribute": true
				},
				{
					"field_name": "",
					"field_code": "tenkhachhang",
					"field_value": "",
					"field_type": "",
					"type": "",
					"is_dynamic_attribute": true
				},
				{
					"field_name": "",
					"field_code": "sodienthoai",
					"field_value": "",
					"field_type": "",
					"type": "",
					"is_dynamic_attribute": true
				},
				{
					"field_name": "",
					"field_code": "thoigiangoi",
					"field_value": "",
					"field_type": "",
					"type": "",
					"is_dynamic_attribute": true
				},
				{
					"field_name": "",
					"field_code": "diem",
					"field_value": "",
					"field_type": "",
					"type": "",
					"is_dynamic_attribute": true
				}
			]
		}
	],
	"instance_version": "1.2.164",
	"key_enabled": false,
	"status_code": 9999
}
```

{% endtab %}
{% endtabs %}

## Đếm số lượng cuộc gọi của phiên

<mark style="color:blue;">`POST`</mark> `[URL]/api/call_bot/call/count`

Header

| Name          | Type   | Required | Description                  |
| ------------- | ------ | -------- | ---------------------------- |
| Authorization | String | Yes      | Access token: Bearer 'token' |
| Content-Type  | String | Yes      | `application/json`           |

Request Body

| Field        | Type   | Required | Description                                                        |
| ------------ | ------ | -------- | ------------------------------------------------------------------ |
| autocall\_id | String | Yes      | Id của phiên autocall                                              |
| phones       | Arrays | No       | Danh sách số điện thoại cần đếm. Nếu để trống sẽ đếm toàn bộ phiên |

Example cURL

```
curl --location '[URL]/api/call_bot/call/count' \
--header 'x-api-key: <your_api_key>' \
--header 'Content-Type: application/json' \
--data '{
    "autocall_id": "6912a712f9c97b58c60b9f63",
    "phones": [
        "070599****"
    ]
}'
```

{% tabs %}
{% tab title="200: OK" %}

```json
{
    "instance_id": "stg",
    "payload": 0,
    "instance_version": "1.2.164",
    "key_enabled": false,
    "status_code": 9999
}
```

{% endtab %}
{% endtabs %}

## Lấy chi tiết kịch bản callbot

<mark style="color:blue;">`GET`</mark> `[URL]/api/call_bot/get_by_id/:id`

Header

| Name          | Type   | Required | Description                  |
| ------------- | ------ | -------- | ---------------------------- |
| Authorization | String | Yes      | Access token: Bearer 'token' |
| Content-Type  | String | Yes      | `application/json`           |

Example cURL

```
curl --location '[URL]/api/call_bot/get_by_id/:id' \
--header 'content-type: application/json' \
--header 'x-api-key: <your_api_key>'
```

{% tabs %}
{% tab title="200: OK" %}

```json
{
  "instance_id": "stg",
  "instance_version": "1.2.164",
  "key_enabled": false,
  "payload": {
    "id": "69e82c04d0******",
    "uuid": "0739227b-677f-441f*****",
    "tenant_id": "634cb99eb255*****",
    "name": "123123",
    "variables": [],
    "connections": [
      {
        "sourceHandle": "1",
        "animated": false,
        "style": {
          "strokeWidth": 3,
          "stroke": "#00B1FF"
        },
        "id": "reactflow__edge-wfyesGZDhO1-xkEm6QmM6M1",
        "source": "wfyesGZDhO",
        "type": "custom",
        "targetHandle": "1",
        "target": "xkEm6QmM6M"
      }
    ],
    "nodes": [
      {
        "id": "wfyesGZDhO",
        "node_type": "BEGIN",
        "next_nodes": [
          "xkEm6QmM6M"
        ],
        "is_collapse": false
      },
      {
        "id": "xkEm6QmM6M",
        "node_type": "STAFF",
        "template_content": "",
        "return_template_content": "",
        "wrong_response_content": "",
        "customer_response_delay": 10000,
        "is_collapse": false,
        "audio_file": {
          "name": "ghi âm.mp3",
          "src": "634cb99eb255dc***/callbot_recording_file/2026/04/9f921f48-8700-4209-808e-0496d45279db.mp3",
          "duration": "21.6",
          "pbx_source": "/mnt/data/freeswitch/recordings/testtruong1710/callbot/2026/04/af684879-3e4e-4f4b-995e-fdfebbc6a6ca.mp3"
        }
      }
    ],
    "is_draft": true,
    "created_date": 1776823300555,
    "last_updated_date": 1776823300894,
    "last_publish_time": 1776823300555,
    "created_by": {
      "id": "634cb99eb25***",
      "name": "Tên",
      "contact_id": "634cb99eb25",
      "avatar_url": null,
      "ref_type": null,
      "gender": null,
      "email": null
    },
   
    "last_updated_by": {
      "id": "634cb99eb25***",
      "name": "Tên",
      "contact_id": "634cb99eb25",
      "avatar_url": null,
      "ref_type": null,
      "gender": null,
      "email": null
    },
    "is_deleted": false,
    "collect_authentication_data": "NONE",
    "system_intent_ids": [],
    "system_entity_type_ids": [],
    "version": 1,
    "is_newest_version": false,
    "is_publish": true,
    "custom_variables": [],
    "classifies": [],
    "variables_with_order": [],
    "speed": 1,
    "voice": "northern_female_ngocanh",
    "type": "NORMAL",
    "is_interrupt": false,
    "parse_datetime": false
  },
  "status_code": 9999
}
```

{% endtab %}
{% endtabs %}


# Gọi tự động thông thường - API V2

## Gọi trực tiếp

<mark style="color:green;">`POST`</mark> `[URL]/api/v2/auto-call/direct-call`

Gọi trực tiếp không tạo phiên ở client. Giúp tăng tốc luồng xử lý

#### Headers

| Name                                            | Type   | Description                   |
| ----------------------------------------------- | ------ | ----------------------------- |
| Authorization<mark style="color:red;">\*</mark> | String | Bearer Access: Bearer 'token' |
| Content-type<mark style="color:red;">\*</mark>  | String | application/json              |

#### Request Body

<table><thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>phoneNumbers<mark style="color:red;">*</mark></td><td>Array</td><td>Danh sách các số điện thoại cần gọi</td></tr><tr><td>scripts<mark style="color:red;">*</mark></td><td>Array</td><td>Mảng thông tin kịch bản cuộc gọi. Tham khảo thêm mục: [<strong>Mô tả kịch bản trong cuộc gọi</strong>]</td></tr><tr><td>sipNumbers<mark style="color:red;">*</mark></td><td>Array</td><td>Danh sách đầu số dùng để thực hiện cuộc gọi.</td></tr><tr><td>httpCallback</td><td>Object</td><td><p>Config nhận hook (không bắt buộc.</p><pre class="language-json"><code class="lang-json">{
    "url": "https://..."
}
</code></pre></td></tr></tbody></table>

**Mô tả kịch bản trong cuộc gọi**

Giá trị field: \[scripts]

Ví dụ minh họa:

Dưới đây là ví dụ mẫu về kịch bản cuộc gọi. Theo thứ tự:&#x20;

* kịch bản Phát file lời chào
* kịch bản TextToSpeed
* kịch bản Tương tác phím
* kịch bản Nhóm nội bộ

> ```json
> [
> 	{
> 		"targetType": "recording",
> 		"target": "6a0c14685baa1019ff726xxx" // id file lời chào hệ thống
> 	},
> 	{
> 		"speed": 1,
> 		"targetType": "textVariable",
> 		"target": "Chào bạn, đây là cuộc gọi tự động từ tổng đài OMICALL. Cảm ơn bạn đã sử dụng dịch vụ của chúng tôi.",
> 		"voice": "northern_female_ngocanh"
> 	},
> 	{
> 		"targetType": "ivrMenu",
> 		"target": "543526" // số nội bộ đài diện của kịch bản tương tác phím
> 	},
> 	{
> 		"targetType": "ringGroup",
> 		"target": "90946" // số nội bộ đại diện của nhóm nội bộ
> 	}
> ]
> ```

Các loại kịch bản đang hỗ trợ (giá trị field scripts\[n].targetType):

1. "recording" : kịch bản Phát file lời chào.
2. "textVariable" : kịch bản TextToSpeed.
3. "ivrMenu" : kịch bản Tương tác phím.
4. "ringGroup" : kịch bản Nhóm nội bộ.

{% tabs %}
{% tab title="Phát file lời chào" %}

```json
{
	"targetType": "recording",
	"target": "6a0c14685baa1019ff726xxx" // id file lời chào hệ thống
}
// Tham khảo giá trị file lời chào tại mục 'Danh sách file ghi âm' : 
// https://api.omicall.com/omicall-api/call-center
```

{% endtab %}

{% tab title="TextToSpeed" %}

```json
{
	"targetType": "textVariable",
	"target": "Chào bạn, đây là cuộc gọi tự động từ tổng đài OMICALL. Cảm ơn bạn đã sử dụng dịch vụ của chúng tôi.",
	"speed": 1,
	"voice": "northern_female_ngocanh"
}
/*
 1. "targetValue": nội dung cần đọc (thông điệp dạng chữ).
 	Giá trị: kiểu text
 	Ví dụ: "Chào bạn, đây là cuộc gọi tự động từ tổng đài OMICALL. Cảm ơn bạn đã sử dụng dịch vụ của chúng tôi.".
 
 2. "speed": tốc độ đọc. 
 	Giá trị: kiểu Integer
 	
     + 1.2 : Rất chậm.
     + 1.1 : Chậm.
     + 1   : Bình thường.
     + 0.9 : Nhanh.
     + 0.8 : Rất nhanh.
 		
 3. "voice": giọng đọc
 	Giá trị: kiểu text
 	
     + "northern_female_ngocanh" : Giọng nữ miền Bắc.
     + "northern_male_anhkiet"   : Giọng nam miền Bắc.
     + "southern_female_khangan" : Giọng nữ miền Nam.
*/
```

{% endtab %}

{% tab title="Tương tác phím" %}

```json
{
	"targetType": "ivrMenu",
	"target": "543526" // số nội bộ đài diện của kịch bản tương tác phím
}
// Tham khảo giá trị file lời chào tại mục 'Danh sách KỊCH BẢN BẤM PHÍM' : 
// https://api.omicall.com/omicall-api/call-center
```

{% endtab %}

{% tab title="Nhóm nội bộ" %}

```json
{
	"targetType": "ringGroup",
	"target": "90946" // số nội bộ đại diện của nhóm nội bộ
}
// Tham khảo giá trị file lời chào tại mục 'Danh sách NHÓM NỘI BỘ' : 
// https://api.omicall.com/omicall-api/call-center
```

{% endtab %}
{% endtabs %}

**Dữ liệu trả về:**

Thông tin số điện thoại và UUID của cuộc gọi, nó là autocall\_uuid trong bản tin webhook lịch sử cuộc gọi

{% tabs %}
{% tab title="200 Dữ liệu trả về thành công" %}

```
{
    "status_code": 9999,
    "instance_id": "stg",
    "instance_name": "DESKTOP-3I0NHO0",
    "payload": {
        "0979xxxxxx" : "3038a136-0b8b-4466-9ef2-1a19e19721db"
    },
    "key_enabled": false
}
```

{% endtab %}

{% tab title="Webhook" %}

```json
// Webhook response khi có config httpCallback
{
  "isSuccess": true, //Trạng thái phiên đẩy lên tổng đài
  "data": {
    "recordUUID": "3697a413-74a8-491c-b8dd-xxx",//UUID định danh cuộc gọi trong phiên
    "currentCCU": 0, //CCU ngay trước thời điểm gọi
    "endTimeMs": 1779930014641, //Thời gian kết thúc xử lý và bắt đầu đẩy cuộc gọi lên tổng đài
    "phoneNumber": "093273xxx", //Số điện thoại khách hàng
    "sipNumber": "0966967xxx", //Số sip dùng để gọi ra
    "maxCCU": 100 //CCU tối đa
  }
}
```

{% endtab %}
{% endtabs %}

## Tạo phiên

<mark style="color:green;">`POST`</mark> `[URL]/api/v2/autoCall/executeByPhone`

Tạo phiên gọi AutoCall từ danh sách số điện thoại

#### Headers

| Name                                            | Type   | Description                   |
| ----------------------------------------------- | ------ | ----------------------------- |
| Authorization<mark style="color:red;">\*</mark> | String | Bearer Access: Bearer 'token' |
| Content-type<mark style="color:red;">\*</mark>  | String | application/json              |

#### Request Body

| Name                                      | Type                  | Description                                                                                                                  |
| ----------------------------------------- | --------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| name                                      | String                | Tên phiên                                                                                                                    |
| sendTime                                  | Long                  | Thời gian thực hiện phiên gọi. Nếu không truyền mặc định là thời điểm hiện tại.                                              |
| scripts<mark style="color:red;">\*</mark> | Array                 | Mảng thông tin kịch bản cuộc gọi. Tham khảo thêm mục: \[**Mô tả kịch bản trong cuộc gọi**]                                   |
| numberCallOuts                            | Array                 | Danh sách đầu số dùng để thực hiện cuộc gọi. Nếu không truyền mặc định là sử dụng toàn bộ đầu số của DN                      |
| receiverPhoneNumbers                      | Array                 | Danh sách số điện thoại khách nhận cuộc gọi.                                                                                 |
| numberCallPerTime                         | Integer               | Nhóm số lượng cuộc gọi thực hiện mỗi lần. Giá trị tối đa bằng CCU của gói dịch vụ                                            |
| durationOfEachCall                        | Integer               | Khoảng thời gian cấu hình giữa các phiên gọi nhóm                                                                            |
| maxRetryOfDetail                          | Interger              | Số lượt gọi lại tối đa                                                                                                       |
| retryAfterSeconds                         | Integer               | Khoảng thời gian gọi lại                                                                                                     |
| autoPause                                 | Boolean (true, false) | Cho phép phiên tự động dừng khi không có nhân viên hiệu lực không. Cấu hình này chỉ áp dụng cho kịch bản gọi vào nhóm nội bộ |

**Mô tả kịch bản trong cuộc gọi**

Giá trị field: \[scripts]

Ví dụ minh họa:

Dưới đây là ví dụ mẫu về kịch bản cuộc gọi. Theo thứ tự:&#x20;

* kịch bản Phát file lời chào
* kịch bản TextToSpeed
* kịch bản Tương tác phím
* kịch bản Nhóm nội bộ

> ```json
> [
> 	{
> 		"targetId": "60e79bf81b20043c4e7a68d0",
> 		"targetType": "recording",
> 		"targetValue": "1e942ee5-83f1-4893-9416-b4cbcb832e3c.mp3"
> 	},
> 	{
> 		"speed": 1,
> 		"targetType": "callBotTextVariable",
> 		"targetValue": "Chào bạn, đây là cuộc gọi tự động từ tổng đài OMICALL. Cảm ơn bạn đã sử dụng dịch vụ của chúng tôi.",
> 		"voice": "banmai"
> 	},
> 	{
> 		"targetId": "6491781136826a5f9ce62910",
> 		"targetType": "ivrMenu",
> 		"targetValue": "728341"
> 	},
> 	{
> 		"targetType": "ringGroup",
> 		"targetId": "65af2e9cc567a1128d92ffcc",
> 		"targetValue": "79149"
> 	}
> ]
> ```

Các loại kịch bản đang hỗ trợ (giá trị field scripts\[n].targetType):

1. "recording" : kịch bản Phát file lời chào.
2. "callBotTextVariable" : kịch bản TextToSpeed.
3. "ivrMenu" : kịch bản Tương tác phím.
4. "ringGroup" : kịch bản Nhóm nội bộ.

{% tabs %}
{% tab title="Phát file lời chào" %}

```json
{
	"targetType": "recording",
	"targetId": "60e79bf81b20043c4e7a68d0",
	"targetValue": "1e942ee5-83f1-4893-9416-b4cbcb832e3c.mp3"
}
// Tham khảo giá trị file lời chào tại mục 'Danh sách file ghi âm' : 
// https://api.omicall.com/omicall-api/call-center
```

{% endtab %}

{% tab title="TextToSpeed" %}

```json
{
	"targetType": "callBotTextVariable",
	"targetValue": "Chào bạn, đây là cuộc gọi tự động từ tổng đài OMICALL. Cảm ơn bạn đã sử dụng dịch vụ của chúng tôi.",
	"speed": 1,
	"voice": "northern_female_ngocanh"
}
/*
 1. "targetValue": nội dung cần đọc (thông điệp dạng chữ).
 	Giá trị: kiểu text
 	Ví dụ: "Chào bạn, đây là cuộc gọi tự động từ tổng đài OMICALL. Cảm ơn bạn đã sử dụng dịch vụ của chúng tôi.".
 
 2. "speed": tốc độ đọc. 
 	Giá trị: kiểu Integer
 	
     + 1.2 : Rất chậm.
     + 1.1 : Chậm.
     + 1   : Bình thường.
     + 0.9 : Nhanh.
     + 0.8 : Rất nhanh.
 		
 3. "voice": giọng đọc
 	Giá trị: kiểu text
 	
     + "northern_female_ngocanh" : Giọng nữ miền Bắc.
     + "northern_male_anhkiet"   : Giọng nam miền Bắc.
     + "southern_female_khangan" : Giọng nữ miền Nam.
*/
```

{% endtab %}

{% tab title="Tương tác phím" %}

```json
{
	"targetType": "ivrMenu",
	"targetId": "6491781136826a5f9ce62910",
	"targetValue": "728341"
}
// Tham khảo giá trị file lời chào tại mục 'Danh sách KỊCH BẢN BẤM PHÍM' : 
// https://api.omicall.com/omicall-api/call-center
```

{% endtab %}

{% tab title="Nhóm nội bộ" %}

```json
{
	"targetType": "ringGroup",
	"targetId": "65af2e9cc567a1128d92ffcc",
	"targetValue": "79149"
}
// Tham khảo giá trị file lời chào tại mục 'Danh sách NHÓM NỘI BỘ' : 
// https://api.omicall.com/omicall-api/call-center
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="200 Dữ liệu trả về thành công" %}

```
{
    "status_code": 9999,
    "instance_id": "stg",
    "instance_name": "DESKTOP-3I0NHO0",
    "payload": {
        "next_page": 1,
        "page_number": 1,
        "has_previous": false,
        "has_next": false,
        "total_pages": 1,
        "previous_page": 1,
        "total_items": 1,
        "page_size": 50
        "items": [
            {
                "public_id": "", // Id
                "create_by": {
                    "name": "TestBoss 123"
                },
                "last_update_by": {
                    "name": "TestBoss 123"
                },
                "created_date": 1576229754881,
                "last_updated_date": 1580807004410,
                "contact_type": "contact",
                "tags_view": null,
                "is_deleted": false, // Trạng thái
                "tags": [], // Thẻ tags khách hàng
                "attribute_structure": [
                    {
                        "identify": false,
                        "field_code": "full_name",
                        "field_type": "single_text",
                        "value": [
                            {
                                "display_value": "Trần Văn Tiến 1",
                                "data_type": null,
                                "value_type": null
                            }
                        ]
                    },
                    {
                        "identify": false,
                        "field_code": "job_title",
                        "field_type": "single_text",
                        "value": [
                            {
                                "display_value": "Giám đốc",
                                "data_type": null,
                                "value_type": null
                            }
                        ]
                    },
                    {
                        "identify": false,
                        "field_code": "gender",
                        "field_type": "radio",
                        "value": [
                            {
                                "display_value": "male",
                                "data_type": null,
                                "value_type": null
                            }
                        ]
                    },
                    {
                        "identify": false,
                        "field_code": "phone_number",
                        "field_type": "phone",
                        "value": [
                            {
                                "display_value": "0395187319",
                                "data_type": "personal",
                                "value_type": "Cá nhân"
                            }
                        ]
                    },
                    {
                        "identify": false,
                        "field_code": "mail",
                        "field_type": "email",
                        "value": [
                            {
                                "display_value": "tientv1212@gmail.com",
                                "data_type": "personal",
                                "value_type": "Cá nhân"
                            }
                        ]
                    },
                    {
                        "identify": false,
                        "field_code": "address",
                        "field_type": "single_text",
                        "value": [
                            {
                                "display_value": "Số 6 , đường 16, Hiệp Bình Chánh, Thủ Đức, HCM",
                                "data_type": null,
                                "value_type": null
                            }
                        ]
                    },
                    {
                        "identify": false,
                        "field_code": "passport",
                        "field_type": "single_text",
                        "value": [
                            {
                                "display_value": "",
                                "data_type": null,
                                "value_type": null
                            }
                        ]
                    },
                    {
                        "identify": false,
                        "field_code": "note",
                        "field_type": "multi_text",
                        "value": [
                            {
                                "display_value": "Khách hàng VIP, cần được chăm sóc kĩ",
                                "data_type": null,
                                "value_type": null
                            }
                        ]
                    },
                    {
                        "identify": false,
                        "field_code": "more_infomation",
                        "field_type": "customize",
                        "value": [
                            {
                                "display_value": "Nguyễn Văn B",
                                "data_type": "value1",
                                "value_type": "Người thân"
                            },
                            {
                                "display_value": "Vàng",
                                "data_type": "label2",
                                "value_type": "Màu sắc yêu thích"
                            }
                        ]
                    }
                ]
            }
        ]
    },
    "key_enabled": false
}
```

{% endtab %}
{% endtabs %}


# Webhooks

Quản lý Webhook

## Danh sách webhook

<mark style="color:blue;">`GET`</mark> `[URL/api/webhooks/list`

Danh sách webhook

#### Headers

| Name          | Type   | Description  |
| ------------- | ------ | ------------ |
| Authorization | string | Access token |

{% tabs %}
{% tab title="200 Danh sách Webhook" %}

```
{
    "status_code": 9999,
    "instance_id": "stg",
    "payload": [
        {
            "url": "https://demo.omicall.com/omicall/updatecall",
            "type": "call",
            "status": "actived"
        }
    ],
    "key_enabled": false
}
```

{% endtab %}
{% endtabs %}

## Đăng ký Webhook

<mark style="color:green;">`POST`</mark> `[URL]/api/webhooks/register`

Ghi danh Webhook

#### Headers

| Name          | Type   | Description  |
| ------------- | ------ | ------------ |
| Authorization | string | Access token |

#### Request Body

| Name    | Type   | Description                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| ------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| webhook | object | <p>Đối tượng :<br>- <strong>type</strong> : <em>Loại Webhook</em> : call, contact<br>- <strong>url</strong> : <em>Đường dẫn Webhook</em> <br><em>- <strong>events</strong> : \["ringing",",answered","hangup"]</em></p><p><br><code>{</code> <br> <code>"webhook" : {</code> <br>   <code>"type" : "call",</code> <br>    <code>"url" : "https\://...." ,</code></p><p>    <code>"events": null</code><br>  <code>}</code> <br><code>}</code></p> |

{% tabs %}
{% tab title="200 Ghi danh Webhook thành công" %}

```
{
    "status_code": 9999,
    "instance_id": "stg",
    "payload": [
        {
            "url": "https://demo.omicall.com/omicall/updatecall",
            "type": "call",
            "status": "actived"
        }
    ],
    "key_enabled": false
}
```

{% endtab %}
{% endtabs %}

## Hủy Webhook

<mark style="color:green;">`POST`</mark> `[URL]/api/webhooks/destroy?hook_type=`

Hủy đăng ký Webhook

#### Query Parameters

| Name       | Type   | Description                                                                    |
| ---------- | ------ | ------------------------------------------------------------------------------ |
| hook\_type | string | <p>Một trong các giá trị sau<br>- <strong>call</strong> : Lịch sử cuộc gọi</p> |

#### Headers

| Name          | Type   | Description  |
| ------------- | ------ | ------------ |
| Authorization | string | Access token |

{% tabs %}
{% tab title="200 " %}

```
```

{% endtab %}
{% endtabs %}


# Click To Call

API dùng để thực hiện **click-to-call**.

Sau khi thực hiện click-to-call, hệ thống sẽ gọi vào số extension của domain, sau khi extension pickup cuộc gọi thì có một cuộc gọi đẩy ra số mobile dựa vào parameter của API.

## Click To Call

<mark style="color:green;">`POST`</mark> `[URL]/api/click2call`

#### Headers

| Name          | Type   | Description           |
| ------------- | ------ | --------------------- |
| Authorization | string | Bearer 'Access Token' |

#### Request Body

| Name          | Type   | Description                            |
| ------------- | ------ | -------------------------------------- |
| extension     | string | Số máy lẻ nhân viên thực hiện cuộc gọi |
| hotline       | string | Số Hotline (hay số SIP)                |
| phone\_number | string | Số điện thoại gọi tới                  |

{% tabs %}
{% tab title="200 " %}

```json
{
    "status_code": 9999,
    "instance_id": "stg",
    "instance_version": "1.2.163",
    "payload": {
        "call_uuid": "b4dae7fe-9d09-4491-918f-2b391fd5feef" // id cuộc gọi
    },
    "key_enabled": false
}
```

{% endtab %}

{% tab title="Error" %}

```json
{
	"status_code": -9999,
	"instance_id": "stg",
	"instance_version": "1.2.163",
	"payload": {
		"status": "fail",
		"error": "data_is_required",
		"message": "Please check your input param"
	},
	"key_enabled": false
}
```

{% endtab %}
{% endtabs %}

Mô tả mã lỗi trong trường hợp gọi API không thành công

| <p>ERROR CODE</p><p>(payload.error)</p> | <p>MESAGE</p><p>(payload.message)</p>                       | DESCRIPTION                                                                  |
| --------------------------------------- | ----------------------------------------------------------- | ---------------------------------------------------------------------------- |
| *data\_is\_required*                    | Please check your input param                               | Dữ liệu là bắt buộc                                                          |
| *tenant\_invalid*                       | Your tenant not found                                       | Doanh nghiệp không hợp lệ                                                    |
| *user\_not\_registered*                 | User not registered extension with Softphone, IP Phone, Web | Số máy lẻ không được ghi danh tổng đài                                       |
| *number\_call\_out\_invalid*            | Your hotline invalid                                        | Số hotline gọi ra không hợp lệ hoặc không có                                 |
| *extension\_invalid*                    | Extension not found or disabled                             | Số máy lẻ không hợp lệ                                                       |
| user\_busy                              | User busy                                                   | Số điện thoại gọi tới bận                                                    |
| do\_not\_call                           | Do not call                                                 | Số điện thoại gọi tới đăng ký donotcall (đăng ký không làm phiền ở nhà mạng) |
|                                         | Unknown                                                     | Lỗi khác                                                                     |


# API tiêu chí kịch bản

#### API : Ưu tiên nhân viên quản lý khách hàng

OMICall hỗ trợ gọi API chủ động sang bên đối tác CRM, CMS, ERP ... đế lấy thông tin người phụ trách khách hàng theo số điện thoại , khi doanh nghiệp không muốn lưu trữ KH ở OMI

Đối tác cần chuẩn bị API theo yêu cầu sau

1. API dạng GET
2. Chứng thực bằng dạng KEY Header (X-API-KEY). Key do OMICall cung cấp
3. Response là dạng Text với format : 101:102:104 (Trong đó các giá trị là số máy lẻ (extension) của nhân viên
4. Trường hợp không có người phụ trách : Trả về empty, hệ thống sẽ tự chuyển vào kịch bản tiếp theo
5. Timeout request chỉ cho phép là 2s&#x20;

## API lấy người phụ trách theo số điện thoại

<mark style="color:blue;">`GET`</mark> `https://demo.crm.com.vn/get_owner_contact_by_phone?phoneNumber=&sipNumber=`

#### Query Parameters

| Name                                          | Type   | Description               |
| --------------------------------------------- | ------ | ------------------------- |
| phoneNumber<mark style="color:red;">\*</mark> | String | Số điện thoại KH gọi vào  |
| sipNumber                                     | String | Số hotline khách hàng gọi |

#### Headers

| Name                                        | Type   | Description             |
| ------------------------------------------- | ------ | ----------------------- |
| X-API-KEY<mark style="color:red;">\*</mark> | String | API KEY do OMI cung cấp |

{% tabs %}
{% tab title="200: OK " %}
101:102:100
{% endtab %}
{% endtabs %}


# AI API


# Text To Speech API

Các API cơ bản dùng để chuyển giọng nói thành văn bản hoặc chuyển văn bản thành giọng nói

## API TTS (Text2Speech):

<mark style="color:green;">`POST`</mark> [`https://public-v1-stg.omicall.com/api/ai/text_to_speech`](https://public-v1-stg.omicall.com/api/ai/text_to_speech)

#### Headers

| Name                                     | Type   | Description                 |
| ---------------------------------------- | ------ | --------------------------- |
| apiKey<mark style="color:red;">\*</mark> | String | Token xác thực truy cập API |

#### Request Body

| Name                                   | Type    | Description                                                                                                                                                                                                                         |
| -------------------------------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| text<mark style="color:red;">\*</mark> | String  | Nội dung văn bản                                                                                                                                                                                                                    |
| speed                                  | Integer | Tốc độ đọc là giá trị thực trong khoảng \[0.8, 1.2]. Mặc định là 1                                                                                                                                                                  |
| speaker\_id                            | String  | <p>ID giọng đọc mặc định là 'northern\_female\_ngocanh'. </p><p></p><p>Danh sách ID các giọng đọc: </p><p>northern\_female\_ngocanh</p><p>southern\_male\_tienhuy</p><p>northern\_male\_anhkiet</p><p>southern\_female\_khangan</p> |

{% tabs %}
{% tab title="200: OK Thành công" %}
{% code overflow="wrap" %}

```json
{
    "instance_id": "stg",
    "payload": {
        "data": {
            "audioDuration": 13.47,// Thời lượng tính bằng giây của audio
            "sampleRate": 8000, // Tần số lấy mẫu 
            "url": ""//URL download
        }
    },
    "instance_version": "1.2.164",
    "key_enabled": false,
    "status_code": 9999
}
```

{% endcode %}
{% endtab %}
{% endtabs %}


# Speech To Text API

API phục vụ phân tích âm thanh thành giọng nói

## Bước 1: Đăng ký webhook url để nhận kết quả ASR

<mark style="color:green;">`POST`</mark> [`https://public-v1-stg.omicrm.com/api/ai/register_webhook_ai`](https://public-v1-stg.omicrm.com/api/ai/register_webhook_ai)

#### Headers

| Name                                     | Type   | Description                    |
| ---------------------------------------- | ------ | ------------------------------ |
| apiKey<mark style="color:red;">\*</mark> | String | Token xác thực để truy cập API |

#### Request Body

| Name                                  | Type   | Description            |
| ------------------------------------- | ------ | ---------------------- |
| url<mark style="color:red;">\*</mark> | String | Đường dẫn nhận dữ liệu |

{% tabs %}
{% tab title="200: OK Thành công" %}

{% endtab %}
{% endtabs %}

Kết Quả Từ Hook

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FVdu6UfWt0QWhLwQVOQyk%2Fimage.png?alt=media&amp;token=d2d52877-1959-40d0-b138-0f8995954e0e" alt=""><figcaption></figcaption></figure>

| Name            | Type   | Description                                                                |
| --------------- | ------ | -------------------------------------------------------------------------- |
| from            | String | thời gian bắt đầu của đoạn text                                            |
| to              | String | thời gian kết thúc của đoạn text                                           |
| word\_alignment | String | mảng các từ được cắt theo thời gian                                        |
| text            | String | Chuỗi text được dịch từ speech                                             |
| tracking\_id    | String | ID truyền vào lúc gửi request phân tích qua để Mapping kết quả với request |

##

## Bước 2: Upload audio, kết quả ASR sẽ được trả về webhook url&#x20;

<mark style="color:green;">`POST`</mark> [`https://public-v1-stg.omicrm.com/api/ai/speech_to_text`](https://public-v1-stg.omicrm.com/api/ai/speech_to_text)

#### Headers

| Name                                     | Type   | Description                    |
| ---------------------------------------- | ------ | ------------------------------ |
| apiKey<mark style="color:red;">\*</mark> | String | Token xác thực để truy cập API |
| Content-Type                             | String | multipart/form-data;           |

#### Request Body ( Form Data)

| Name                                           | Type   | Description                                                            |
| ---------------------------------------------- | ------ | ---------------------------------------------------------------------- |
| file<mark style="color:red;">\*</mark>         | String | audio file (định dạng hỗ trợ  .wav/ . mp3/.m4a ) muốn chuyển sang text |
| tracking\_id<mark style="color:red;">\*</mark> | String | String chứa ID để khi nhận Webhook client biết kết quả của request nào |

{% tabs %}
{% tab title="200: OK " %}

{% endtab %}
{% endtabs %}


# Gọi tự động sử dụng callBot

API gọi tự động

## Gọi tự động tới một số điện thoại khách hàng

<mark style="color:green;">`POST`</mark> `[URL]/api/call_bot/execute_by_phone`

Tạo một phiên callBot với tham số đầu vào là một kịch bản callbot và 1 danh sách các thông tin liên hệ

#### Query Parameters

| Name                                  | Type   | Description                                                                                               |
| ------------------------------------- | ------ | --------------------------------------------------------------------------------------------------------- |
| cid<mark style="color:red;">\*</mark> | String | <p>Số hotline hay số SIP sẽ thực hiện chạy phiên.</p><p></p><p>Nếu gọi nội mạng, truyền giá trị rỗng.</p> |

#### Headers

| Name                                        | Type   | Description               |
| ------------------------------------------- | ------ | ------------------------- |
| Content-type                                | string | application/json          |
| Authorization                               | string | Access Token Bearer token |
| x-api-key<mark style="color:red;">\*</mark> | String | API key được cung cấp     |

#### Request Body

<table><thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>speed</td><td>number</td><td><p>Tốc độ đọc.Từ chậm : -3. Đến nhanh : 3. </p><p>Mặc định là 0</p></td></tr><tr><td>voice</td><td>string</td><td><p>Giọng đọc, có thể một trong các giá trị sau<br>+ "northern_female_ngocanh" : Ngọc Anh</p><p>+ "southern_female_honganh" : Hồng Anh</p><p>+ "southern_male_tienhuy" : Tiến HuyQ</p></td></tr><tr><td>cid</td><td>string</td><td>Đầu số dùng để gọi tự động. <br><em>Nếu không truyền, mặc định ưu tiên gọi nội mạng</em></td></tr><tr><td>name</td><td>string</td><td>Tên của phiên gọi tự động</td></tr><tr><td>num_retry</td><td>Integer</td><td>Số lần gọi lại khi không nghe máy. Mặc định là 0</td></tr><tr><td>num_per_call</td><td>Integer</td><td>Số cuộc gọi mỗi lần. Mặc định là 15 </td></tr><tr><td>distance_per_call</td><td>Integer</td><td>Khoảng cách thời gian , giữa các lần gọi. Mặc định là 30s</td></tr><tr><td>distance_retry</td><td>Integer</td><td>Khoảng cách giữa các lần gọi lại . Mặc định là 0</td></tr><tr><td>bot_script_id</td><td>String</td><td>Id kịch bản, được lấy ở danh sách trong hệ thống</td></tr><tr><td>send_time</td><td>Number</td><td><p>Thời gian thực hiện phiên (milisecond)</p><p></p><p>Nếu không truyền giá trị, sẽ thực hiện gọi ngay</p></td></tr><tr><td>contact_info<mark style="color:red;">*</mark></td><td>Array</td><td><p>Danh sách contact cần gọi</p><p>Giá trị: </p><pre class="language-postman_json"><code class="lang-postman_json">{
            "phone":"0395187***",
            "email":"",
            "ext_contact_code":"",
            "mapping_variables":{
                "gender1":"Anh",
                "full_name":"Trần Văn Tiến",
                "address":"Phan Huy Ích",
                "mail":"tientv@***.com",
                "birthday":"11/10/19***"
            }
        }
</code></pre><p></p><ul><li>phone : Số điện thoại KH</li><li>email: Email khách hàng nếu có</li><li>ext_contact_code : Mã KH bên thứ 03</li><li>mapping_variables : Hỗ trợ cho phép truyền biến động từ đối tác. Danh sách và chi tiết biến động cần truyền trong (API lấy danh sách KB Callbot)  </li></ul></td></tr><tr><td>ext_session_id</td><td>String</td><td><p>Mã định danh phiên bên ngoài CRM (tránh trường hợp lên trùng phiên do double summit)</p><p>Nếu có giá trị field này, mới kiểm tra trùng</p></td></tr></tbody></table>

{% tabs %}
{% tab title="200 Thông tin phiên gọi tự động" %}

```
{
    "instance_id": "stg",
    "payload": {
        "bot_script_id": "653b155db0f794**********",
        "autocall_id": "6552de1891be25**********",
        "errors" : [
		    	{
		  	  	"phone" : "09xxxxxxxx",
		  	  	"error_code" : "number_dnc",
		    		"message" : "Number DNC"
		    	}
	    	]
    },
    "instance_version": "1.2.164",
    "key_enabled": false,
    "status_code": 9999
}
```

{% endtab %}
{% endtabs %}

## Lấy danh sách kịch bản bot

<mark style="color:blue;">`GET`</mark> `[URL]/api/call_bot/script/list`

Lấy danh sách kịch bản callBot do khách hàng thiết lập

{% tabs %}
{% tab title="200: OK " %}

```json
{
	"instance_id": "stg",
	"payload": [
		{
			"id": "64915bc76a690c0edad14723",
			"name": "Thông báo điểm thi",
			"variables": [
				{
					"field_name": "tên thí sinh",
					"field_code": "tên thí sinh",
					"field_value": "",
					"field_type": "",
					"type": "",
					"is_dynamic_attribute": true
				},
				{
					"field_name": "Toán",
					"field_code": "uB131frQEU",
					"field_value": "",
					"field_type": "single_text",
					"type": "CONTACT",
					"is_dynamic_attribute": true
				}
			]
		},
		{
			"id": "64a922f61900954f5419d503",
			"name": "Cảnh báo từ khóa tiêu cực",
			"variables": [
				{
					"field_name": "",
					"field_code": "nhanvien",
					"field_value": "",
					"field_type": "",
					"type": "",
					"is_dynamic_attribute": true
				},
				{
					"field_name": "",
					"field_code": "tenkhachhang",
					"field_value": "",
					"field_type": "",
					"type": "",
					"is_dynamic_attribute": true
				},
				{
					"field_name": "",
					"field_code": "sodienthoai",
					"field_value": "",
					"field_type": "",
					"type": "",
					"is_dynamic_attribute": true
				},
				{
					"field_name": "",
					"field_code": "thoigiangoi",
					"field_value": "",
					"field_type": "",
					"type": "",
					"is_dynamic_attribute": true
				},
				{
					"field_name": "",
					"field_code": "diem",
					"field_value": "",
					"field_type": "",
					"type": "",
					"is_dynamic_attribute": true
				}
			]
		}
	],
	"instance_version": "1.2.164",
	"key_enabled": false,
	"status_code": 9999
}
```

{% endtab %}
{% endtabs %}

## Đếm số lượng cuộc gọi của phiên

<mark style="color:blue;">`POST`</mark> `[URL]/api/call_bot/call/count`

Header

| Name          | Type   | Required | Description                  |
| ------------- | ------ | -------- | ---------------------------- |
| Authorization | String | Yes      | Access token: Bearer 'token' |
| Content-Type  | String | Yes      | `application/json`           |

Request Body

| Field        | Type   | Required | Description                                                        |
| ------------ | ------ | -------- | ------------------------------------------------------------------ |
| autocall\_id | String | Yes      | Id của phiên autocall                                              |
| phones       | Arrays | No       | Danh sách số điện thoại cần đếm. Nếu để trống sẽ đếm toàn bộ phiên |

Example cURL

```
curl --location '[URL]/api/call_bot/call/count' \
--header 'x-api-key: <your_api_key>' \
--header 'Content-Type: application/json' \
--data '{
    "autocall_id": "6912a712f9c97b58c60b9f63",
    "phones": [
        "070599****"
    ]
}'
```

{% tabs %}
{% tab title="200: OK" %}

```json
{
    "instance_id": "stg",
    "payload": 0,
    "instance_version": "1.2.164",
    "key_enabled": false,
    "status_code": 9999
}
```

{% endtab %}
{% endtabs %}

## Lấy chi tiết kịch bản callbot

<mark style="color:blue;">`GET`</mark> `[URL]/api/call_bot/get_by_id/:id`

Lấy chi tiết kịch bản callBot do khách hàng thiết lập

#### Query Parameters

| Name                                 | Type   | Description         |
| ------------------------------------ | ------ | ------------------- |
| id<mark style="color:red;">\*</mark> | String | Id kịch bản callbot |

#### Headers

| Name                                        | Type   | Description               |
| ------------------------------------------- | ------ | ------------------------- |
| Content-type                                | string | application/json          |
| Authorization                               | string | Access Token Bearer token |
| x-api-key<mark style="color:red;">\*</mark> | String | API key được cung cấp     |

{% tabs %}
{% tab title="200: OK" %}

```json
{
  "instance_id": "stg",
  "instance_version": "1.2.164",
  "key_enabled": false,
  "payload": {
    "id": "69e82c04d06bd25e152a5762",
    "uuid": "0739227b-677f-441f-b09a-9ee9ecc11937",
    "tenant_id": "634cb99eb255dc23e1abfe56",
    "name": "123123",
    "variables": [],
    "connections": [
      {
        "sourceHandle": "1",
        "animated": false,
        "style": {
          "strokeWidth": 3,
          "stroke": "#00B1FF"
        },
        "id": "reactflow__edge-wfyesGZDhO1-xkEm6QmM6M1",
        "source": "wfyesGZDhO",
        "type": "custom",
        "targetHandle": "1",
        "target": "xkEm6QmM6M"
      }
    ],
    "nodes": [
      {
        "id": "wfyesGZDhO",
        "node_type": "BEGIN",
        "next_nodes": [
          "xkEm6QmM6M"
        ],
        "is_collapse": false
      },
      {
        "id": "xkEm6QmM6M",
        "node_type": "STAFF",
        "template_content": "",
        "return_template_content": "",
        "wrong_response_content": "",
        "customer_response_delay": 10000,
        "is_collapse": false,
        "audio_file": {
          "name": "ghi âm.mp3",
          "src": "634cb99eb255dc23e1abfe56/callbot_recording_file/2026/04/9f921f48-8700-4209-808e-0496d45279db.mp3",
          "duration": "21.6",
          "pbx_source": "/mnt/data/freeswitch/recordings/testtruong1710/callbot/2026/04/af684879-3e4e-4f4b-995e-fdfebbc6a6ca.mp3"
        }
      }
    ],
    "is_draft": true,
    "created_date": 1776823300555,
    "last_updated_date": 1776823300894,
    "last_publish_time": 1776823300555,
    "created_by": {
      "id": "634cb99eb255dc23e1abfe59",
      "name": "TruongND",
      "contact_id": "634cb9ba5434a97a92dda131",
      "avatar_url": null,
      "ref_type": null,
      "gender": null,
      "email": null
    },
    "public_key": "cb79b64f-b6a4-4962-a5c7-e1aeea85b530",
    "last_updated_by": {
      "id": "634cb99eb255dc23e1abfe59",
      "name": "TruongND",
      "contact_id": "634cb9ba5434a97a92dda131",
      "avatar_url": null,
      "ref_type": null,
      "gender": null,
      "email": null
    },
    "is_deleted": false,
    "collect_authentication_data": "NONE",
    "system_intent_ids": [],
    "system_entity_type_ids": [],
    "version": 1,
    "is_newest_version": false,
    "is_publish": true,
    "custom_variables": [],
    "classifies": [],
    "variables_with_order": [],
    "speed": 1,
    "voice": "northern_female_ngocanh",
    "type": "NORMAL",
    "is_interrupt": false,
    "parse_datetime": false
  },
  "status_code": 9999
}
```

{% endtab %}
{% endtabs %}

## Báo cáo phân tích phiên

<mark style="color:green;">`POST`</mark> /api/call\_bot/analyzed\_log/list

Báo cáo dữ liệu đã phân tích, đánh giá giữa Chủ đề, ý định và tính tương thích&#x20;

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

Request Param

| Name | Type    | Description                      |
| ---- | ------- | -------------------------------- |
| page | integer | Trang , mặc định là 1            |
| size | integer | Kích thước trang, mặc định là 50 |

**Body**

| Name      | Type   | Description                     |
| --------- | ------ | ------------------------------- |
| keyword   | string | Từ khoá tìm kiếm                |
| ref\_uuid | string | Id phiên của chiến dịch callbot |

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
    "instance_id": "stg",
    "payload": {
        "items": [
            {
                "_id": "67ee11592f5d1d60570ee70b",
                "tenant_id": "67eb4821758a5a4891925d99",
                "is_deleted": false,
                "created_date": 1743655257449,
                "last_updated_date": 1743655257449,
                "create_by": {
                },
                "last_update_by": {
                },
                "content": "vâng",
                "content_search": "vang",
                "content_logs": [],
                "status": "new",
                "intent": "omi_intent_confirm_right",
                "intent_id": "67ee01eaf05f0746d6d3583c",
                "entities": [],
                "entity_details": [],
                "session_id": "1400d541-0403-40dc-8ab4-12fec19c530b",
                "node_id": "peIbVXdZuH",
                "ref_uuid": "67ee1138e4c40956087cd265",
                "callbot_uuid": "e6465c1d-ab6f-472b-a0bb-e21588298882"
            }
        ],
        "page_number": 1,
        "page_size": 50,
        "total_items": 1,
        "total_pages": 1,
        "has_next": false,
        "next_page": 1,
        "has_previous": false,
        "previous_page": 1,
        "extension": null
    },
    "instance_version": "1.2.164",
    "key_enabled": false,
    "status_code": 9999
}
```

{% endtab %}

{% tab title="400" %}

```json
{
  "error": "Invalid request"
}
```

{% endtab %}
{% endtabs %}


# Phân tích cuộc gọi

Kết quả phân tích 1 cuộc gọi

<mark style="color:green;">`POST`</mark> {{url}}`/api/ai/call_transaction/get`

#### Headers

| Name                                            | Type         | Description                 |
| ----------------------------------------------- | ------------ | --------------------------- |
| Authorization<mark style="color:red;">\*</mark> | Bearer Token | AccessToken lấy từ api auth |

#### Request Body

| Name                                              | Type   | Description                             |
| ------------------------------------------------- | ------ | --------------------------------------- |
| transaction\_id<mark style="color:red;">\*</mark> | String | TransactionId của cuộc gọi đã phân tích |

{% tabs %}
{% tab title="200: OK Thành công" %}
{% code overflow="wrap" %}

```json
{
	"instance_id": "stg",
	"payload": {
		"tenant_id": "",//ID Doanh nghiệp
		"transaction_id": "",//Id cuộc gọi
		"direction": "outbound",//Hướng cuộc gọi
		"recording_file": "",//Link file ghi âm
		"sip_number": "",//Số Hotline thực hiện cuộc gọi
		"phone_number": "",//Số điện thoại khách hàng
		"time_start_to_answer": 1732682503,//Thời điểm trả lời 
		"duration": 70,//Tổng thời gian cuộc gọi
		"bill_sec": 60,//Thời lượng của cuôc gọi
		"result_speech_analytics": {},//Kết quả Speech to text
		"result_nlp_analytics": {},//Kết quả phân tích NLP
		"staff_word_alignments": [],//Tổng hợp kết quả Speech to text nhánh nhân viên
		"customer_word_alignments": [],//Tổng hợp kết quả Speech to text nhánh khách hàng
		"analyst_results": {},//Kết quả phân tích chung
		"quality_evaluation_result": {},//Kết quả đánh giá chất lượng theo thang điểm và tiêu chí
		"nl_analyze_result": {}//Đánh giá chung
	},
	"instance_version": "1.2.164",
	"key_enabled": false,
	"status_code": 9999
}
```

{% endcode %}
{% endtab %}
{% endtabs %}

Danh sách kết quả phân tích của các cuộc gọi

<mark style="color:green;">`POST`</mark> {{url}}`/api/ai/call_transaction/list`

#### Headers

| Name                                            | Type         | Description                 |
| ----------------------------------------------- | ------------ | --------------------------- |
| Authorization<mark style="color:red;">\*</mark> | Bearer Token | AccessToken lấy từ api auth |

#### Request Body

| Name                                               | Type  | Description                                       |
| -------------------------------------------------- | ----- | ------------------------------------------------- |
| transaction\_ids<mark style="color:red;">\*</mark> | Array | List TransactionIds của các cuộc gọi đã phân tích |

{% tabs %}
{% tab title="200: OK Thành công" %}
{% code overflow="wrap" %}

```json
{
	"instance_id": "stg",
	"payload": [
		{	
			"tenant_id": "", //ID Doanh nghiệp
			"transaction_id": "", //Id cuộc gọi
			"direction": "outbound", //Hướng cuộc gọi
			"recording_file": "", //Link file ghi âm
			"sip_number": "", //Số Hotline thực hiện cuộc gọi
			"phone_number": "",//Số điện thoại khách hàng
			"time_start_to_answer": 1732682503, //Thời điểm trả lời 
			"duration": 70, //Tổng thời gian cuộc gọi
			"bill_sec": 60, //Thời lượng của cuôc gọi
			"result_speech_analytics": {},//Kết quả Speech to text
			"result_nlp_analytics": {}, //Kết quả phân tích NLP
			"staff_word_alignments": [],//Tổng hợp kết quả Speech to text nhánh nhân viên
			"customer_word_alignments": [],//Tổng hợp kết quả Speech to text nhánh khách hàng
			"analyst_results": {}, //Kết quả phân tích chung
			"quality_evaluation_result": {},//Kết quả đánh giá chất lượng theo thang điểm và tiêu chí
			"nl_analyze_result": {}//Đánh giá chung
		}
	],
	"instance_version": "1.2.164",
	"key_enabled": false,
	"status_code": 9999
}

```

{% endcode %}
{% endtab %}
{% endtabs %}


# Voice Insights API

API phục vụ phân tích file ghi âm

## Bước 1: Đăng ký webhook url để nhận kết quả ASR

<mark style="color:green;">`POST`</mark> [`https://public-v1-stg.omicrm.com/api/ai/register_webhook_ai`](https://public-v1-stg.omicrm.com/api/ai/register_webhook_ai)

#### Headers

| Name                                     | Type   | Description                    |
| ---------------------------------------- | ------ | ------------------------------ |
| apiKey<mark style="color:red;">\*</mark> | String | Token xác thực để truy cập API |

#### Request Body

| Name                                  | Type   | Description            |
| ------------------------------------- | ------ | ---------------------- |
| url<mark style="color:red;">\*</mark> | String | Đường dẫn nhận dữ liệu |

{% tabs %}
{% tab title="200: OK Thành công" %}

{% endtab %}
{% endtabs %}

Kết Quả Từ Hook

<div align="center"><figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FYjACg4heHTmKvKnGjA0W%2Fimage.png?alt=media&amp;token=0d144720-f43d-4512-8bcf-0a4cc20faf7c" alt=""><figcaption></figcaption></figure></div>

| Name                             | Type   | Description                                                                    |
| -------------------------------- | ------ | ------------------------------------------------------------------------------ |
| analyst\_results                 | Object | Tổng hợp các kết quả phân tích                                                 |
| criteria\_classification\_result | Object | Kết quả chấm điểm tự động theo bộ tiêu chí                                     |
| customer\_talk\_time             | Double | Thời gian nói của khách hàng                                                   |
| customer\_word\_alignments       | String | Kết quả chi tiết từng từ của khách hàng từ ASR                                 |
| keyword\_count                   | Object | Danh sách từ khóa tìm được và số lần xuất hiện                                 |
| nl\_analyze\_result              | Object | Kết quả trả về từ mô hình ngôn ngữ lớn (LLM) như GPT                           |
| quality\_evaluation\_result      | Object | Bảng điểm chất lượng tổng hợp cho STAFF và CUSTOMER                            |
| result\_nlp\_analytics           | Object | Kết quả chi tiết từng phân đoạn hội thoại. Tổng hợp thông tin theo một câu nói |
| staff\_talk\_time                | Double | Thời gian nói của nhân viên                                                    |
| staff\_word\_alignments          | Object | Kết quả chi tiết từng từ của nhân viên từ ASR                                  |
| tracking\_id                     | String | ID truyền vào lúc gửi request phân tích qua để Mapping kết quả với request     |

##

## Bước 2: Upload audio, kết quả ASR sẽ được trả về webhook url&#x20;

<mark style="color:green;">`POST`</mark> [`https://public-v1-stg.omicrm.com/api/ai/call_analyze`](https://public-v1-stg.omicrm.com/api/ai/register_webhook_ai)

#### Headers

| Name                                     | Type   | Description                    |
| ---------------------------------------- | ------ | ------------------------------ |
| apiKey<mark style="color:red;">\*</mark> | String | Token xác thực để truy cập API |
| Content-Type                             | String | multipart/form-data;           |

#### Request Body ( Form Data)

| Name                                           | Type   | Description                                                            |
| ---------------------------------------------- | ------ | ---------------------------------------------------------------------- |
| file<mark style="color:red;">\*</mark>         | String | audio file (định dạng hỗ trợ  .wav/ . mp3/.m4a ) muốn chuyển sang text |
| tracking\_id<mark style="color:red;">\*</mark> | String | String chứa ID để khi nhận Webhook client biết kết quả của request nào |

{% tabs %}
{% tab title="200: OK " %}

{% endtab %}
{% endtabs %}


# Đa kênh

API & Webhook đa kênh OMI được sử dụng khi khách hàng hoặc đối tác có sẵn hệ thống Chat (Live Chat) cần tích hợp thêm Chatbot OMI hoặc Nhân viên trực ở OMI

## Khởi tạo cuộc trò chuyện

<mark style="color:green;">`POST`</mark> `[URL]/api/social/{channel}/new_room`

Khởi tạo cuộc trò chuyện

**Path Variable**

| Name       | Description                              |
| ---------- | ---------------------------------------- |
| channel \* | Nguồn chat của khách hàng : **livetalk** |

**Headers**

| Name         | Value              |
| ------------ | ------------------ |
| Content-Type | `application/json` |
| X-API-KEY    | `<API KEY>`        |

**Body**

<table><thead><tr><th width="170">Name</th><th width="115">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>uuid</code></td><td>string</td><td>Id của cuộc trò chuyện bên đối tác . Trường hợp empty hệ thống tự khởi tạo</td></tr><tr><td><code>guest_info</code></td><td>object</td><td><p>Thông tin khách hàng chat</p><p></p><pre class="language-postman_json"><code class="lang-postman_json">{
"phone": "0395*****",
"full_name": "Nguyen Van Hien",
"domain": "" //Nguồn định danh
}
</code></pre><p></p><p></p></td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
    "instance_id": "stg",
    "payload": {
        "conversation": {
            "created_date": 1738723737112,
            "last_updated_date": 1738723737112,
            "_id": "67a2d199beda7563afac23c6",
            "guest_info": {
                "phone": "0395*****",
                "full_name": "Nguyen Van Hien",
                "email": null,
                "contact_id": null,
                "new_contact": false,
                "uuid": "000000000000-1",
                "domain": "support130",
                "browser": null,
                "ip": null,
                "address": null,
                "lat": null,
                "lon": null,
                "other_info": {
                    "full_name": "Nguyen Van Hien",
                    "mail": null,
                    "phone_number": "0395*****"
                }
            },
            "last_message": null,
            "web_navigate": null,
            "status": "active",
            "uuid": "000000000000-1",
            "name": "Nguyen Van Hien",
            "name_unsigned": "0395*****",
            "start_type": "script",
            "members": [
            ],
            "last_message_info": {
                "sender": "guest",
                "send_time": 1738723737036,
                "create_by": null,
                "last_agent_sent_time": null,
                "last_customer_sent_time": 1738723737036
            },
            "customer_project_id": null,
            "customer_app_id": null,
            "user_app_ids": null
        }
    },
    "instance_version": "1.2.164",
    "key_enabled": false,
    "status_code": 9999
}
```

{% endtab %}
{% endtabs %}

## Gửi tin nhắn

<mark style="color:green;">`POST`</mark> `[URL]/api/social/{channel}/guest_send_message`

**Path Variable**

| Name       | Description                              |
| ---------- | ---------------------------------------- |
| channel \* | Nguồn chat của khách hàng : **livetalk** |

**Headers**

| Name         | Value              |
| ------------ | ------------------ |
| Content-Type | `application/json` |
| X-API-KEY    | `<API KEY>`        |

**Body**

<table><thead><tr><th width="167">Name</th><th width="138">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>uuid *</code></td><td>String</td><td>Id của cuộc trò chuyện đã khởi tạo trước đó</td></tr><tr><td><code>content *</code></td><td>String</td><td>Nội dung tin nhắn</td></tr><tr><td><code>multimedias</code></td><td>Array Object</td><td><p><code>[{"name":"",</code></p><p>  <code>"url:"",</code></p><p>  <code>"content_type":""</code></p><p><code>}]</code></p><p>Danh sách tập tin đính kèm</p></td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
    "instance_id": "stg",
    "payload": {
        "created_date": 1738723776704,
        "last_updated_date": 1738723776704,
        "_id": "67a2d1c0beda7563afac23f4",
        "created_by": {},
        "last_updated_by": {},
        "tenant_id": "67064126273def645101f76c",
        "is_deleted": false,
        "room_id": "67a2d199beda7563afac23c6",
        "member_type": "guest",
        "type": "chat",
        "action": null,
        "content": "Tôi cần nâng cấp mở rộng số lượng đơn hàng 222",
        "multimedias": null,
        "kind": "normal",
        "receiving_group_id": "6706412f868af156014afa11",
        "change_group_info": null,
        "uuid": "f44ef584-fecf-4ecb-bcd8-c23bee387233",
        "conv_uuid": "000000000000-1",
        "activity": null,
        "new_members": null,
        "old_members": null,
        "guest_info": null,
        "template": null,
        "user_reactions": null,
        "reactions": [],
        "quote_id": null,
        "quote_message": null,
        "gpt_key": null,
        "total_token": null,
        "amount_chat_gpt": null,
        "first_message_gpt": null,
        "prompt_tokens": null,
        "completion_tokens": null,
        "chat_gpt_model": null,
        "omi_bot_node_id": null,
        "interactive_id": null,
        "interactive_start": null,
        "interactive_end": null,
        "meeting_member": null,
        "relative_message_id": null,
        "tp_response": null,
        "omi_ai_bot_info": null,
        "file_analyze_usage": null,
        "total_prompt_tokens": null,
        "total_completion_tokens": null,
        "total_total_token": null
    },
    "instance_version": "1.2.164",
    "key_enabled": false,
    "status_code": 9999
}
```

{% endtab %}
{% endtabs %}

## Gửi file đính kèm

<mark style="color:green;">`POST`</mark> `[URL]/api/social/livetalk/send_media`

**Path Variable**

**Headers**

| Name         | Value              |
| ------------ | ------------------ |
| Content-Type | `application/json` |
| X-API-KEY    | `<API KEY>`        |

**Form data**

<table><thead><tr><th width="167">Name</th><th width="138">Type</th><th>Description</th></tr></thead><tbody><tr><td>room_id*</td><td>String</td><td>Id của cuộc trò chuyện</td></tr><tr><td>content</td><td>String</td><td>Nội dung tin nhắn</td></tr><tr><td>uuid*</td><td>String</td><td>Id của cuộc trò chuyện đã khởi tạo trước đó</td></tr><tr><td>kind</td><td>String</td><td>Loại file đính kèm: normal</td></tr><tr><td>files[0]*</td><td>File</td><td>File cần gửi</td></tr><tr><td>files[0].width</td><td>Integer</td><td>Chiều rộng hình ảnh</td></tr><tr><td>files[0].height</td><td>Integer</td><td>Chiều cao hình ảnh</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
  "status_code": 9999,
  "instance_id": "stg-localnew",
  "instance_version": "1.0.0",
  "key_enabled": false,
  "payload": {
    "_id": "667bc9f0a1b2c3d4e5f67***",
    "tenant_id": "tenant_123",
    "room_id": "65f0abc1234567890abcd***",
    "member_type": "agent",
    "type": "chat",
    "content": "Gửi kèm hình ảnh",
    "kind": "normal",
    "uuid": "req-20260624-001",
    "multimedias": [
      {
        "name": "image.jpg",
        "url": "https://cdn.omicrm.com/crm/tenant_123/meeting_message_media/2026/06/550e8400-e29b-41d4-a716-446655440000.jpg",
        "content_type": "image/jpeg",
        "width": 1280,
        "height": 720,
        "size": 245678,
        "duration": null
      }
    ],
    "is_deleted": false
  }
}
```

{% endtab %}
{% endtabs %}

## Lấy danh sách tin nhắn

<mark style="color:green;">`POST`</mark> `[URL]/api/social/message/list?page=1&size=15`

**Query Parameters**

<table><thead><tr><th width="171.7578125">Name</th><th width="169.578125">Type</th><th>Description</th></tr></thead><tbody><tr><td>page<mark style="color:red;">*</mark></td><td>Number</td><td>Chỉ số trang, bắt đầu bằng 1</td></tr><tr><td>size<mark style="color:red;">*</mark></td><td>Number</td><td>Kích thước trang, mặc định là 15</td></tr></tbody></table>

**Headers**

| Name         | Value              |
| ------------ | ------------------ |
| Content-Type | `application/json` |
| X-API-KEY    | `<API KEY>`        |

**Body**

<table><thead><tr><th width="167">Name</th><th width="138">Type</th><th>Description</th></tr></thead><tbody><tr><td>conv_id<mark style="color:red;">*</mark></td><td>String</td><td>Id của cuộc trò chuyện</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200 - Zalo" %}

```json
{
  "instance_id": "stg",
  "payload": [
    {
      "created_date": 1765772258738, // Ngày tạo
      "last_updated_date": 1765772258738, // Ngày cập nhật
      "_id": "693f8be2da2bec46dd8ab37e", // id tin nhắn
      "create_by": { // Thông tin người tạo
        "id"        : "6487dbe7572b7b17fcc8e123",
        "name"      : "Nhan vien",
        "contact_id": "6487dbeb1a309849f7205982",
      },
      "oa_id": "...", // Zalo OA id
      "zl_user_id": "...", // Zalo user id
      "message": {
        "text": "Xin chao", // Nội dung tin nhắn
        "msg_id": "4bed65845d871edf4790", // Id tin nhắn zalo
        "attachments": [ // Thông tin file đính kèm
          {
            "payload": {
              "thumbnail": "https://photo-stal-1.zdn.vn/no/jpg/thumbnail.jpg",
              "description": null,
              "url": "https://photo-stal-1.zdn.vn/no/jpg/image.jpg"
            },
            "type": "image" // Loại file đính kèm
          }
          // ...
        ]
      },
      "mg_conv_id": "68e4846e09db484ee2c21bc4" // Id cuộc trò chuyện
    }
    // ...
  ],
  "instance_version": "1.2.164",
  "key_enabled": false,
  "status_code": 9999
}

```

{% endtab %}

{% tab title="200 - Facebook" %}

```json
{
  "instance_id": "stg",
  "payload": [
    {
      "_id": "693f8f64658ba8325ccd1123", // Id tin nhắn
      "created_date": 1765773156248, // Thời gian tạo
      "last_updated_date": 1765773156248, // Thời gian cập nhật
      "create_by": { // Thông tin người tạo
        "id"        : "6487dbe7572b7b17fcc8e123",
        "name"      : "Nhan vien",
        "contact_id": "6487dbeb1a309849f7205982"
      },
      "conversation_id": "t_2878170819047206", // Id cuộc trò chuyện Facebook
      "page_id": "864321776764029", // Id Facebook page
      "message_id": "m_8sBrUAkFL0P9aRHouPFHMY0e_CHigHjcTkLCwfmkY210X70phq8hzk9ioDCO-3itNUMQC9nZRjRYh3kL5RiW0w", // Id tin nhắn Facebook
      "message": "Xin chao", // Nội dung tin nhắn
      "created_time": 1765773155000, // Thời gian gửi tin nhắn
      "from": { // Thông tin người gửi
        "name" : "Page",
        "id"   : "864321776764029",
        "email": "..."
      },
      "to": { // Thông tin người nhận
        "data": [
          {
            "name" : "User 1",
            "id"   : "25083385744656928",
            "email": "..."
          }
        ]
      },
      "attachments": { // Thông tin file đính kèm
        "data": [
          {
            "image_data": {
              "max_width": 1536,
              "width": 1536,
              "height": 2048,
              "image_type": 1,
              "max_height": 2048,
              "render_as_sticker": false,
              "preview_url": "https://scontent.fdad3-4.fna.fbcdn.net/v/t1.15752-9/598204145_899822159393061_570583991430178553_n.jpg?stp=dst-jpg_p280x280_tt6&_nc_cat=104&ccb=1-7&_nc_sid=fc17b8&_nc_ohc=bMcPQpv4U3cQ7kNvwFnuEGo&_nc_oc=AdmiTOi0tVFRhzJuEHerl2yWwxGOdQUNGIqKPrVMkLu6PLT9Y4P3aSNke466zvvpZuQ&_nc_zt=23&_nc_ht=scontent.fdad3-4.fna&edm=AKVc4UAEAAAA&_nc_tpa=Q5bMBQEFlJCiiNpboBLElLmGar8yNeSXJkNx8SS1Dm1ljnpslxiEjwRz2_iAKjL-RslwFnB1t8PvEKR2&oh=03_Q7cD4AEyqkKpZ1ayn4NUHaOBaLbgFMXgJ-nnSP4GvDvqWSz3zw&oe=6966FD55",
              "url": "https://scontent.fdad3-4.fna.fbcdn.net/v/t1.15752-9/598204145_899822159393061_570583991430178553_n.jpg?_nc_cat=104&ccb=1-7&_nc_sid=fc17b8&_nc_ohc=bMcPQpv4U3cQ7kNvwFnuEGo&_nc_oc=AdmiTOi0tVFRhzJuEHerl2yWwxGOdQUNGIqKPrVMkLu6PLT9Y4P3aSNke466zvvpZuQ&_nc_zt=23&_nc_ht=scontent.fdad3-4.fna&edm=AKVc4UAEAAAA&_nc_tpa=Q5bMBQGao6NGG81V2pmAW6XJL8KuEsdr4wnVDLSivRTclbpl2amrBYSTiRolh7Zz74-w03dc2pRWLj7O&oh=03_Q7cD4AEgqmIRGPJTFUx97x8cv3xSaa4H8GkSObQY2_bzSJppQg&oe=6966FD55"
            },
            "video_data": null,
            "name": "image-899822156059728",
            "id": "899822156059728",
            "file_url": null
          }
          // ...
        ]
      },
      "fb_user_id": "25083385744656591", // Facebook user id
      "mg_conv_id": "69008574f3ee302076703fb9", // Id cuộc trò chuyện
    }
    // ...
  ],
  "instance_version": "1.2.164",
  "key_enabled": false,
  "status_code": 9999
}

```

{% endtab %}

{% tab title="200 - LikeTalk" %}

```json
{
  "instance_id": "stg",
  "payload": [
    {
      "created_date": 1765774051614, // Ngày tạo
      "last_updated_date": 1765774051614, // Ngày cập nhật
      "_id": "693f92e3e0b8c1763ba48322", // ID tin nhắn
      "create_by": { // Thông tin người tạo
        "id"        : "6487dbe7572b7b17fcc8e123",
        "name"      : "Nhan vien",
        "contact_id": "6487dbeb1a309849f7205982"
      },
      "content": "Xin chao", // Nội dung tin nhắn
      "multimedias": [ // Thông tin file đính kèm
        {
          "name": "image.png",
          "url": "683e512eaf630b1c89a97026/meeting_message_media/2025/12/ca3ad66b-60f6-4595-af55-5c8e46f9055a.png",
          "content_type": "image/png",
          "width": null,
          "height": null,
          "size": 45887,
          "duration": null
        }
        // ...
      ],
      "guest_info": { // Thông tin khách hàng
        "phone": "0837972132",
        "full_name": "Guest",
        "email": "...",
        "contact_id": null,
        "new_contact": false,
        "uuid": "0187JKxn275V4xvRm674b7c2",
        "other_info": {
          "full_name"   : "User",
          "phone_number": "0837972132",
          "mail"        : "..."
        }
      }
    }
    // ...
  ],
  "instance_version": "1.2.164",
  "key_enabled": false,
  "status_code": 9999
}

```

{% endtab %}
{% endtabs %}

## Chuyển đổi nhân viên tiếp nhận cuộc trò chuyện

<mark style="color:green;">`POST`</mark> `[URL]/api/v3/agent/conversation/transfer`&#x20;

Chuyển toàn bộ cuộc trò chuyện trong vòng 6 tháng gần nhất do nhân viên gốc tiếp nhận hoặc được chỉ định cho nhân viên gốc sang cho nhân viên mới

#### Headers

| Name      | Type   | Description |
| --------- | ------ | ----------- |
| x-api-key | String | API Key     |

#### Request Body

<table><thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>sourceEmail<mark style="color:red;">*</mark></td><td>String</td><td>Email nhân viên gốc</td></tr><tr><td>targetEmail<mark style="color:red;">*</mark></td><td>String</td><td>Email nhân viên mới</td></tr><tr><td>previewChanges</td><td>Boolean</td><td><ul><li>true: Xem trước số lượng cuộc trò chuyện sẽ bị thay đổi sau cập nhật (không khởi tạo tiến trình cập nhật) </li><li>false (mặc định): Khởi tạo tiến trình cập nhật</li></ul></td></tr><tr><td>replaceExistingMembers</td><td>Boolean</td><td><p></p><ul><li>true: nhân viên mới sẽ thay thế toàn bộ danh sách nhân viên tiếp nhận hiện tại của cuộc trò chuyện </li><li>false (mặc định): nhân viên mới sẽ được thêm vào cuộc trò chuyện</li></ul></td></tr><tr><td>callbackResultConfig</td><td>Object</td><td><p>Thông tin hook nhận kết quả sau khi hoàn tất tiến trình:</p><ul><li>url: url nhận hook</li><li>headers (optional): danh sách headers muốn gửi kèm khi nhận hook</li></ul><pre class="language-json"><code class="lang-json">{
    "url": "https://...",
    "headers": {
        "key1": "value1"
    }
}
</code></pre></td></tr><tr><td>convIds</td><td>String[]</td><td>Chỉ định danh sách id cuộc trò chuyện (do nhân viên gốc phụ trách)</td></tr></tbody></table>

{% tabs %}
{% tab title="202 Khởi tạo tiến trình thành công " %}

```json
{
    "instance_id": "stg",
    "payload": {
        "requestId": "270ea881-a6e1-44fb-9400-a89eb4ceab4b" // unique request id, trả về kèm theo webhook nếu có khai báo "callbackResultConfig"
    },
    "instance_version": "1.2.164",
    "key_enabled": false,
    "status_code": 9999
}
```

{% endtab %}

{% tab title="Webhook" %}

```json
{
  "requestId": "270ea881-a6e1-44fb-9400-a89eb4ceab4b", // unique request id
  "requestTimeMs": 1769163675593, // thời gian request
  "action": "CONVERSATION_AGENT_TRANSFER", // loại tiến trình
  "status": "SUCCESS", // trạng thái SUCCESS/ERROR
  "responseTimeMs": 1769163675890, // thời gian kết thúc
  "payload": {
    "updatedRecords": 8 // Số lượng record được cập nhật
  }
}
```

{% endtab %}
{% endtabs %}

## Webhook

* Đối tác / Khách hàng cung cấp API để OMI callback tin nhắn trở lại khi ChatBot trả lời hoặc nhân viên trả lời từ OMI
* API dạng POST
* Body là thông tin nội dung tin nhắn
* API Timeout tối đa 2(s)


# Ticket

Quản lý ticket

## Lấy danh sách ticket

<mark style="color:green;">`POST`</mark> `/api/v2/ticket/search`

#### Query Parameters

<table><thead><tr><th width="144.3828125">Name</th><th width="163.37890625">Type</th><th>Description</th></tr></thead><tbody><tr><td>page<mark style="color:red;">*</mark></td><td>Integer</td><td>Chỉ số trang, bắt đầu bằng 1</td></tr><tr><td>size<mark style="color:red;">*</mark></td><td>Integer</td><td>Kích thước trang, mặc định là 50</td></tr></tbody></table>

#### Request Body

<table><thead><tr><th width="144.0859375">Name</th><th width="167.1171875">Type</th><th>Description</th></tr></thead><tbody><tr><td>keyword</td><td>String</td><td>Từ khóa tìm kiếm, Id ticket, nhân viên tiếp nhận hoặc nhân viên liên quan</td></tr><tr><td>ranges</td><td>Array</td><td><p>Bộ lọc tìm kiếm theo khoảng tham chiếu. Mẫu như sau:</p><p>[{ "field" : "last_updated_date", "from" : 1722445201000, "to" : 1724016602000 } ]</p></td></tr><tr><td>sort</td><td>Object</td><td>Giá trị sort. {"field" : "last_updated_date" , "isAsc" : true}</td></tr></tbody></table>

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
   "status_code":9999,
   "instance_id":"stg",
   "instance_version":"1.2.163",
   "payload":{
      "items":[
         {
            "_id":"61c04292530c6a0efa4fa171",
            "created_date":1639989906385,
            "last_updated_date":1640101239690,
            "create_by":{ // Người tạo
               
            },
            "last_updated_by":null,
            "priority":"medium", // Độ ưu tiên (low,medium,high)
            "name":"", // Tựa đề
            "description":"", // Mô tả
            "current_status":1,  // Trạng thái
            "is_expired":false, // hết hạn
            "unique_id":"2188", // Id ticket
         },
         .....
      ],
      "page_number":1,
      "page_size":15,
      "total_items":165,
      "total_pages":11,
      "has_next":true,
      "next_page":2,
      "has_previous":false,
      "previous_page":1,
      "extension":null
   },
   "key_enabled":false
}
            
```

{% endtab %}
{% endtabs %}

## Lấy thông tin ticket theo id

<mark style="color:green;">`GET`</mark> `/api/v2/ticket/getById?id=<ticket_id>`&#x20;

#### Query Parameters

<table><thead><tr><th width="144.3828125">Name</th><th width="163.37890625">Type</th><th>Description</th></tr></thead><tbody><tr><td>id<mark style="color:red;">*</mark></td><td>String</td><td>Id ticket</td></tr></tbody></table>

#### Response Body

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
   "status_code":9999,
   "instance_id":"stg",
   "instance_version":"1.2.163",
   "payload": {
      "_id":"61c04292530c6a0efa4fa171",
      "created_date":1639989906385,
      "last_updated_date":1640101239690,
      "create_by":{ // Người tạo
         
      },
      "last_updated_by":null,
      "priority":"medium", // Độ ưu tiên (low,medium,high)
      "name":"", // Tựa đề
      "description":"", // Mô tả
      "current_status":1,  // Trạng thái
      "is_expired":false, // hết hạn
      "unique_id":"2188", // Id ticket
   },
   "key_enabled":false
}
            
```

{% endtab %}
{% endtabs %}

## Tạo ticket

<mark style="color:green;">`POST`</mark> `/api/ticket/create`

#### Request Body

<table><thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>name<mark style="color:red;">*</mark></td><td>String</td><td>Tên ticket</td></tr><tr><td>description<mark style="color:red;">*</mark></td><td>String</td><td>Mô tả ticket</td></tr><tr><td>priority<mark style="color:red;">*</mark></td><td>String</td><td>Độ ưu tiên (mặc định là medium)</td></tr><tr><td>assignee<mark style="color:red;">*</mark></td><td>String</td><td>Email nhân viên được gán</td></tr><tr><td>created_by</td><td>String</td><td>Email nhân viên tạo ticket, nếu rỗng thì là Admin </td></tr><tr><td>ticket_category_id</td><td>String</td><td>Id chủ đề (API danh sách chủ đề)</td></tr><tr><td>type_uuid</td><td>String</td><td>UUID của phân loại, (Trong API danh sách chủ đề )</td></tr><tr><td>work_list</td><td>Object[]</td><td><p>Danh sách công việc cho nhân viên:</p><pre class="language-json" data-overflow="wrap"><code class="lang-json">[
    {
        "uuid": "57b91d30-294f-11f0-959d-636559b3604c", // random uuid
        "content": "task 1", // nội dung công việc
        "index": 0, // index
        "is_done": false, // trạng thái hoàn thành
        "assignee_id": "687a085be6382948e6154741" // _id của nhân viên tiếp nhận
    },
    ...
]
</code></pre></td></tr><tr><td>embed_files</td><td>Object[]</td><td><p>Danh sách file đính kèm:</p><pre class="language-json" data-overflow="wrap"><code class="lang-json">[
   { 
      "link": "https://www.alleycat.org/wp-content/uploads/2019/03/FELV-cat.jpg", // file url
      "name": "my_photo.jpg" // tên file
   },
   ...
]
</code></pre></td></tr><tr><td>notify_before_unit</td><td>String</td><td><p>Đơn vị của thời gian thông báo trước khi đến hạn. Chấp nhận các giá trị sau: </p><pre class="language-postman_json" data-overflow="wrap"><code class="lang-postman_json">second, minute, hour, day, week, month, year
</code></pre></td></tr><tr><td>notify_before</td><td>Number</td><td>Thời gian thông báo trước khi đến hạn</td></tr><tr><td>notify_type</td><td>String</td><td><p>Loại thông báo. Chấp nhận các giá trị sau:</p><pre class="language-postman_json" data-overflow="wrap"><code class="lang-postman_json">web, web_email, mobile, email, none
</code></pre></td></tr><tr><td>due_date</td><td>Number</td><td>Ngày hết hạn</td></tr><tr><td>created_by_email</td><td>String</td><td>Email của nhân viên tạo phiếu ghi (mặc định là chủ doanh nghiệp nếu không truyền)</td></tr></tbody></table>

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
    // Thông tin chi tiết 1 ticket
}
```

{% endtab %}
{% endtabs %}

## Cập nhật ticket

<mark style="color:green;">`POST`</mark> `/api/ticket/update/:ticket_id`&#x20;

#### **Path Parameters**

| Name                                         | Type   | Description  |
| -------------------------------------------- | ------ | ------------ |
| ticket\_id<mark style="color:red;">\*</mark> | String | Id phiếu ghi |

#### Request Body

<table><thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>name<mark style="color:red;">*</mark></td><td>String</td><td>Tên ticket</td></tr><tr><td>description<mark style="color:red;">*</mark></td><td>String</td><td>Mô tả ticket</td></tr><tr><td>assignee_contact_id<mark style="color:red;">*</mark></td><td>String</td><td>_id của nhân viên được gán</td></tr><tr><td>priority</td><td>String</td><td>Độ ưu tiên (low, high, medium)</td></tr><tr><td>work_list</td><td>Object[]</td><td><p>Danh sách công việc cho nhân viên:</p><pre class="language-json" data-overflow="wrap"><code class="lang-json">[
    {
        "uuid": "57b91d30-294f-11f0-959d-636559b3604c", // random uuid
        "content": "task 1", // nội dung công việc
        "index": 0, // index
        "is_done": false, // trạng thái hoàn thành
        "assignee_id": "687a085be6382948e6154741" // _id của nhân viên tiếp nhận
    },
    ...
]
</code></pre></td></tr><tr><td>embed_files</td><td>Object[]</td><td><p>Danh sách file đính kèm:</p><pre class="language-json" data-overflow="wrap"><code class="lang-json">[
   { 
      "link": "https://www.alleycat.org/wp-content/uploads/2019/03/FELV-cat.jpg", // file url
      "name": "my_photo.jpg" // tên file
   },
   ...
]
</code></pre></td></tr><tr><td>notify_before_unit</td><td>String</td><td><p>Đơn vị của thời gian thông báo trước khi đến hạn. Chấp nhận các giá trị sau: </p><pre class="language-postman_json" data-overflow="wrap"><code class="lang-postman_json">second, minute, hour, day, week, month, year
</code></pre></td></tr><tr><td>notify_before</td><td>Number</td><td>Thời gian thông báo trước khi đến hạn</td></tr><tr><td>notify_type</td><td>String</td><td><p>Loại thông báo. Chấp nhận các giá trị sau:</p><pre class="language-postman_json" data-overflow="wrap"><code class="lang-postman_json">web, web_email, mobile, email, none
</code></pre></td></tr><tr><td>due_date</td><td>Number</td><td>Ngày hết hạn</td></tr><tr><td>type_uuid</td><td>String</td><td>UUID của phân loại, (Trong API danh sách chủ đề )</td></tr><tr><td>updated_by_email</td><td>String</td><td>Email của nhân viên cập nhật phiếu ghi (mặc định là chủ doanh nghiệp nếu không truyền)</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
    // Thông tin chi tiết ticket vừa cập nhật
}
```

{% endtab %}
{% endtabs %}

## Xoá ticket

<mark style="color:green;">`DELETE`</mark> `/api/ticket/delete/:ticket_id`&#x20;

#### **Path Parameters**

| Name                                         | Type   | Description  |
| -------------------------------------------- | ------ | ------------ |
| ticket\_id<mark style="color:red;">\*</mark> | String | Id phiếu ghi |

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
    "instance_id": "stg",
    "payload": true, // true nếu xoá thành công
    "instance_version": "1.2.164",
    "key_enabled": false,
    "status_code": 9999
}
```

{% endtab %}
{% endtabs %}

## Cập nhật trạng thái ticket

<mark style="color:green;">`POST`</mark> `/api/ticket/update_status/:ticket_id`

#### Path Parameters

| Name                                         | Type   | Description |
| -------------------------------------------- | ------ | ----------- |
| ticket\_id<mark style="color:red;">\*</mark> | String | Id ticket   |

#### Request Body

| Name                                                    | Type   | Description                                                                             |
| ------------------------------------------------------- | ------ | --------------------------------------------------------------------------------------- |
| status<mark style="color:red;">\*</mark>                | Number | Index của trạng thái mới                                                                |
| assignee\_contact\_id<mark style="color:red;">\*</mark> | String | Id nhân viên tiếp nhận mới                                                              |
| note                                                    | String | Ghi chú chuyển trạng thái                                                               |
| updated\_by\_email                                      | String | Email của nhân viên cập nhật trạng thái (mặc định là chủ doanh nghiệp nếu không truyền) |

**Response**

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
    // Thông tin chi tiết ticket được update
}
```

{% endtab %}
{% endtabs %}

## Lấy danh sách chủ đề phiếu ghi

<mark style="color:blue;">`GET`</mark> `/api/ticket/category/get_all`

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
    "status_code": 9999,
    "instance_id": "stg",
    "instance_version": "1.2.163",
    "payload": [
        {
            "_id": "6209c98561c1cb163ded2600",
            "created_date": 1644808581632,
            "last_updated_date": 1644808581632,
            "create_by": {
                "user_name": "OMI Hotline",
                "user_id": "6209c98561c1cb163ded25fa",
                "contact_id": null
            },
            "last_update_by": {
                "user_name": "OMI Hotline",
                "user_id": "6209c98561c1cb163ded25fa",
                "contact_id": null
            },
            "is_deleted": false,
            "status_set_id": "6209c98561c1cb163ded25fd",
            "dynamic_attribute_id": "6209c98561c1cb163ded25fe",
            "default_status": 0,
            "tenant_id": "6209c98461c1cb163ded25f7",
            "name": "Công việc",
            "name_unsigned": "Cong viec",
            "is_not_default": true,
            "type_config": null,
            "has_type_config": false,
            "types": [
                {
                    "uuid": "0",
                    "name": "Cá nhân",
                    "name_unsigned": "Ca nhan",
                    "index": 0,
                    "color": null,
                    "is_default": false,
                    "default_data": null,
                    "unit_price": null
                },
                {
                    "uuid": "1",
                    "name": "Tư vấn",
                    "name_unsigned": "Tu van",
                    "index": 1,
                    "color": null,
                    "is_default": false,
                    "default_data": null,
                    "unit_price": null
                },
                {
                    "uuid": "2",
                    "name": "Báo giá",
                    "name_unsigned": "Bao gia",
                    "index": 2,
                    "color": null,
                    "is_default": false,
                    "default_data": null,
                    "unit_price": null
                },
                {
                    "uuid": "3",
                    "name": "Chăm sóc",
                    "name_unsigned": "Cham soc",
                    "index": 3,
                    "color": null,
                    "is_default": false,
                    "default_data": null,
                    "unit_price": null
                }
            ],
            "contact_ids": null,
            "contact_category_ids": null,
            "role_enable": false,
            "has_default_value": true,
            "priority": "medium",
            "modify_priority_allowed": true,
            "modify_assignee_allowed": true,
            "modify_reporter_allowed": true,
            "modify_expire_allowed": true,
            "reopen": null,
            "assignee_contact_id": null,
            "assignee_contact_ids": null,
            "reporter_contact_ids": null,
            "assignee": null,
            "reporters": null,
            "notify_before": 15,
            "notify_before_unit": "minute",
            "notify_type": "web_email",
            "notify_at": null,
            "limit_days": 30,
            "processing_term": 7,
            "duration": null,
            "maximum_time": {
                "unit": "day",
                "value": 30
            },
            "minimum_time": {
                "unit": "hour",
                "value": 6
            },
            "description": null,
            "work_list": [],
            "has_hide_option": false,
            "hide_option": {
                "hide_after": null,
                "hide_after_unit": "day",
                "apply_for_assignee": false,
                "apply_for_reporter": false,
                "apply_for_creator": false,
                "apply_for_other_agent": false
            },
            "payment": null,
            "ticketStatusSet": {
                "_id": "6209c98561c1cb163ded25fd",
                "created_date": 1644808581573,
                "last_updated_date": 1644808581573,
                "create_by": {
                    "user_name": "OMI Hotline",
                    "user_id": "6209c98561c1cb163ded25fa",
                    "contact_id": null
                },
                "last_update_by": null,
                "is_deleted": false,
                "name": "Công việc",
                "name_unsigned": null,
                "tenant_id": "6209c98461c1cb163ded25f7",
                "status": [
                    {
                        "uuid": null,
                        "index": 0,
                        "sort_index": 0,
                        "color": "#4ca750",
                        "name": "Mới tạo",
                        "finish": false
                    },
                    {
                        "uuid": null,
                        "index": 1,
                        "sort_index": 1,
                        "color": "#267aff",
                        "name": "Đang xử lý",
                        "finish": false
                    },
                    {
                        "uuid": null,
                        "index": 2,
                        "sort_index": 2,
                        "color": "#57bfdb",
                        "name": "Từ chối",
                        "finish": false
                    },
                    {
                        "uuid": null,
                        "index": 3,
                        "sort_index": 3,
                        "color": "#2d4563",
                        "name": "Đã hoàn thành",
                        "finish": false
                    },
                    {
                        "uuid": null,
                        "index": 4,
                        "sort_index": 4,
                        "color": "#fea220",
                        "name": "Đóng",
                        "finish": true
                    }
                ],
                "is_not_default": true
            },
            "total": 4
        }
    ],
    "key_enabled": false
}
```

{% endtab %}
{% endtabs %}

## Tương tác ticket

<mark style="color:green;">`POST`</mark> `/api/ticket/log/list?page=&size=`

Danh sách các thay đổi của ticket

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Body**

<table><thead><tr><th width="152.03125">Name</th><th width="127.8125">Type</th><th>Description</th></tr></thead><tbody><tr><td>ticket_id</td><td>string</td><td>Id của ticket</td></tr><tr><td>range_filter</td><td>object</td><td><p>Bộ lọc </p><p>"range_filter": {<br>"from_date": 1759856400000,<br>"to_date": 1759942799999<br>}</p></td></tr><tr><td>keyword</td><td>String</td><td>Từ khoá tìm kiếm</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
    "instance_id": "stg",
    "payload": {
        "items": [
            ... Nội dung tương tác ticket
        ],
        "page_number": 1,
        "page_size": 10,
        "total_items": 1000,
        "total_pages": 100,
        "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
}
```

{% endtab %}
{% endtabs %}

## Tạo ghi chú

<mark style="color:green;">`POST`</mark> `/api/ticket/log/create`

Tạo ghi chú cho ticket

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Body**

<table><thead><tr><th width="140.8046875">Name</th><th width="143.12890625">Type</th><th>Description</th></tr></thead><tbody><tr><td>ticket_id</td><td>string</td><td>Id của ticket</td></tr><tr><td>message</td><td>string</td><td>Nội dung tin nhắn</td></tr><tr><td>created_by_email</td><td>string</td><td>Email của nhân viên tạo ghi chú (mặc định là chủ doanh nghiệp nếu không truyền)</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
    "keyEnabled": false,
    "payload": {
        "_id": "68e82cd354672f6932d4821b",
        "tenant_id": "6209c98461c1cb163ded25f7",
        "created_by": {
            "id": "6209c98561c1cb163ded25fa",
            "name": "Trần Văn Tiến",
            "type": "USER",
            "email": "contact@omicrm.com",
            "ref_id": "6209c98c067f745da47367d1",
            "avatar_url": "6209c98461c1cb163ded25f7/contact_avatar/2023/04/9e950b35-4b26-4d05-976e-405efd01f460.jpg"
        },
        "created_date": 1760046291711,
        "last_updated_date": 1760046291711,
        "is_deleted": false,
        "source": "WEB",
        "ticket_id": "67a30d7dda070e198d38c3ba",
        "message": "<div>Kh&aacute;ch h&agrave;ng hẹn gọi lại sau</div>",
        "action": "reply",
        "embed_files": [],
        "is_proceed": false,
        "has_details": false
    },
    "vertxInstance": null,
    "statusCode": 9999,
    "status_code": 9999
}
```

{% endtab %}
{% endtabs %}

## Chỉnh sửa ghi chú

<mark style="color:green;">`POST`</mark> `/api/ticket/log/update`

Chỉnh sửa ghi chú cho ticket

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Body**

<table><thead><tr><th width="140.8046875">Name</th><th width="143.12890625">Type</th><th>Description</th></tr></thead><tbody><tr><td>log_id<mark style="color:red;">*</mark></td><td>string</td><td>_id của ghi chú có được thông qua API tạo ghi chú hoặc lấy danh sách tương tác phiếu ghi</td></tr><tr><td>message<mark style="color:red;">*</mark></td><td>string</td><td>Nội dung tin nhắn</td></tr><tr><td>updated_by_email</td><td>string</td><td>Email của nhân viên chỉnh sửa ghi chú (mặc định là chủ doanh nghiệp nếu không truyền)</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
    "keyEnabled": false,
    "payload": {
        "_id": "68e82cd354672f6932d4821b",
        "tenant_id": "6209c98461c1cb163ded25f7",
        "created_by": {
            "id": "6209c98561c1cb163ded25fa",
            "name": "Trần Văn Tiến",
            "type": "USER",
            "email": "contact@omicrm.com",
            "ref_id": "6209c98c067f745da47367d1",
            "avatar_url": "6209c98461c1cb163ded25f7/contact_avatar/2023/04/9e950b35-4b26-4d05-976e-405efd01f460.jpg"
        },
        "created_date": 1760046291711,
        "last_updated_date": 1760046291711,
        "is_deleted": false,
        "source": "WEB",
        "ticket_id": "67a30d7dda070e198d38c3ba",
        "message": "<div>Kh&aacute;ch h&agrave;ng hẹn gọi lại sau</div>",
        "action": "reply",
        "embed_files": [],
        "is_proceed": false,
        "has_details": false
    },
    "vertxInstance": null,
    "statusCode": 9999,
    "status_code": 9999
}
```

{% endtab %}
{% endtabs %}

## Xoá ghi chú

<mark style="color:green;">`DELETE`</mark> `/api/ticket/log/delete/:log_id`

Xoá ghi chú phiếu ghi

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Query Parameters**

| Name               | Value                                                                           |
| ------------------ | ------------------------------------------------------------------------------- |
| deleted\_by\_email | Email của nhân viên xoá ghi chú (mặc định là chủ doanh nghiệp nếu không truyền) |

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
    "instance_id": "stg",
    "payload": true, // true nếu xoá thành công
    "instance_version": "1.2.164",
    "key_enabled": false,
    "status_code": 9999
}
```

{% endtab %}
{% endtabs %}

## Báo cáo tổng quan ticket

<mark style="color:green;">`POST`</mark> `/api/ticket/statistics`

Báo cáo tổng quan về ticket

**Headers**

<table><thead><tr><th width="206.01171875">Name</th><th>Value</th></tr></thead><tbody><tr><td>Content-Type</td><td><code>application/json</code></td></tr><tr><td>Authorization</td><td><code>Bearer &#x3C;token></code></td></tr></tbody></table>

**Body**

<table><thead><tr><th width="209.4921875">Name</th><th width="136.5">Type</th><th>Description</th></tr></thead><tbody><tr><td>from_date</td><td>number</td><td>Từ ngày</td></tr><tr><td>to_date</td><td>number</td><td>Đến ngày</td></tr><tr><td>assignee_contact_ids</td><td>List</td><td>Id nhân viên</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
    "keyEnabled": false,
    "payload": {
        "general": {
            "total_reopen": 0.0,
            "total_ticket": 0,
            "total_expired": 0.0,
            "total_on_schedule": 0.0,
            "total_behind_schedule": 0.0,
            "total_end_state": 0.0,
            "total_change_status": 0.0,
            "total_close": 0.0,
            "total_active_state": 0.0
        },
        "group_by_date": [],
        "list_total_ticket": [],
        "list_active_state": [],
        "list_end_state": [],
        "list_on_schedule": [],
        "list_behind_schedule": [],
        "list_expired": [],
        "list_finish": []
    },
    "vertxInstance": null,
    "statusCode": 9999,
    "status_code": 9999
}
```

{% endtab %}
{% endtabs %}

## Bộ tiêu chí đánh giá ticket

<mark style="color:green;">`GET`</mark> `/api/ticket/evaluation_criteria/get_all`

Danh sách bộ tiêu chí đánh giá

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
    "instance_id": "stg",
    "payload": {
        "items": [
            {
                "created_date": 1759907691998,
                "last_updated_date": 1759907691998,
                "_id": "68e60f6b09111713ccb91d5b",
                "last_update_by": null,
                "is_deleted": false,
                "tenant_id": "6209c98461c1cb163ded25f7",
                "name": "Khả năng hỗ trợ",
                "name_unsigned": "kha nang ho tro",
                "scopes": [
                    "ticket"
                ],
                "contact_ids": [],
                "contact_category_ids": []
            },
            {
                "created_date": 1759907547436,
                "last_updated_date": 1759907547436,
                "_id": "68e60edbccb1722434276c1e",
                "last_update_by": null,
                "is_deleted": false,
                "tenant_id": "6209c98461c1cb163ded25f7",
                "name": "Chất lượng chăm sóc",
                "name_unsigned": "chat luong cham soc",
                "scopes": [
                    "ticket"
                ],
                "contact_ids": [],
                "contact_category_ids": []
            }
        ],
        "page_number": 1,
        "page_size": 10,
        "total_items": 2,
        "total_pages": 1,
        "has_next": false,
        "next_page": 1,
        "has_previous": false,
        "previous_page": 1,
        "extension": null
    },
    "instance_version": "1.2.164",
    "key_enabled": false,
    "status_code": 9999
}
```

{% endtab %}
{% endtabs %}

## Đánh giá phiếu ghi

<mark style="color:green;">`POST`</mark> `/api/ticket/evaluation/create`

Đánh giá phiếu ghi

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Body**

<table><thead><tr><th width="115.984375">Name</th><th width="166.4765625">Type</th><th>Description</th></tr></thead><tbody><tr><td>ticket_id</td><td>String</td><td>Id ticket</td></tr><tr><td>values</td><td>Array Object</td><td><p>Mảng tiêu chí đánh giá + thang điểm </p><p>"values": [<br>{<br>"criteria_id": "67170d615aeef678f673c715",<br>"name": "Chất lượng phiếu ghi",<br>"point": 4 // 1-5<br>}<br>]</p></td></tr><tr><td>comment</td><td>String</td><td>Ghi chú</td></tr><tr><td>created_by_email</td><td>String</td><td>Email của nhân viên tạo đánh giá (mặc định là chủ doanh nghiệp nếu không truyền)</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
    "keyEnabled": false,
    "payload": {
        "target": {
            "created_date": 1760046066582,
            "is_deleted": false,
            "_id": "68e82bf21aa88048c2c7e579",
            "tenant_id": "6209c98461c1cb163ded25f7",
            "ticket_id": "67a30d7dda070e198d38c3ba",
            "point": 2.5,
            "values": [
                {
                    "name": "Khả năng hỗ trợ",
                    "point": 4.0,
                    "criteria_id": "68e60f6b09111713ccb91d5b"
                },
                {
                    "name": "Chất lượng chăm sóc",
                    "point": 5.0,
                    "criteria_id": "68e60edbccb1722434276c1e"
                }
            ],
            "comment": "Good"
        },
        "_id": "68e82bf21aa88048c2c7e57d",
        "tenant_id": "6209c98461c1cb163ded25f7",
        "created_by": {
            "id": "6209c98561c1cb163ded25fa",
            "name": "Trần Văn Tiến",
            "type": "USER",
            "ref_id": "6209c98c067f745da47367d1"
        },
        "last_updated_by": {
            "id": "6209c98561c1cb163ded25fa",
            "name": "Trần Văn Tiến",
            "type": "USER",
            "ref_id": "6209c98c067f745da47367d1"
        },
        "created_date": 1760046066582,
        "last_updated_date": 1760046066582,
        "is_deleted": false,
        "source": "WEB",
        "ticket_id": "67a30d7dda070e198d38c3ba",
        "message": "Good",
        "action": "evaluation",
        "target_type": "evaluation",
        "target_value": "68e82bf21aa88048c2c7e579",
        "embed_files": [],
        "is_proceed": false,
        "has_details": false
    },
    "vertxInstance": null,
    "statusCode": 9999,
    "status_code": 9999
}
```

{% endtab %}
{% endtabs %}

## Chuyển đổi nhân viên phụ trách phiếu ghi

<mark style="color:green;">`POST`</mark> `[URL]/api/v3/agent/ticket/transfer`&#x20;

Chuyển toàn bộ phiếu ghi trong vòng 6 tháng gần nhất do nhân viên gốc phụ trách hoặc có liên quan đến nhân viên gốc sang cho nhân viên mới

#### Headers

| Name      | Type   | Description |
| --------- | ------ | ----------- |
| x-api-key | String | API Key     |

#### Request Body

<table><thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>sourceEmail<mark style="color:red;">*</mark></td><td>String</td><td>Email nhân viên gốc</td></tr><tr><td>targetEmail<mark style="color:red;">*</mark></td><td>String</td><td>Email nhân viên mới</td></tr><tr><td>previewChanges</td><td>Boolean</td><td><ul><li>true: Xem trước số lượng phiếu ghi sẽ bị thay đổi sau cập nhật (không khởi tạo tiến trình cập nhật) </li><li>false (mặc định): Khởi tạo tiến trình cập nhật</li></ul></td></tr><tr><td>callbackResultConfig</td><td>Object</td><td><p>Thông tin hook nhận kết quả sau khi hoàn tất tiến trình:</p><ul><li>url: url nhận hook</li><li>headers (optional): danh sách headers muốn gửi kèm khi nhận hook</li></ul><pre class="language-json"><code class="lang-json">{
    "url": "https://...",
    "headers": {
        "key1": "value1"
    }
}
</code></pre></td></tr></tbody></table>

{% tabs %}
{% tab title="202 Khởi tạo tiến trình thành công " %}

```json
{
    "instance_id": "stg",
    "payload": {
        "requestId": "270ea881-a6e1-44fb-9400-a89eb4ceab4b" // unique request id, trả về kèm theo webhook nếu có khai báo "callbackResultConfig"
    },
    "instance_version": "1.2.164",
    "key_enabled": false,
    "status_code": 9999
}
```

{% endtab %}

{% tab title="Webhook" %}

```json
{
  "requestId": "270ea881-a6e1-44fb-9400-a89eb4ceab4b", // unique request id
  "requestTimeMs": 1769163675593, // thời gian request
  "action": "TICKET_AGENT_TRANSFER", // loại tiến trình
  "status": "SUCCESS", // trạng thái SUCCESS/ERROR
  "responseTimeMs": 1769163675890, // thời gian kết thúc
  "payload": {
    "updatedRecords": 8 // Số lượng record được cập nhật
  }
}
```

{% endtab %}
{% endtabs %}


# Tổng quan

Hook là tính năng mà OmiCall xây dựng, để gửi thông tin từ OmiCall sang cho đối tác tích hợp một cách tự động, theo phương thức mà đối tác định nghĩa

## Thông tin kết nối

Chuẩn bị:

* Đăng ký tài khoản [https://sso.omicall.io/](https://sso.omicrm.com/)
* Truy cập **Cấu hình > Doanh nghiệp >> Tích hợp > WEBHOOK**
* Cung cấp URL để lấy thông tin OmiCall gửi (url bắt buộc phải **https**)

![](https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2F0OhCmfDDSO00MPhwwOko%2FScreen%20Shot%202022-07-19%20at%2010.11.30%20PM.png?alt=media\&token=6b8d37d9-6859-4dcf-a8eb-ed3e91b903c6)


# Webhook

Webhook cuộc gọi

## Nhận dữ liệu cuộc gọi từ Webhook

* Đối tác khai báo API để nhận dữ liệu cuộc gọi từ WEBHOOK trả về
* ***METHOD : POST***
* ***Content-type : application/json***

{% hint style="info" %}
**Webhook data khi cuộc gọi đã kết thúc**
{% endhint %}

Truy cậu cấu hình tại :&#x20;

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2F7HpBckIrHke7yN7ju6wz%2FUntitled.jpg?alt=media&amp;token=35e7c32a-c941-4b63-a642-af2f78db4f4b" alt=""><figcaption></figcaption></figure>

```

{
  "answer_sec": 39, // Số giây trả lời. Dùng để nhận dạng cuộc gọi Trả lời/ Không trả lời (Bao gồm gọi thường và gọi tự động)
  "bill_sec": 41, // Số giây tính tiền
  "bill_sec_forward_out": 0, // Số giây chuyển tiếp 
  "call_out_price": 699.05, // Cước cuộc gọi
  "call_uuid": "ad97a435-659e-49b4-ae83-4484c.....", // Id cuộc gọi
  "autocall_id": "...", // id phiên autocall
  "autocall_uuid: "...", // id data trong phiên autocall
  "create_by": { // Thông tin nhân viên
    "contact_id": "63857253b1fd5112977dfade",
    "id": "63857254b1fd5112977dfadf",
    "name": "Thùy Nhân",
    "type": "agent"
  },
  "callbot_script_id": "69e1f0d6b3c47c16317126d3",
  "call_bot_script_detail": {
    "call_bot_script_name": "Callbot âm thanh",
    "uuid": "e3999a89-0c2e-40ca-b34e-c235f27dc67e",
    "verify_type": "none",
    "version": 2
  },
  "collect_info_variables": // CallBot : Thông tin mảng biến thu thập
   [
    {
      "collect_info_executed_time": {
        "end": 17.440811157226562,
        "start": 13.95820426940918
      },
      "entire_user_sentence": "tầm 2 giờ chiều nhá",
      "entity_type_code": "omi_entity_datetime",
      "variable_code": "AeMd2JtJ7O",
      "variable_name": "new_ship_time",
      "variable_value": "02:00"
    }
  ],
  "users_status": [
    {
      "answer_at": 1748832946,
      "auto_answer": false,
      "call_uuid": "602d98ab-a577-4297-a285-7d71aed06171",
      "extension": "100",
      "group_index": 0,
      "group_number": "62714",
      "is_busy": false,
      "is_dnd": false,
      "is_online": true,
      "ring_at": 1748832941,
      "timeout": 30
    }
  ],
  "created_date": 1748310220317, //Ngày tạo record json
  "destination_number": "0966....", // Thuê bao bị gọi (Callee)
  "direction": "outbound", // Hướng gọi. Gọi ra (outbound). Gọi vào (inbound). Gọi nội bộ (local) 
  "domain_fusion": "vihat", // Domain tổng đài doanh nghiệp
  "duration": 44, //Số giây giây khởi tạo cuộc gọi
  "endby_name": "end_call_by_customer", //Hình thức kết thúc
  "from_number": "2022", // Thuê bao người gọi (Caller)
  "hangup_cause": "NORMAL_CLEARING", //Mã HANGUP
  "hangup_cause_q850": 16,
  "hotline": "02873022488", //Hotline
  "is_auto_call": false, // Gọi thủ công (false) / Gọi tự động (true)
  "is_callbot": false, // true nếu cuộc gọi callbot 
  "is_have_forward_out": false, // Cuộc gọi có chuyển tiếp ra SIM (true). Không chuyển tiếp ra SIM (false) 
  "is_same_network": false, // Nội mạng (true) / Ngoại mạng (false)
  "is_same_network_forward_out": false, // Cuộc gọi chuyển tiếp ra SIM cùng mạng (true). Ra SIM ngoại mạng (false). So sánh giữa Hotline và SIM được chuyển)
  "is_voicemail": false, // Cuộc gọi có hộp thư thoại (true). Không có hộp thư thoại (false)
  "ivr": "none",// Cuộc gọi có bấm phím 
  "note": "",// Ghi chú về cuộc gọi 
  "out_of_working_time": false, // Ngoài giờ làm việc (true). Trong giờ làm việc (false)
  "phone_number": "096606....", // Số điện thoại khách hàng
  "provider": "viettel", // Nhà mạng của khách hàng
  "provider_of_number": "fpt", // Nhà mạng của số Hotline
  "record_seconds": 39, // Số giây ghi âm cuộc gọi. Chỉ ghi nhận với những cuộc >3 giây đàm thoại
  "recording_file_url": "https://public-v1-stg.omicrm.com/......", // URL file ghi âm
  "send_num_retry": 1, // Số lần gửi cho đối tác 
  "sip_number": "02873022488", // Hotline 
  "sip_number_tags": [], // Tags phân loại của Hotline, hỗ trợ cho doanh nghiệp phân loại Hotline theo pháp nhân đứng tên
  "sip_user": "2022", // Định danh người gọi (Caller) 
  "source_number": "02873022488", // Định danh thuê bao gọi (Caller) 
  "state": "cdr", // Trạng thái cuộc gọi 
  "tag": [], //Danh sách Tags cuộc gọi đính kèm
  "tenant_id": "5cbfc17a580dd80007ffc....", // Id doanh nghiệp
  "time_start_call": 1776849067, // Thời gian bắt đầu cuộc gọi
  "time_answer_start": 1776849073, // Thời gian bắt đầu trả lời
  "time_end_call": 1776849079, // Thời gian kết thúc cuộc gọi
  "time_ringing_start": 1776849073, // Thời gian bắt đầu đổ chuông cho nhân viên
  "to_number": "09660....",
  "transaction_id": "ad97a435-659e-49b4-ae83-4484.....",
  "transfer_histories": [], // Lịch sử chuyển tiếp cuộc gọi
  "classifies": [
            {
              "name": "Khách từ chối",
              "previous_staff_node_id": "ILwHGUvlz5"
            }
          ],
  "user": [ //Danh sách nhân viên có tương tác với cuộc gọi
    {
      "full_name": "Thùy Nhân - Admin CS",
      "full_name_unsigned": "Thuy Nhan - Admin CS"
    }
  
  ],
   "call_stacks": [
             {
                "from": "0909689867", // Vị trí khởi tạo của leg call (stack)
                "to": "70759-118", //Nhân viên thuộc nhóm nội bộ
                "phone_number": "0909689867", //Số điện thoại khách hàng
                "type": "criteria-script", //Tiêu chí
                "at": 1757408394, //Thời điểm cuộc gọi đi vào nhánh
                "ringing_at": 1757408394, //Thời điểm cuộc gọi bắt đầu ring đến user
                "answer_at": 1757408400, //Thời điểm user bắt máy
                "bye_at": 1757408408, //Thời điểm kết thúc nhánh (stack)
                "index": 1,
                "is_answer": true, //Trạng thái trả lời
                "is_online": true, //Trạng thái trực tuyến
                "is_busy": false, //Trạng thái bận (user đang trong cuộc gọi khác)
                "is_dnd": false, //Trạng thái không làm phiền
                "timeout": 30
            },
}
```

**Một vài biến JSON quan trọng cần lưu ý lúc tích hợp**

<table><thead><tr><th width="186.93359375">Field</th><th width="106.2890625">Type</th><th>Description</th></tr></thead><tbody><tr><td>transaction_id</td><td>String</td><td><strong>Là Id cuộc gọi</strong>. OMI có thể sẽ bắn nhiều lần cho đối tác, do cuộc gọi có thể chuyển tiếp ra nhiều lớp trong kịch bản. Và đối tác cần Get Update lại dữ liệu. Vì Id cuộc gọi là duy nhất</td></tr><tr><td>create_by</td><td>Object</td><td><strong>Nhân viên chịu trách nhiệm</strong> về cuộc gọi. <br>Trường hợp <strong>create_by.name = 'create_default_by_tenant'</strong> được dùng để định danh cuộc gọi <strong>KHÔNG XÁC ĐỊNH, KHÔNG KẾT NỐI</strong> tới nhân viên</td></tr><tr><td>direction</td><td>String</td><td><strong>Hướng gọi</strong> : <br>outbound : Gọi ra<br>inbound : Gọi vào<br>local : Gọi nội bộ (2 nhân viên với nhau)</td></tr><tr><td>answer_sec</td><td>Number</td><td>Là số giây để nhận dạng cuộc gọi <strong>TRẢ LỜI (answer_sec >0) hoặc KHÔNG TRẢ LỜI (answer_sec=0)</strong></td></tr><tr><td>time_start_call</td><td>Number</td><td><strong>Là thời gian khởi tạo cuộc gọi</strong> (x 1000 = Unix time milisecond)</td></tr><tr><td>time_end_call</td><td>Number</td><td><strong>Là thời gian kết thúc cuộc</strong> (x 1000 = Unix time milisecond)</td></tr><tr><td>time_answer_start</td><td>Number</td><td><strong>Là thời gian bắt đầu trả lời</strong>  (x 1000 = Unix time milisecond)</td></tr><tr><td>time_ringing_start</td><td>Number</td><td><strong>Là thời gian bắt đầu đổ chuông cho nhân viên</strong> (x 1000 = Unix time milisecond)</td></tr><tr><td>phone_number</td><td>String</td><td>Số điện thoại khách hàng</td></tr><tr><td>hotline</td><td>String</td><td>Số Hotline</td></tr><tr><td>bill_sec</td><td>Number</td><td>Số giây tính tiền (hay Thời Lượng Cuộc Gọi)</td></tr><tr><td>duration</td><td>Number</td><td>Là số giây được tính từ lúc : Khởi tạo cuộc gọi -> Kết thúc</td></tr><tr><td>note</td><td>String</td><td>Ghi chú về cuộc gọi</td></tr><tr><td>tags</td><td>List</td><td>Danh sách Tags được đính kèm với cuộc gọi</td></tr><tr><td>sip_user</td><td>String</td><td>Là số máy lẻ của nhân viên, chịu trách nhiệm về cuộc gọi</td></tr><tr><td>recording_file_url</td><td>String</td><td><strong>Đường dẫn file ghi âm</strong></td></tr><tr><td>record_seconds</td><td>Number</td><td>Số giây ghi âm</td></tr><tr><td>user_status</td><td>List</td><td>Mảng trạng thái của nhân viên, khi có cuộc gọi đi qua</td></tr><tr><td>is_callbot</td><td>Boolean</td><td>True nếu là cuộc gọi callbot</td></tr><tr><td>callbot_script_id</td><td>String</td><td>Id kịch bản callbot</td></tr><tr><td>call_bot_script_detail</td><td>Object</td><td>Thông tin chi tiết kịch bản callbot:<br>- call_bot_script_name: tên kịch bản</td></tr><tr><td>collect_info_variables</td><td>List</td><td><p>Danh sách biến thu thập, mỗi phần tử có cấu trúc:</p><pre class="language-json"><code class="lang-json">{
    "collect_info_executed_time": {
      "end": 17.440811157226562,
      "start": 13.95820426940918
    },
    "entire_user_sentence": "tầm 2 giờ chiều nhá",
    "entity_type_code": "omi_entity_datetime",
    "variable_code": "AeMd2JtJ7O",
    "variable_name": "new_ship_time",
    "variable_value": "02:00"
}
</code></pre></td></tr></tbody></table>

Danh sách thuộc tính mảng **user\_status**

<table><thead><tr><th width="186.45703125">Field</th><th width="106.5078125">Type</th><th>Description</th></tr></thead><tbody><tr><td>extension</td><td>String</td><td>Số máy lẻ nhân viên</td></tr><tr><td>is_busy</td><td>Boolean</td><td>Nhân viên có đang bận (true), không bận (false)</td></tr><tr><td>is_dnd</td><td>Boolean</td><td>Nhân viên có đang ở trạng thái không làm phiền (true), Sẵn sàng (false)</td></tr><tr><td>is_online</td><td>Boolean</td><td>Nhân viên có đang trực tuyến (true), không trực tuyến (false)</td></tr><tr><td>group_number</td><td>String</td><td>Nhóm nội bộ (id hàng đợi)</td></tr><tr><td>ring_at</td><td>Number</td><td>Thời gian bắt đầu rung chuông ở nhân viên</td></tr><tr><td>answer_at</td><td>Number</td><td>Thời gian bắt đầu nhân viên trả lời</td></tr><tr><td>timeout</td><td>Number</td><td>Thời gian TimeOut của nhóm</td></tr><tr><td>auto_answer</td><td>Boolean</td><td>Hàng đợi bật trạng thái đếm giây(true)., không bật (false)</td></tr></tbody></table>

{% hint style="info" %}
**Webhook khi cuộc gọi đang diễn ra**
{% endhint %}

* Gửi thông tin cuộc gọi đang diễn ra cho đối tác tích hợp
* **Trạng thái gồm : create (**&#x4B;hởi tạ&#x6F;**), early (**&#x43;huẩn bị đổ chuôn&#x67;**), ringing**(Đổ chuông)**, answered** (Kết nối) , **hangup** (Kết thúc)

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FNmYsmhNbOGDp0LmF3LDe%2FScreenshot%202025-06-09%20at%209.08.20%E2%80%AFAM.png?alt=media&amp;token=962f06e7-f3dc-4944-bcfa-fb24e82098a1" alt=""><figcaption></figcaption></figure>

**Cấu trúc JSON Event Gọi Ra**

```
{
  "to_number": "0966060...", // Thuê bao người bị gọi (Callee), Số điện thoại khách hàng
  "created_time": 1748310171450, // Thời gian tạo dữ liệu json
  "extension": "2022", // Số máy lẻ nhân viên 
  "unique_id": "c5885d6d-3fb1-4393-9e1e-8b325b771191", // Id Event
  "hotline": "02873022488", // Số hotline
  "source": "webhookEvent", // Loại Webhook 
  "date_time": 1748310172296, // Thời gian gửi dữ liệu json cho đối tác 
  "from_number": "2022", // Thuê bao người gọi (Caller)
  "call_uuid": "ad97a435-659e-49b4-ae83-4484c0c3f4c6", // Id cuộc gọi
  "phone_number": "0966060...", // Số điện thoại khách hàng 
  "state": "ringing", // Trạng thái cuộc gọi
  "device": "OmiWebV2-eb2cc7f4afbd/ Chrome/ 136.0.0.0/ Windows NT 10.0; Win64; x64", // Thiết bị của Caller 
  "event_time": 1748310172250, // Thời gian khởi tao của Event
  "direction": "outbound" // Hướng gọi ,
  "event_name":""
}
```

Cấu trúc JSON Event Gọi Vào

```
{
  "to_number": "33659",// Thuê bao người bị gọi (Callee), Số máy lẻ nhân viên
  "created_time": 1748312242480, // Thời gian khởi tạo JSON
  "extension": "33659", // Số máy lẻ nhân viên
  "unique_id": "55638ccf-d18e-4246-9543-ddce371e0f9f", // Id Event
  "hotline": "842871010898", // Số hotline
  "source": "webhookEvent", // Loại Webhook 
  "date_time": 1748312314530, // Thời gian gửi JSON cho đối tác
  "from_number": "0906022...", // Thuê bao người gọi (Caller), thuê bao khách hàng
  "call_uuid": "55638ccf-d18e-4246-9543-ddce371e0f9f", // Id cuộc gọi
  "phone_number": "0906022...", // Số điện thoại khách hàng
  "state": "ringing", // Trạng thái cuộc gọi
  "device": "VOS3000 V2.1.9.07", // Thiết bị 
  "event_time": 1748312314480, //Thời gian khởi tạo Event
  "direction": "inbound" // Hướng gọi 
}
```

Một vài chú ý với Webhook Event

* Một cuộc gọi sẽ có 2 Leg (Leg Khách hàng , Leg Nhân viên)
* Webhook Event hỗ trợ việc callback data json, trạng thái **trên mỗi Leg** cho đối tác
* Nếu một cuộc gọi thành công, có kết nối máy với khách hàng, có trả lời  sẽ có 3 trạng thái : **ringing (Rung chuông)**, **answered (Trả lời) , hangup (Kết thúc)**
* **Một vài chú ý khi gọi vào (Inbound)**
  * &#x20;Nếu cuộc gọi đổ vào hệ thống sẽ đi qua nhiều kịch bản mà doanh nghiệp setup
  * **to\_number** có thể là các giá trị&#x20;
    * Giá trị rỗng (empty)&#x20;
      * Kịch bản chỉ phát lời chào
      * Kịch bản kết thúc không hành động,&#x20;
      * Kịch bản hộp thư thoại
      * Cuộc gọi khởi tạo thành công xuống máy nhân viên, **nhưng không nhận được phản hồi từ nhân viên** (Do thiết bị không online, thiết bị có vấn đề)
    * Số định danh của nhóm hàng đợi nếu cuộc gọi đi vào NHÓM NỘI BỘ&#x20;
    * Số định danh của kịch bản phím bấm khi cuộc gọi vào KỊCH BẢN BẤM PHÍM
    * Số định danh máy nhánh của nhân viên khi cuộc gọi vào NHÂN VIÊN (EXTENSION)
    * Số định danh của nhóm ngoài khi cuộc gọi đổ ra NHÓM NGOÀI
* **from\_number**, **to\_number** : Là giá trị định danh của người gọi và người bị gọi cho 2 hướng, gọi ra và gọi vào. from\_number và to\_number chỉ có giá trị khi có tín hiệu được khởi tạo trên mỗi Leg
  * Nếu gọi ra  (outbound)
    * **from\_number**: Số máy nhánh nhân viên
    * **to\_number**: Số điện thoại khách hàng
  * Nếu gọi vào đổ tới nhân viên (inbound)

    * **from\_number** : Số điện thoại khách hàng
    * **to\_number** : Số máy nhánh nhân viên


# Web Extension

Bring all VoIP call features from OMICall to any website you want

Cài đặt vào sử dụng Extenion của OMICall tại:\
\- Chrome: <https://chromewebstore.google.com/detail/omicall/jgchhfnlndmpdhbnfkefcijegmjobieo>\
\- Firefox: <https://addons.mozilla.org/en-US/firefox/addon/omicall/>\
\- Edge: [ https://microsoftedge.microsoft.com/addons.....](https://microsoftedge.microsoft.com/addons/detail/omicall/mlkcipjmjfacmkoclchmhjjafnikdnhd)

## Giới thiệu

* Sử dụng [Web SDK v3](/sdk/web-sdk/v3-integration) dành cho trình duyệt của OMICall, áp dụng mọi công nghệ mới nhất và hầu hết tính năng hiện có của OMICall SaaS, đem lại hiệu năng và chất lượng cuộc gọi tốt nhất
* Tích hợp Click-2-Call chuyên sâu cho hầu hết CRM phổ biến
* Thao các cấu hình đơn giản để sử dụng tại bất cứ trang web nào

## Screenshots

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2Fj97yAk5QH9JWDMMbQoZv%2Fimage.png?alt=media&amp;token=3114f851-e044-49fb-a79d-49edcec6e6a3" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2F8CBABuJ1gt8CS25W3J2u%2Fimage.png?alt=media&amp;token=1fae5e32-bc72-4652-bc79-00cc629ee373" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FHkTudBIxhGVYVbvHupLf%2Fscreenshot-3.png?alt=media&amp;token=3e517715-4788-449c-8e8a-9f4236b8c211" alt=""><figcaption></figcaption></figure>

## Click-2-Call

List of supported click-2-call button on thirtparty websites/CRM

* [x] Pancake: [Details](/sdk/web-extension/pancake) - [Homepage](https://pancake.vn/)
* [x] Sapo: [Details](/sdk/web-extension/sapo) - [Homepage](https://sapo.vn/)
* [x] Haravan: [Details](/sdk/web-extension/haravan) - [Homepage](https://haravan.com/)
* [x] Nhanh.vn: [Details](/sdk/web-extension/nhanh.vn) - [Homepage](https://nhanh.vn/)
* [x] TPos.vn: [Details](/sdk/web-extension/tpos.vn) - [Homepage](https://tpos.vn/)
* [x] KiotViet: [Details](/sdk/web-extension/kiotviet) - [Homepage](https://www.kiotviet.vn/)
* [x] Bitrix24: [Details](/sdk/web-extension/bitrix24) - [Homepage](https://www.bitrix24.vn/)
* [x] HubSpot: [Homepage](https://www.hubspot.com/)
* [ ] MISA: [Homepage](https://www.misa.vn/)
* [ ] CrmViet: [Homepage](https://crmviet.vn/)
* [ ] ... and more


# Changelog

## 2.0.37 (2026-01-13)

* Fix issues for dynamic `WSS URI` of different nation
* Update dependency to `OMICallSDK@3.0.40`

## 2.0.36 (2026-01-12)

* Fix issues for new nation `la` and `ht`
* Update dependency to `OMICallSDK@3.0.39`

## 2.0.35 (2026-01-09)

* Allow to have Click-2-Call for `Pancake` in worldwide

## 2.0.34 (2026-01-07)

* Allow to have Click-2-Call for `Pancake` in worldwide

## 2.0.33 (2025-09-11)

* Support custom fields Click-to-Call for `hubspot`
* Support Click-to-Call for `Salesforce`

## 2.0.32 (2025-08-29)

* Hotfix Click-2-Call for `Pancake`
* Update dependency to `OMICallSDK@3.0.33`

## 2.0.31 (2025-07-08)

* Support show nation code (+84) for call dialog

## 2.0.30 (2025-07-08)

* Update dependency to `OMICallSDK@3.0.29`

## 2.0.29 (2025-07-07)

* Update dependency to `OMICallSDK@3.0.29`

## 2.0.28 (2025-06-28)

* Update dependency to `OMICallSDK@3.0.28`
* Support priority searching `contact` from `hubspot` and show CTA button to view detail contact in dialog call

## 2.0.27 (2025-06-18)

* Correct reject call event `statusCode`

## 2.0.26 (2025-06-10)

* Update dependency to `OMICallSDK@3.0.27`

## 2.0.25 (2025-06-09)

* Update dependency to `OMICallSDK@3.0.26`
* Support Click-2-Call for `hubspot.com`

## 2.0.24 (2025-03-25)

* Support Click-2-Call for `bitrix24` domain globally

## 2.0.23 (2025-03-07)

* Update dependency to `OMICallSDK@3.0.17`
* Add `utm_source` params for all api request

## 2.0.22 (2025-02-25)

* Update dependency to `OMICallSDK@3.0.16`
* Fix issues import script for `tpos.vn`

## 2.0.21 (2024-12-16)

* Update Click-2-Call completely for `bitrix24.vn`

## 2.0.20 (2024-11-09)

* Update Click-2-Call completely for `kiotviet.vn`: Retail, Fnd, Salon, Hotel

## 2.0.19 (2024-11-04)

* Update dependency to `OMICallSDK@3.0.15`
* Support Click-2-Call completely for `kiotviet.vn`
* Fix setting domains order and add reset to default button

## 2.0.18 (2024-11-18)

* Support Click-2-Call completely for `tpos.vn`

## 2.0.17 (2024-11-08)

* Update dependency to `OMICallSDK@3.0.13`
* Support Click-2-Call completely for `nhanh.vn` (OLD UI)

## 2.0.16 (2024-10-15)

* Update dependency to `OMICallSDK@3.0.12`
* Fix some issues and adding more Click-2-Call supported pages for `Pancake`

## 2.0.15 (2024-10-12)

* Keep domains setting by correct order
* Support Click-2-Call completely for `Haravan`

## 2.0.14 (2024-10-08)

* `OMICallSDK@3.0.11`
* Fix issues when change phone number column position in `Sapo`
* Support Click-2-Call for `Sapo Web` and `Sapo POS` and `Sapo FNB`

## 2.0.13 (2024-10-02)

* `OMICallSDK@3.0.10`
* Show warning and prevent call if already having a call in other tab of browser
* Allow to manualy request Click-2-Call from injected website: `postMessage({ action: 'OMI_CLICK_2_CALL', data: phoneNumber });`

## 2.0.12 (2024-08-02)

* Optimize and update to support Click-2-Call in full pages of `Pancake`
* Support Click-2-Call for `Sapo Omni` and `Sapo Loyalty`

## 2.0.10 (2024-07-29)

* `OMICallSDK@3.0.8`
* Support setting option to not showing dial dialog toggle button
* Support Click-2-Call for Pancake POS and Pancake CRM

## 2.0.9 (2024-07-25)

#### Update

* `OMICallSDK@3.0.7`
* Add video call status text for internal call

#### Fix

* Fix issues not using correct position of domain settings
* Fix breaking toast's CSS in domain facebook

## 2.0.8 (2024-07-25)

#### Fix

* Fix issues load new domain settings config

## 2.0.7 (2024-07-24)

#### Fix

* Fix issues missing check null settings after first time install

## 2.0.6 (2024-07-22)

#### Update

* Add new settings page

#### Fix

* Fix bug can't login with user have only one tenant

## 2.0.5 (2024-07-22)

#### Update

* `OMICallSDK@3.0.6`
* Support Zalo Cloud Connect (ZCC) call feature
* Add validate call settings with features of package

#### Fix

* Fix some issues of auto close and save call
* Fix not prevent to open dial dialog when setting offline

## 2.0.4 (2024-07-18)

#### Update

* `OMICallSDK@3.0.4`
* Support show Outer Group
* Move code init sound and notification permission to after register success
* Apply config ringtone and alert sound
* Apply config auto open call form when call accepted or declined
* Apply config auto close call dialog

#### Fix

* Still validate SIP number when make internal call
* Duplicate call event ended when call had been reject

## 2.0.3 (2024-07-18)

* `OMICallSDK@3.0.3`
* Support video call feature

## 2.0.2 (2024-07-18)

#### Update

* `OMICallSDK@3.0.2`
* Support minimize call dialog feature
* Update call dialog draggable anchor to full of container
* Update more anchor to re-index focused call dialog

#### Fix

* Improve and fixing some issues

## 2.0.1 (2024-07-17)

#### Update

* `OMICallSDK@3.0.1`
* Support for Firefox

## 2.0.0 (2024-07-16)

* `OMICallSDK@3.0.0`
* Release first pre-prod version


# Pancake

Các vị trí hỗ trợ hiển thị nút gọi nhanh Click-2-Call

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FaRIYbzOTEcvdtoNB3ta8%2FScreenshot%202026-01-16%20at%209.24.15%E2%80%AFAM.png?alt=media&amp;token=1d6f9b90-4ee2-482e-8147-7cdeaf71f4ce" alt=""><figcaption><p>Cấu hình cho extension</p></figcaption></figure>

```
pancake.vn,pancake.fm,pages.fm
```

## Pancake CRM

* [x] Công việc của tôi - Hẹn gọi
* [x] Công việc của tôi - Popup hẹn gọi
* [x] Công việc của tôi - Theo dõi
* [x] Danh sách khách hàng
* [x] Danh sách lịch hẹn
* [x] Danh sách đơn hàng
* [x] Danh sách đơn hàng - Popup chi tiết
* [x] Danh sách tuỳ chỉnh

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FtXvXP2zOEZK51gwsBP70%2Fcrm_order_list.png?alt=media&amp;token=efe73931-8106-47aa-8dee-3a6c939213ae" alt=""><figcaption><p>CRM - Danh sách đơn hàng</p></figcaption></figure>

<div><figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FA0BRBhxvT8Z7yCdMjLgG%2Fcrm_reminder_list.png?alt=media&amp;token=78cf0966-93d5-4879-af6a-05df69586aee" alt=""><figcaption><p>Công việc của tôi - Hẹn gọi</p></figcaption></figure> <figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FpNddT4eV8VWbCluSfwTI%2Fcrm_reminder_popup.png?alt=media&amp;token=fc57c4d8-3345-435b-a3b7-94aa72bd51d7" alt=""><figcaption><p>Công việc của tôi - Popup hẹn gọi</p></figcaption></figure></div>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FLs0Ca0VpFCfG9XAfNRQl%2Fcrm_flowup_list.png?alt=media&amp;token=655776ce-cbfb-40af-bb1a-9f14ce7cdcc0" alt=""><figcaption><p>Công việc của tôi - Theo dõi</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FAqYQKfVgK16M1oVgAzVU%2Fcrm_customer_list.png?alt=media&amp;token=1ba41294-63a3-45f2-b24a-652dea9b3262" alt=""><figcaption><p>Danh sách khách hàng</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FKdRvPGN2Z1nITU9sa34x%2Fcrm_calendar_list.png?alt=media&amp;token=6dc18008-402f-40e6-9b46-c31715647a44" alt=""><figcaption><p>Danh sách lịch hẹn</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FepC8d9N8MzlnLz7F5J6S%2Fcrm_order_list.png?alt=media&amp;token=0a1ab1d5-4ff9-48e6-8131-707a6d335d00" alt=""><figcaption><p>Danh sách đơn hàng</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2Fqi2jwknWuvi44wqbI0RS%2Fcrm_order_popup_2_detail.png?alt=media&amp;token=60af73a3-421e-4787-a518-da4b814edeeb" alt=""><figcaption><p>Danh sách đơn hàng - Popup chi tiết</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2Fn6g6cCzpldb1fvQwtdur%2Fcrm_order_popup_1_overview.png?alt=media&amp;token=7fbbd04a-7299-4ffa-ae21-bc30708ce8c5" alt=""><figcaption><p>Danh sách đơn hàng - Popup chi tiết</p></figcaption></figure>

## Pancake POS

* [x] Tạo đơn hàng
* [x] Tạo đơn đổi trả
* [x] Danh sách đơn hàng
* [x] Danh sách đơn hàng - Popup chi tiết
* [x] Danh sách đổi trả
* [x] Danh sách đổi trả - Popup chi tiết
* [x] Danh sách hẹn gọi
* [x] Danh sách khách hàng
* [x] Danh sách khách hàng - Popup chi tiết

<div><figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FpzcRgEg4uRQGemDt7K3X%2Fpos_order_create.png?alt=media&amp;token=b1ec3448-21d6-4fe3-a2f4-4c4cfa3340b5" alt=""><figcaption><p>Tạo đơn hàng</p></figcaption></figure> <figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FJv0YzMqiBea1ZO4xynHQ%2Fpos_order_return_popup_detail.png?alt=media&amp;token=03092cb8-b328-46a2-91c4-33feb969e736" alt=""><figcaption><p>Tạo đơn đổi trả</p></figcaption></figure></div>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2F1hv1zU1kuBNe46m5y36C%2Fpos_order_list.png?alt=media&amp;token=c651848d-d68e-4b6f-8f45-7d7452703273" alt=""><figcaption><p>Danh sách đơn hàng</p></figcaption></figure>

<div><figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FTryJFyxVrXyqe0iy97yM%2Fpos_order_popup_detail.png?alt=media&amp;token=16d212de-4b54-4d41-8a07-a120cb1203d7" alt=""><figcaption><p>Danh sách đơn hàng - Popup chi tiết</p></figcaption></figure> <figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FV7vYEOFRC0jPc6K56Py0%2Fpos_order_return_popup_detail.png?alt=media&amp;token=699b0e3b-63ce-403c-87b9-fb3e610ff666" alt=""><figcaption><p>Danh sách đổi trả - Popup chi tiết</p></figcaption></figure></div>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FYqNaGtWGhZefD3KHBZ3G%2Fpos_order_list_return.png?alt=media&amp;token=c34eeb90-1da7-4c10-a029-3e2573ee63cc" alt=""><figcaption><p>Danh sách đổi trả</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FPM8QCTaq6qMsDk1URpii%2Fpos_reminder_list.png?alt=media&amp;token=22634409-3daf-4ce8-9fd4-1f39d5e26226" alt=""><figcaption><p>Danh sách hẹn gọi</p></figcaption></figure>

<div><figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FqLqNmtJJjSm62nlOnNIZ%2Fpos_customer_1_list.png?alt=media&amp;token=3269c621-5f24-4ae7-9e88-ee3435e30640" alt=""><figcaption><p>Danh sách khách hàng</p></figcaption></figure> <figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FwgSGgCIyB1PfSMYvGNnZ%2Fpos_customer_2_detail.png?alt=media&amp;token=ecb9fda1-16ba-44e8-9c10-6d329d41417e" alt=""><figcaption><p>Danh sách khách hàng - Popup chi tiết</p></figcaption></figure></div>


# Sapo

Các vị trí hỗ trợ hiển thị nút gọi nhanh Click-2-Call

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FzX3XwApOmctUV93vz76w%2FScreenshot%202024-11-18%20at%202.59.24%E2%80%AFPM.png?alt=media&amp;token=71d006c1-da34-48d0-abbd-e7bdbf84d9a5" alt=""><figcaption><p>Cấu hình cho extension</p></figcaption></figure>

```
mysapogo.com,sapocorp.net,mysapo.net,mysapo.vn
```

## Sapo Omni

* [x] Danh sách đơn hàng
* [x] Tạo đơn hàng
* [x] Chi tiết đơn hàng
* [x] Tạo đơn trả hàng
* [x] Danh sách khách hàng
* [x] Chi tiết khách hàng
* [x] Danh sách vận đơn
* [x] Phiếu giao hàng

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FzphubxYbbrRHGGxggJ9s%2Fomni_order_1_list.png?alt=media&amp;token=751ff23d-e89e-4062-b5e4-4acb8dc1c6e6" alt=""><figcaption><p>Danh sách đơn hàng</p></figcaption></figure>

<div><figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FtUSjRKtyVBtLR4WvU96W%2Fomni_order_2_create.png?alt=media&amp;token=bb46ac6a-0d5c-4aa4-9e83-573ec9965e5e" alt=""><figcaption><p>Tạo đơn hàng</p></figcaption></figure> <figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FxydKRt3s1GAvA5kqyEfq%2Fomni_order_3_create_return.png?alt=media&amp;token=355a93a9-07a9-4f5a-abd6-8517349690c7" alt=""><figcaption><p>Tạo đơn trả hàng</p></figcaption></figure> <figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2Fa4as7TrVe4coSJONfRU6%2Fomni_order_4_detail.png?alt=media&amp;token=d5a9eb47-3e67-4e36-9a4b-fe69a5e6f9a9" alt=""><figcaption><p>Chi tiết đơn hàng</p></figcaption></figure></div>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2Fk8WeYybyMsPLkWwfP628%2Fomni_customer_1_list.png?alt=media&amp;token=4cc0f10c-6f68-488c-b95d-956caf639962" alt=""><figcaption><p>Danh sách khách hàng</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FWQaFgdwGKOYNMwjdBghO%2Fomni_customer_2_detail.png?alt=media&amp;token=232310ad-9911-4641-99fc-29abe2686329" alt=""><figcaption><p>Chi tiết khách hàng</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FUAcpUHcmpSrtgjYeEP4A%2Fomni_shipment_list.png?alt=media&amp;token=17c43d26-d748-4200-aa17-b8bc4770c649" alt=""><figcaption><p>Danh sách vận đơn</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2F1ZlhPmztGOmaDzdftvEt%2Fomni_shipment_detail.png?alt=media&amp;token=e9830e98-bd6c-4fef-bea3-127d771777ab" alt=""><figcaption><p>Phiếu giao hàng</p></figcaption></figure>

## Sapo Web

* [x] Tạo đơn hàng
* [x] Chi tiết đơn hàng
* [x] Chi tiết đơn nháp
* [x] Danh sách khách hàng
* [x] Chi tiết khách hàng
* [x] Chi tiết nhóm khách hàng

<div><figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FsBAg0jl1LI8O2z4XW8DA%2Fweb_order_create.png?alt=media&amp;token=a83136e6-46be-4cde-9e09-32b591145265" alt=""><figcaption><p>Tạo đơn hàng</p></figcaption></figure> <figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2Fe1Zw1U57ISH1DTgFxccL%2Fweb_order_detail.png?alt=media&amp;token=1cc0f51f-b223-4119-aa2b-a14132d51961" alt=""><figcaption><p>Chi tiết đơn hàng</p></figcaption></figure> <figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FBGuidZTF1RmKVbs3HKZS%2Fweb_order_draf_detail.png?alt=media&amp;token=d3cf0be7-c8ce-4667-8ab4-70dd8a0d15ee" alt=""><figcaption><p>Chi tiết đơn nháp</p></figcaption></figure></div>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FhU2hur4UpqfVJ1kATwYM%2Fweb_customer_list.png?alt=media&amp;token=92af0d53-8903-490d-a041-bf8871d10c8e" alt=""><figcaption><p>Danh sách khách hàng</p></figcaption></figure>

<div><figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FExg4tuaby983V12Xm2sD%2Fweb_customer_detail.png?alt=media&amp;token=0162e831-6b54-4df9-b62d-6fe993488062" alt=""><figcaption><p>Chi tiết khách hàng</p></figcaption></figure> <figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2F9gvCbvbDtnvP99nelgaI%2Fweb_customer_group.png?alt=media&amp;token=1c301340-b50c-4a4a-919c-9bd724da247a" alt=""><figcaption><p>Chi tiết nhóm khách hàng</p></figcaption></figure></div>

## Sapo POS

* [x] Tạo đơn

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FkTiLprkpeC91kAftlnGu%2Fpos_customer_selected.png?alt=media&amp;token=cf7f2b7a-a691-45c7-8c35-f24ff27f7516" alt=""><figcaption></figcaption></figure>

## Sapo  Fnb

* [x] Danh sách khách hàng
* [x] Chi tiết khách hàng
* [x] Thêm nhóm khách hàng
* [x] Chi tiết nhóm khách hàng
* [x] Chi tiết thẻ thành viên

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FDlG74iTzPgTKXQMjx1ST%2Ffb_customer_list.png?alt=media&amp;token=779ee966-5f0d-4670-b362-97a2111e4b76" alt=""><figcaption><p>Danh sách khách hàng</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2Fhvc7On75rtTkH0Dv4ie1%2Ffnb_customer_detail.png?alt=media&amp;token=a7e23414-253d-406a-a521-e1a952655146" alt=""><figcaption><p>Chi tiết khách hàng</p></figcaption></figure>

<div><figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FsJqQmByLKhivPZ9PfzFA%2Ffnb_group_create.png?alt=media&amp;token=8436c55a-94fd-4bde-84c1-5edbe1035314" alt=""><figcaption><p>Tạo nhóm khách hàng</p></figcaption></figure> <figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2Fxum34EfD75uBBjj0bsqJ%2Ffnb_group_detail.png?alt=media&amp;token=271c82ba-6d5f-466e-bdb8-e36fe8f99b8a" alt=""><figcaption><p>Chi tiết nhóm khách hàng</p></figcaption></figure> <figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FNoIxBw8WCmbGOp7Hvtj6%2Ffnb_loyalty_card.png?alt=media&amp;token=21c363b0-40df-4865-bee8-b631aee81862" alt=""><figcaption><p>Chi tiết thẻ thành viên</p></figcaption></figure></div>

## Sapo Loyalty

* [x] Danh sách khách hàng thành viên
* [x] Chi tiết khách hàng thành viên

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FLOq0vc07IkvRWtzWFZ2y%2Floyalty_customer_list.png?alt=media&amp;token=df2bb6eb-7de1-49e9-a995-b01930107b97" alt=""><figcaption><p>Danh sách khách hàng thành viên</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FsNIyc0shrJFgAl3BevDj%2Floyalty_customer_detail.png?alt=media&amp;token=a41faf0c-8835-4cf8-86a4-5e3f3f517733" alt=""><figcaption><p>Chi tiết khách hàng thành viên</p></figcaption></figure>


# Haravan

Các vị trí hỗ trợ hiển thị nút gọi nhanh Click-2-Call

Cấu hình nên dùng, để áp dụng ví trí nút gọi không chắn nội dung trên trạng POS

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2Fbe0P8SMt8osqBmj7Da8t%2FScreenshot%202024-11-18%20at%203.03.37%E2%80%AFPM.png?alt=media&amp;token=5a081c04-1069-4ff2-94b2-cfee7fcec520" alt=""><figcaption><p>Cấu hình cho extension</p></figcaption></figure>

```
pos.haravan
```

```
myharavan.com,harasocial.com,haravan.app
```

## Haravan CRM

* [x] Tạo đơn hàng
* [x] Danh sách đơn hàng
* [x] Chi tiết đơn hàng
* [x] Chi tiết đơn nháp
* [x] Chi tiết đơn chưa hoàn tất
* [x] \[Giao diện cũ] Chi tiết khách hàng
* [x] \[Giao diện mới] Chi tiết khách hàng
* [x] \[Giao diện mới] Danh sách khách hàng
* [x] \[Giao diện mới] Chi tiết nhóm khách hàng

<div><figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FHXB6PZMqQcaPuoYqll8I%2Forder_create.png?alt=media&amp;token=be91fbbe-04b6-4b58-9c4b-1c8b1b6f2be2" alt=""><figcaption><p>Tạo đơn hàng</p></figcaption></figure> <figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2Fm8vYufHXCF0lNBiZnrda%2Forder_detail.png?alt=media&amp;token=b5c199cc-bf94-44fc-baf8-3a93df0603da" alt=""><figcaption><p>Chi tiết đơn hàng</p></figcaption></figure> <figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FkphKTrirZYBTsR2bNEWG%2Forder_draft_detail.png?alt=media&amp;token=a2dbf9c4-500f-4d86-82b6-cee5a49780b4" alt=""><figcaption><p>Chi tiết đơn nháp</p></figcaption></figure> <figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FuyDHgOlxlnujRWTZaZid%2Forder_list.png?alt=media&amp;token=f6c98d43-4d6a-4b0f-b2f8-de71b0895be6" alt=""><figcaption><p>Danh sách đơn hàng</p></figcaption></figure></div>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2Fkuhuelpn6xnnHzZccxwy%2Forder_temp_detail.png?alt=media&amp;token=3b39f894-3249-48df-9b5e-5d27b9576af3" alt=""><figcaption><p>Chi tiết đơn chưa hoàn tất</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FYnOhBPjKT2Rkj63puymt%2Fcustomer_detail_old.png?alt=media&amp;token=c624c232-24b5-4755-a9d7-82afabd184cb" alt=""><figcaption><p>[Giao diện cũ] Chi tiết khách hàng</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FPb4m4Q4iYjMUXo2OwU0G%2Fcustomer_detail_new.png?alt=media&amp;token=f92ee85c-6bbd-448b-8419-2ed8475370c9" alt=""><figcaption><p>[Giao diện mới] Chi tiết khách hàng</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FqH6YxLUGVE79OQUJGOkr%2Fcustomer_list_new.png?alt=media&amp;token=456568f3-50a1-4f7a-974b-10f137060d5a" alt=""><figcaption><p>[Giao diện mới] Danh sách khách hàng</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2F5CObEhwf0ZNhEjkXbrNt%2Fcustomer_group_detail_new.png?alt=media&amp;token=e2ab46e8-5b3c-44f3-98e7-91d94af24cfa" alt=""><figcaption><p>[Giao diện mới] Chi tiết nhóm khách hàng</p></figcaption></figure>

## Haravan Social

* [x] Danh sách đơn hàng
* [x] Chi tiết inbox

<div align="center"><figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FsXqFgHt0SLVJvyzC9KrJ%2Fsocial_customer_list.png?alt=media&amp;token=a3bfe870-4f06-426e-97f8-0d92bd610d59" alt=""><figcaption><p>Danh sách đơn hàng</p></figcaption></figure></div>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FzvR5kQVG667eNgwyWmXe%2Fsocial_inbox_detail.png?alt=media&amp;token=0038989e-2f34-4726-9d9c-5416fd1ebe3c" alt=""><figcaption><p>Chi tiết inbox</p></figcaption></figure>

## Haravan POS

* [x] Bán hàng
* [x] Tra cứu đơn hàng
* [x] Đổi trả đơn hàng

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2Fb9kSwMk0Cs9aVOzFDbTC%2Fpos_customer_1_selected.png?alt=media&amp;token=c3bfc988-7cc7-455f-a102-0b3292780cf9" alt=""><figcaption><p>Bán hàng - Khách hàng đã chọn</p></figcaption></figure>

<div><figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FvJz98Ihyxh0LLsQmhnKS%2Fpos_customer_2_address_tooltip.png?alt=media&amp;token=99258df1-88ed-42cc-8179-4ebb420cbdf5" alt=""><figcaption><p>Bán hàng - Địa chỉ nhận hàng</p></figcaption></figure> <figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2F2HDz2sjuOqWJGSLfU9EZ%2Fpos_customer_3_address_list.png?alt=media&amp;token=b685f794-dadc-4359-93db-861bff8dcdf7" alt=""><figcaption><p>Bán hàng - Danh sách địa chỉ</p></figcaption></figure></div>

<div><figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2F5p6zI7gN6WUHOitFiqZS%2Fpos_order_detail.png?alt=media&amp;token=c29e65d5-88b6-4754-939d-33a0c5fd61fa" alt=""><figcaption><p>Tra cứu đơn hàng</p></figcaption></figure> <figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FN9obJwBFcx4lQT8aIIdS%2Fpos_order_refund.png?alt=media&amp;token=590edd42-d998-4633-8f9d-f9528f392ac1" alt=""><figcaption><p>Đổi trả đơn hàng</p></figcaption></figure></div>


# Nhanh.vn

Các vị trí hỗ trợ hiển thị nút gọi nhanh Click-2-Call

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FhWO6BbyBQaJs18YHgYEY%2FScreenshot%202024-11-18%20at%203.04.59%E2%80%AFPM.png?alt=media&amp;token=4a2ea7e9-c051-4d5e-9ee9-38744cec33c6" alt=""><figcaption><p>Cấu hình cho extension</p></figcaption></figure>

```
nhanh.vn
```

## VPage

* [x] Hội thoại
* [x] Đơn hàng
* [x] Khách hàng

<div><figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FiH1roGEgy7Qhri8FSq7A%2F82_vpage_tab_customer_phone_input.png?alt=media&amp;token=5a935f0b-d281-460e-9118-525e25647532" alt=""><figcaption><p>Số điện thoại mặc định</p></figcaption></figure> <figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2F2hu3kSJeUmmzT5DzA4Gf%2F83_vpage_tab_customer_phone_dialog.png?alt=media&amp;token=a755570f-4371-48cc-8961-a3391531bd78" alt=""><figcaption><p>Danh sách số điện thoại</p></figcaption></figure></div>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2Fj0NdnTLNg66fCBX5niO5%2F84_vpage_tab_customer_order_popup.png?alt=media&amp;token=6737aa55-b057-45e3-a364-1407460d3eca" alt=""><figcaption><p>Chi tiết đơn đã mua</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2Fyu1JfrFXnhREP1g1mUhJ%2F85_vpage_tab_order_phone_input.png?alt=media&amp;token=ae1546c2-83b4-4e2e-9ed3-12527cea49e5" alt=""><figcaption><p>Ô nhập SĐT của đơn hàng mới</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FYmkm5sH1tsuGwpFs3jaR%2F86_vpage_order_list.png?alt=media&amp;token=f6468840-1715-45eb-b7da-a936a32944c9" alt=""><figcaption><p>Danh sách đơn hàng</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FXQ4fydAkzAz1R4Dv2iKf%2F86_vpage_customer_list.png?alt=media&amp;token=01148343-a013-48d6-8dbb-30fffc308cbb" alt=""><figcaption><p>Danh sách khách hàng đã liên kết</p></figcaption></figure>

## Bán hàng (POS)

* [x] Hóa đơn nháp
* [x] Thêm hóa đơn nháp
* [x] Sửa hóa đơn nháp
* [x] Tìm hóa đơn
* [x] Chi tiết hóa đơn
* [x] Sửa hóa đơn
* [x] Bán lẻ
* [x] Bán lẻ / Thêm hóa đơn
* [x] Bán lẻ / Sửa hóa đơn
* [x] Bán sỉ
* [x] Bán sỉ / Thêm hóa đơn
* [x] Bán sỉ / Sửa hóa đơn
* [x] Nhập máy cũ
* [x] Hóa đơn điện tử
* [x] Trả hàng
* [x] Trả hàng không cần hóa đơn
* [x] Thêm hóa đơn đổi trả hàng
* [x] Nợ quà tặng
* [x] Phiếu xác nhận trả quà

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2F8x93umCvo6EJsdayGDhc%2F24_post_bill_lookup.png?alt=media&amp;token=95350860-0201-4dd0-a685-03a5a6fba2ff" alt=""><figcaption><p>Tìm hoá đơn</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2F2yVcG0SfDMVrIxmVM1cq%2F5_pos_sale_list.png?alt=media&amp;token=9c4a9a33-3e11-471f-b70e-d7ccbbf73aae" alt=""><figcaption><p>Danh sách đơn nháp</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FfiPgKttZ7UZttUohMxR6%2F6_pos_bill_list.png?alt=media&amp;token=6e52ab71-ed06-47b0-b22d-a42d472a9fdb" alt=""><figcaption><p>Danh sách đơn bán lẻ</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FtUFvXIzWe4XDwi5DIxVK%2F12_pos_bill_wholesale.png?alt=media&amp;token=03fb9b22-89bf-4ee6-921b-0496d7708978" alt=""><figcaption><p>Danh sách đơn bán sỉ</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FDWTa6jgBTOn0BbUcwqPJ%2F7_pos_bill_add.png?alt=media&amp;token=a0b38e52-418b-49bc-808c-b2baf9e09f93" alt=""><figcaption><p>Thêm đơn bán lẻ</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FMGLlg7XMO7kNxQbaJ4bm%2F22_post_bill_detail.png?alt=media&amp;token=a4fb2d8c-7716-4d27-822c-c0c95ba5580d" alt=""><figcaption><p>Chi tiết đơn bán lẻ</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FWujlajSMBaaE6GTg0mwt%2F23_post_bill_detail.png?alt=media&amp;token=457375a4-14df-4f0e-8f85-539a656e0122" alt=""><figcaption><p>Lịch sử trả hàng của đơn bán lẻ</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2F3ke0vuvbtWZ453BsglOg%2F8_pos_bill_edit_draft.png?alt=media&amp;token=755aeb44-fd1c-48d1-91d8-10b9cdc7304a" alt=""><figcaption><p>Sửa đơn nháp</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FeBk8giVa5dridfXxMGe0%2F21_pos_sale_detail.png?alt=media&amp;token=81a6f29e-5864-46b0-9021-a546c623ef42" alt=""><figcaption><p>Chi tiết đơn nháp</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FPAwzc0kgY5V5T3gOmLQP%2F9_pos_bill_edit.png?alt=media&amp;token=65a94c96-f82d-4072-bc92-c3893eb5df4a" alt=""><figcaption><p>Sửa đơn bán lẻ/ bán sỉ</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2F2c7yn59gCYz6b1UT5afN%2F10_pos_bill_add_wholesale.png?alt=media&amp;token=7acad212-bc5f-4d0b-a103-4b9fd6fca49a" alt=""><figcaption><p>Sửa đơn bán sỉ</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FDSyvbWQ0BdTBsuqNzrDM%2F11_pos_bill_add_resale.png?alt=media&amp;token=4cdbaff3-cb95-423f-ba57-6f8e2c7c1224" alt=""><figcaption><p>Nhập đơn từ máy cũ</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FuJ6OF1SDLBv4vwAMyV8F%2F14_pos_add_return_from_bill.png?alt=media&amp;token=f9a6d699-b09b-40dd-8d9f-d46b7c7061c9" alt=""><figcaption><p>Thêm hoá đơn đổi trả hàng</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2F7WGjM2otDj2xiaGWctGL%2F15_pos_add_return_from_order.png?alt=media&amp;token=36cc73e1-b761-450e-8fc7-d9e090a9e053" alt=""><figcaption><p>Thêm phiếu trả hàng</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FMy7Ibn0PDlafZbsFMh18%2F16_pos_add_return.png?alt=media&amp;token=6ba5bb1c-f861-4d50-aace-eb758063c659" alt=""><figcaption><p>Thêm phiếu trả hàng không cần hoá đơn</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2F9IlraSW2nu46vai1cadG%2F17_pos_return_list.png?alt=media&amp;token=02d27d10-93e8-42b4-96d5-ad8409ea55f2" alt=""><figcaption><p>Danh sách phiếu trả hàng</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FZGDWHOMC49ZaVEyRKKlT%2F18_pos_debt_bill.png?alt=media&amp;token=c0d2edb5-f964-49af-bff9-a12d2725ac25" alt=""><figcaption><p>Danh sách nợ quà tặng</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FY6gppIl0LywhPMAC7myR%2F19_pos_debt_confirm_gift.png?alt=media&amp;token=9be97001-0a6e-4840-a0f8-1780b02c8068" alt=""><figcaption><p>Phiếu xác nhận trả quà</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FZpyAQwDuS1Vyi5GBCzF7%2F20_pos_return_edit.png?alt=media&amp;token=e104f189-7b27-4cec-a838-1c6ced1b9b2d" alt=""><figcaption><p>Sửa phiếu trả hàng</p></figcaption></figure>

## Sản phẩm

* [x] Nhà cung cấp
* [x] Nhà cung cấp / Chi tiết

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FzKtEQ4tAABLcAY6vdKEE%2F1_supplier_manage_list.png?alt=media&amp;token=51f944b1-a2f8-4744-a30d-505063959fa2" alt=""><figcaption><p>Danh sách nhà cung cấp</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FsQ0IDKSUfE0IuoJxhN3k%2F2_supplier_manage_popup.png?alt=media&amp;token=2efb2825-b495-4cc0-82ec-0d24468fa125" alt=""><figcaption><p>Xem nhanh chi tiết nhà cung cấp</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FXrigFRq9jP2Wd3GDDJR9%2F3_supplier_manage_detail.png?alt=media&amp;token=e5e682a4-0a78-4604-a316-7a493633946a" alt=""><figcaption><p>Chi tiết nhà cung cấp</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2F883FWf5LRwryV5vdflAa%2F4_supplier_manage_edit.png?alt=media&amp;token=7ce86431-b646-4889-b299-e585ec832847" alt=""><figcaption><p>Thêm / Sửa nhà cung cấp</p></figcaption></figure>

## Kho hàng

* [x] Xuất nhập kho / Chi tiết XNK
* [x] Xuất nhập kho / Sửa phiếu XNK khác

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FIB8WHFpUO0xBypDPjiSi%2F56_inventory_bill_detail.png?alt=media&amp;token=43cf3157-fa5f-4577-be9b-2d1eaadcf83e" alt=""><figcaption><p>Chi tiết phiếu xuất nhập kho</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2F6qOoFhNphtEdoCrq9r1s%2F57_inventory_bill_edit.png?alt=media&amp;token=86fd194a-66a6-47df-9873-6ad4e074e725" alt=""><figcaption><p>Sửa phiếu xuất nhập kho</p></figcaption></figure>

## Đơn hàng

* [x] Danh sách đơn hàng
* [x] Thêm đơn hàng
* [x] Sửa đơn hàng
* [x] Chi tiết đơn hàng
* [x] Kiểm tra đơn trùng
* [x] Đơn chờ gửi vận chuyển
* [x] Lịch sử sửa xóa

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2Fs4ZPq0EdeAxTsKnRl3F2%2F27_order_list.png?alt=media&amp;token=efb63217-b406-4c9d-80ab-3779eaeee542" alt=""><figcaption><p>Danh sách đơn hàng</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FAMjihu0oWiAezWMmE6TE%2F26_order_add.png?alt=media&amp;token=f8848685-cd91-4a95-8e3f-9c7dd1247695" alt=""><figcaption><p>Thêm đơn hàng</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2Fga9GnPGCODP1efQYVqPa%2F32_order_edit.png?alt=media&amp;token=c7ad976a-1560-42c6-ae0d-0d76d91873d9" alt=""><figcaption><p>Sửa đơn hàng</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FOwDPb7DPPgtHyYo5Wj40%2F30_order_detail.png?alt=media&amp;token=7405f7f0-a756-42c6-873c-e69b05807f04" alt=""><figcaption><p>Chi tiết đơn hàng</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FgGkgU6pqKCDHtSbp0IMp%2F31_order_detail_popup_verify_depot.png?alt=media&amp;token=ab8f01bc-2df4-4575-8d59-8aaf4789f3c3" alt=""><figcaption><p>Chi tiết đơn hàng - Popup xác nhận địa chỉ kho</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FC9eiMIGG38rGO7qd3Sq1%2F28_order_sending_carrier.png?alt=media&amp;token=3ed54f74-e2de-42a3-ad43-e7a6f5633e7f" alt=""><figcaption><p>Danh sách đơn chờ vận chuyển</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FU7UmInIHEjd0BZUK9ggY%2F29_order_deleted_list.png?alt=media&amp;token=d97caa21-952b-4b12-bbd7-93cdd22a3fc3" alt=""><figcaption><p>Lịch sử sửa xoá đơn hàng</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FoelcmHC3lZsXVUu1Dn3L%2F33_order_check_duplicate.png?alt=media&amp;token=7e69fb84-8a54-470c-b337-6761ad42c959" alt=""><figcaption><p>Danh sách đơn trùng</p></figcaption></figure>

## Shipping

* [x] Handover / View
* [x] Handover / Edit
* [x] Handover / Add
* [x] Chi tiết tour tự giao hàng

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FAkQry4v3WuC0zYedW1Dk%2F43_shipping_handover_view.png?alt=media&amp;token=18fc4685-6761-4a91-9014-3b1e845bea14" alt=""><figcaption><p>Chi tiết biên bản giao hàng</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FlHf2NoxYsxxSq0b6MiuI%2F44_shipping_handover_edit.png?alt=media&amp;token=54ae0977-2c6c-419c-93d1-abd25052b256" alt=""><figcaption><p>Sửa biên bản giao hàng</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2F5LuJ5gIkhuMIgoTiO4S9%2F45_shipping_handover_add.png?alt=media&amp;token=0fa73877-fe24-464f-a453-4016f4fa5dfa" alt=""><figcaption><p>Thêm biên bản giao hàng</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FD5l6t7DB4PQ65LQlTnks%2F46_shipping_tour_view.png?alt=media&amp;token=585dc520-18d0-4caa-900f-b309dd6608c2" alt=""><figcaption><p>Chi tiết tour chuyển hàng</p></figcaption></figure>

## Tracking

* [x] Theo dõi lịch trình giao hàng

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FpUh66UUmZijSSfhWx6RM%2F34_tracking.png?alt=media&amp;token=9762106b-da20-4787-a850-b5f36c88dac9" alt=""><figcaption></figcaption></figure>

## Khách hàng

* [x] Danh sách khách hàng
* [x] Thông tin khách hàng
* [x] Chỉnh sửa khách hàng
* [x] Thẻ khách hàng / Gán khách hàng
* [x] Lịch sử chăm sóc khách hàng

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2Fsv4yUMG9iRN9mCkzKlvT%2F35_customer_list.png?alt=media&amp;token=8a1cad0d-fe7f-40d3-8c0b-cd74be43a8fb" alt=""><figcaption><p>Danh sách khách hàng</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FNuEt3l5XPw5WBcdDumHB%2F36_customer_detail_basic.png?alt=media&amp;token=a56f407b-0743-4463-9202-e3fa75a8bae8" alt=""><figcaption><p>Chi tiết khách hàng - Thông tin</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2Fuvtnf3LlouTc623VKqx8%2F37_customer_detail_bills.png?alt=media&amp;token=3d8fcc93-78a9-4226-ae8e-c679cd27f663" alt=""><figcaption><p>Chi tiết khách hàng - Lịch sử mua hàng</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2Fl0cHAS6wAl3LF5wRp9n7%2F38_customer_add.png?alt=media&amp;token=93f43735-fcd1-40b8-ab30-6f51995b2653" alt=""><figcaption><p>Thêm khách hàng</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2F3UnEqlNtz98rNEVPSApC%2F39_customer_edit.png?alt=media&amp;token=e087c855-78d3-4561-973a-7f02c41254f9" alt=""><figcaption><p>Sửa khách hàng</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FX8s4I5DABl7KMbkyHzH5%2F40_customer_card_add.png?alt=media&amp;token=7e6be5d3-c517-447e-8bef-66d2d2d9ee3d" alt=""><figcaption><p>Gán thẻ khách hàng</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FbCAlwaMj0dRoW6pe957D%2F42_customer_care_list.png?alt=media&amp;token=8f1c8d9a-d9c9-4424-864a-1052088f11f0" alt=""><figcaption><p>Lịch sử chăm sóc khách hàng</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2Fn0YOdeJ4EcX7BX5wb8OV%2F41_customer_care_add.png?alt=media&amp;token=8b766a1f-9d15-434b-b9bd-e487c01f1421" alt=""><figcaption><p>Thêm phiếu chăm sóc khách hàng</p></figcaption></figure>

## Kế toán

* [x] Tổng hợp thu chi
* [x] Thu hộ trả góp / Thu hộ dịch vụ trả góp
* [x] Công nợ / Khách hàng
* [x] Công nợ / Nhà cung cấp
* [x] Công nợ / Dịch vụ trả góp

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2F7gGEpMiXFTOAFBMdoxkf%2F47_accounting_transaction_cashbook.png?alt=media&amp;token=8f5287fe-e5bd-44a2-977b-cb6eeed72d17" alt=""><figcaption><p>Tổng hợp thu chi</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FP2YkFoL05J3Br4G1xJVu%2F52_accounting_transaction_installments.png?alt=media&amp;token=f99099a2-71a6-40b3-b904-5819a4de697b" alt=""><figcaption><p>Danh sách thu hộ trả góp</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FFDoONcGfnC2ucl3O9Enn%2F51_accounting_transaction_add_installment.png?alt=media&amp;token=01fb73a2-104d-49b4-8c90-ee639ba57076" alt=""><figcaption><p>Tạo phiếu thu hộ dịch vụ trả góp</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FYQOfHRYucrirYUvzhHjm%2F50_accounting_debts_installment.png?alt=media&amp;token=99614af3-dd4e-4827-94ba-3cfa48bd3ec4" alt=""><figcaption><p>Công nợ dịch vụ trả góp</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2Ff3IHEqN3BydsZ1BL5auY%2F48_accounting_debts_customer.png?alt=media&amp;token=4b6342dc-cd1d-4ac0-aae3-07542df1b058" alt=""><figcaption><p>Công nợ khách hàng</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FWrdDJHk6QIBJu2d7jaB5%2F49_accounting_debts_supplier.png?alt=media&amp;token=c2f059a5-5d50-4455-95bd-a5a2431311b4" alt=""><figcaption><p>Công nợ nhà cung cấp</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FCQZc2y9tSzzk2X05eEpX%2F53_accounting_account_list.png?alt=media&amp;token=eebfcd0b-fd6f-4b6e-b2d6-848d5756bf05" alt=""><figcaption><p>Danh sách dịch vụ trả góp</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2F0PZQN7Cf9E9ebIC38lbU%2F55_accounting_account_add.png?alt=media&amp;token=29f3a481-515a-400f-b014-1f3b85d25656" alt=""><figcaption><p>Thêm dịch vụ trả góp</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FpIMxYUxmRKzHdz2Z53pL%2F54_accounting_account_edit.png?alt=media&amp;token=837bce31-6a2f-415f-b8d1-7eb44ba2cf17" alt=""><figcaption><p>Sửa dịch vụ trả góp</p></figcaption></figure>

## Báo cáo

* [x] Doanh thu / Theo nhà cung cấp
* [x] Doanh thu / Khách hàng
* [x] Báo cáo sản phẩm bán chạy theo IMEI
* [x] Báo cáo sản phẩm theo khách hàng
* [x] Thống kê mã giới thiệu theo đơn hàng

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FcR8quXc2A1i4ceAHDums%2F59_report_revenue_supplier.png?alt=media&amp;token=2c28a4eb-860f-40c3-9489-5a7cdd3aa76f" alt=""><figcaption><p>Doanh thu theo nhà cung cấp</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FR8uNUSWXsj5DlWq6qfQS%2F58_report_revenue_customer.png?alt=media&amp;token=09ce1145-5155-4b64-811b-77aed723db1e" alt=""><figcaption><p>Doanh thu theo khách hàng</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FRFJeEUkE1epnLfhw3z1L%2F60_report_product_salebyimei.png?alt=media&amp;token=1cd0eca5-2bf0-4075-9df0-6075258a8599" alt=""><figcaption><p>Báo cáo sản phẩm bán chạy theo IMEI</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2Fi9JT5kkTMpm6CwBZqThg%2F61_report_customer_product.png?alt=media&amp;token=4ec45018-7661-4761-9b1e-8be18fd9ba29" alt=""><figcaption><p>Báo cáo sản phẩm theo khách hàng</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2Fm88ROVmkUGBzNuzz4NuH%2F62_report_affiliate_list.png?alt=media&amp;token=e8071e2f-697d-436d-9ea4-a92952f1a72a" alt=""><figcaption><p>Thống kê mã giới thiệu theo đơn hàng</p></figcaption></figure>

## Website

* [x] Danh sách liên hệ
* [x] User đăng nhập
* [x] Thêm mới user đăng nhập

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FHxhTKWqJbjk3c8jYTzlc%2F63_website_contact_list.png?alt=media&amp;token=a704f164-a50d-4ac5-bbb9-53b6665fc93b" alt=""><figcaption><p>Danh sách liên hệ</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FgonckTDYlMlcMc621BPe%2F64_website_user_list.png?alt=media&amp;token=1f3e58e4-5fc6-4372-8426-84ab3ad808f3" alt=""><figcaption><p>Danh sách User đăng nhập</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FLuwsSiBIkZumlF0EJt2E%2F65_website_user_add.png?alt=media&amp;token=99f8ba95-3edf-40f0-9dd7-9267e29bae82" alt=""><figcaption><p>Thêm mới User đăng nhập</p></figcaption></figure>

## Bảo hành

* [x] Lịch sử bảo hành
* [x] Lịch sử bảo hành / Thêm mới bảo hành
* [x] Lịch sử bảo hành / Sửa phiếu bảo hành
* [x] Trung tâm bảo hành
* [x] Trung tâm bảo hành / Thêm mới
* [x] Trung tâm bảo hành / Sửa trung tâm bảo hành

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FpZDFudiivZmj44E2Qqfm%2F66_warranty_history_list.png?alt=media&amp;token=b3dc9f1f-888e-44b0-88a8-50bd6b5687c3" alt=""><figcaption><p>Lịch sử bảo hàng</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FkYCPSaoMvJKR4QMikZuO%2F67_warranty_history_add.png?alt=media&amp;token=37624a16-8953-4e98-82fc-72a02c818965" alt=""><figcaption><p>Thêm mới bảo hành</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FIJYHSzn5AVSq3iF1B95b%2F68_warranty_history_update.png?alt=media&amp;token=254cf387-bc11-4724-b7e5-941254c11025" alt=""><figcaption><p>Sửa phiếu bảo hành</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FQmDefgah9wbBTkszL8dL%2F69_warranty_setting_servicecenter.png?alt=media&amp;token=aa47f272-07d1-4d1a-8316-bec605c3de7f" alt=""><figcaption><p>Trung tâm bảo hành</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FfLq1RZ2f57fbKKIBiyJi%2F70_warranty_setting_servicecenter_add.png?alt=media&amp;token=26f908e3-a03d-477a-8b9a-99d6706502a8" alt=""><figcaption><p>Thêm trung tâm bảo hành</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2F7g9N2FvRYM5shBahyxLO%2F71_warranty_setting_servicecenter_edit.png?alt=media&amp;token=749a08b9-19d6-4274-adab-5c0184fb5268" alt=""><figcaption><p>Sửa trung tâm bảo hành</p></figcaption></figure>

## Khuyến mại

* [x] Affiliate

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FjSXLmueHOW9OtNcxkuif%2F72_promotion_marketing_affiliate.png?alt=media&amp;token=87ae2b9a-7369-484e-acce-56690ad100f1" alt=""><figcaption><p>Danh sách Affiliate</p></figcaption></figure>

## Cài đặt

* [x] Nhân viên
* [x] Nhân viên / Sửa tài khoản
* [x] Nhân viên / Thêm mới
* [x] Đại lý
* [x] Danh sách đại lý / Cập nhật đại lý
* [x] Danh sách đại lý / Tạo đại lý
* [x] Hạn sử dụng
* [x] Hạn sử dụng / Sửa kho hàng
* [x] Cài đặt gửi Zalo / Lịch sử gửi Zalo SMS

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FXZALNCAX8flcrmQXa8CE%2F73_store_user_list.png?alt=media&amp;token=0f425119-4884-448f-bf13-6934cbceaf00" alt=""><figcaption><p>Danh sách nhân viên</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FVgMVrJVmT3SUpj8f1lO2%2F74_store_user_add.png?alt=media&amp;token=83ad310a-28d8-4d81-83b6-2c4759df1679" alt=""><figcaption><p>Thêm mới nhân viên</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FX0f1K891jcl5TkQkr6LH%2F75_store_user_edit.png?alt=media&amp;token=556cff90-eb8f-42f8-b491-09b7d27fcde0" alt=""><figcaption><p>Sửa tài khoản nhân viên</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2F8y8AvYYHFfpXXRQfDuPU%2F76_store_agency_list.png?alt=media&amp;token=7c03a203-3669-49c8-8ca9-148a22c4fa11" alt=""><figcaption><p>Danh sách đại lý</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FO4SPFcbG7UKIjEVhwMY9%2F77_store_agency_add.png?alt=media&amp;token=326cee40-ec2b-4b43-beba-f7d4e462fcae" alt=""><figcaption><p>Tạo đại lý</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FpbKz5N4XiDKz3Em2vgQH%2F78_store_agency_edit.png?alt=media&amp;token=26cd77b2-883a-4a93-a650-8b3ce6b46c95" alt=""><figcaption><p>Cập nhật đại lý</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FFBQLfwGb8lIUe8BCMNpa%2F79_store_setting_expire.png?alt=media&amp;token=9627e305-e30b-4323-8fa6-e195626f59f2" alt=""><figcaption><p>Hạn sử dụng kho hàng</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FCnOQK8oTZFUGqnTeN8rC%2F80_store_setting_expire_edit.png?alt=media&amp;token=92d52ef3-0247-40f4-bbd1-5fef1e1e0607" alt=""><figcaption><p>Sửa kho hàng</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FiyKdshGJyGTLWx8R2cMG%2F81_setting_zalo_sms_log.png?alt=media&amp;token=41d59d8b-4602-442d-b8ed-768cc7767756" alt=""><figcaption><p>Lịch sử gửi Zalo ZNS</p></figcaption></figure>


# TPos.vn

Các vị trí hỗ trợ hiển thị nút gọi nhanh Click-2-Call

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2F7Jb2szM39jpvs5waxTxl%2FScreenshot%202024-11-18%20at%203.07.19%E2%80%AFPM.png?alt=media&amp;token=51e2bb96-8a2b-41b8-8ee8-e98740fd6603" alt=""><figcaption><p>Cấu hình cho extension</p></figcaption></figure>

```
tpos.vn
```

## TPos

### POS

* [x] Điểm bán hàng

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FZxPuW5ckqxGwPMmHGaEy%2F1_pos_web.png?alt=media&amp;token=1105aeb4-626a-43c6-92de-01ef988df2e0" alt=""><figcaption><p>Điểm bán hàng</p></figcaption></figure>

### Bán hàng

* [x] Phiếu bán hàng
* [x] Thêm phiếu đơn hàng
* [x] Xem/ Sửa phiếu đơn hàng
* [x] Phiếu trả hàng
* [x] Thêm phiếu trả hàng
* [x] Xem/ Sửa phiếu trả hàng
* [x] Phiếu giao hàng
* [x] Tạo nhanh phiếu giao hàng
* [x] Thêm mới phiếu bán hàng từ excel

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FSIeGbOfn5d9t64IvHnlY%2F2_fastsaleorder_invoice_list.png?alt=media&amp;token=f9d7845f-543d-40e8-9bc7-865d077eac7b" alt=""><figcaption><p>Phiếu bán hàng</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FEuD01wBei2xDpAoS4CAg%2F3.0_fastsaleorder_invoice_create_delivery.png?alt=media&amp;token=4d4c7e46-4c5a-4861-98d7-56930e4c8914" alt=""><figcaption><p>Phiếu bán hàng - Mới - Thông tin giao hàng</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FMyZ3YvlPh2GZtXvTC3Dl%2F3.1_fastsaleorder_invoice_create_receiver.png?alt=media&amp;token=384abc70-e95c-4512-9948-5805b7114dab" alt=""><figcaption><p>Phiếu bán hàng - Mới - Thông tin người nhận</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FPDB4EmN1H7Uf0RZZ6CUh%2F4.0_fastsaleorder_invoice_edit_delivery.png?alt=media&amp;token=055050b3-856d-4b32-a309-03ba8c2cfa3c" alt=""><figcaption><p>Phiếu bán hàng - Xem - Thông tin giao hàng</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FFVgZiGWAsvUCbJO6Ldta%2F4.1_fastsaleorder_invoice_edit_receiver.png?alt=media&amp;token=fda86804-f34b-447c-abcf-4dc0d304e258" alt=""><figcaption><p>Phiếu bán hàng - Xem - Thông tin người nhận</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FIZnzXgFmxgrbkEn5CsqI%2F5_fastsaleorder_refund_list.png?alt=media&amp;token=1522579a-1a47-4103-bb02-bbf1aaa3168f" alt=""><figcaption><p>Phiếu trả hàng</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FC05gGGtAwQHNRiQ2O1pn%2F8_fastsaleorder_delivery_list.png?alt=media&amp;token=66a311c7-2187-49a4-87f0-4f297b3f3880" alt=""><figcaption><p>Phiếu giao hàng</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FfaCpnLrSCCN8TTbfxgJQ%2F9_fastsaleorder_delivery_create.png?alt=media&amp;token=49c5b55e-9103-4a90-a7bd-2d917c96b5cf" alt=""><figcaption><p>Tạo nhanh phiếu giao hàng</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2F6mqfmrYQXJcbVCEk9VGd%2F10.0_fastsaleorder_invoice_import.png?alt=media&amp;token=5477d89e-3106-40a4-a8b9-11d5d838936c" alt=""><figcaption><p>Thêm mới phiếu bán hàng từ excel</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2F9oAuVLb36gzMr5tZl8rZ%2F11_create_customer_modal.png?alt=media&amp;token=e1383561-9a82-48bb-a2da-1c17222dce90" alt=""><figcaption><p>Thêm khách hàng</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2F7YxhUCCPV13lfUUNeU9c%2F12_update_customer_modal.png?alt=media&amp;token=964f2568-1935-4b29-9ec0-69be86f1a17f" alt=""><figcaption><p>Sửa khách hàng</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FnV2ThYbStRHtKT4MqgOQ%2F13_search_customer_modal.png?alt=media&amp;token=8e201ef0-eecc-4418-be1a-3909121eaf2b" alt=""><figcaption><p>Tìm kiếm khách hàng</p></figcaption></figure>

### Báo giá

* [x] Thêm báo giá
* [x] Xem/ Sửa báo giá

### Đơn đặt hàng

* [x] Thêm đơn đặt hàng

### Sale Online

* [x] Đơn hàng

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2F5ArcrxM2CJKmAQvSeHBJ%2F10.1_saleonline_order_list.png?alt=media&amp;token=2862d17f-3ebd-45ec-93e9-5ca78a712a59" alt=""><figcaption><p>Danh sách đơn hàng</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FuwFdum7EaaQoCYNZ5Hfr%2F10.2_saleonline_order_edit.png?alt=media&amp;token=13ee430c-2e40-40da-b48a-aec1b056d426" alt=""><figcaption><p>Popup sửa đơn hàng</p></figcaption></figure>

### Mua hàng

* [x] Thêm đơn mua hàng
* [x] Thêm đơn trả hàng

### Kế toán

* [x] Thêm phiếu thu
* [x] Xem/ Sửa phiếu thu
* [x] Thêm phiếu chi
* [x] Xem/ Sửa phiếu chi

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FXft5PdRXRygJ3GHY17Vu%2F17_accountpayment_thu_create.png?alt=media&amp;token=c1aece1a-3941-4910-affa-941696283ba4" alt=""><figcaption><p>Thêm phiếu thu</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FOlIBLbHDjzpRdxVS11td%2F18_accountpayment_thu_view.png?alt=media&amp;token=b94a97b4-015d-4a63-ada6-cd0e817b74d4" alt=""><figcaption><p>Xem phiếu thu</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2F1OAdfpRlnJCrSEFrrBkc%2F19_accountpayment_chi_create.png?alt=media&amp;token=13445fb1-6c16-4276-b20b-ef2f80566947" alt=""><figcaption><p>Thêm phiếu chi</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FzJIiLhv6pCHuLSJnVcHK%2F20_accountpayment_chi_view%26edit.png?alt=media&amp;token=9241401d-8f3f-49fd-8a81-1707246047ab" alt=""><figcaption><p>Xem/ Sửa phiếu chi</p></figcaption></figure>

### Danh mục

* [x] Khách hàng
* [x] Thêm khách hàng
* [x] Xem/ Sửa khách hàng
* [x] Nhà cung cấp
* [x] Thêm nhà cung cấp
* [x] Xem/ Sửa nhà cung cấp
* [x] Danh mục khác / Nhà phân phối
* [x] Danh mục khác / Thêm nhà phân phối
* [x] Danh mục khác / Xem/ Sửa nhà phân phối
* [x] Danh mục khác / Nhà sản xuất
* [x] Danh mục khác / Thêm nhà sản xuất
* [x] Danh mục khác / Xem/ Sửa nhà sản xuất
* [x] Danh mục khác / Nhà nhập khẩu
* [x] Danh mục khác / Thêm nhà nhập khẩu
* [x] Danh mục khác / Xem/ Sửa nhà nhập khẩu

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2F2rfyFSE6JhOoni2TUZOb%2F21_partner_customer_list.png?alt=media&amp;token=2c11ac3a-ead6-4665-abd2-eb51336f89c9" alt=""><figcaption><p>Danh sách khách hàng</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FzNGWfwjc0t7566qsCg9R%2F23_partner_customer_view%26edit.png?alt=media&amp;token=0fe389f7-2258-49d2-8983-6a65aaf249bd" alt=""><figcaption><p>Xem/ Sửa khách hàng</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2F5tmEVZg9O25tMk1vOw2C%2F24_partner_supplier_list.png?alt=media&amp;token=ae9c13e5-4d2a-48b6-9341-63f339fc94ac" alt=""><figcaption><p>Danh sách nhà cung cấp</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FTTutEJ8bjepiiwfZvRrf%2F26_partner_supplier_view%26edit.png?alt=media&amp;token=3dc9bd34-4926-4aa4-a829-b347223bd1bf" alt=""><figcaption><p>Xem/ Sửa nhà cung cấp</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FysXTYKiwAjM0xSsdaM4z%2F27_category_ext_common_list.png?alt=media&amp;token=9f85c2f1-0895-4ce6-8fa4-a09b2e6ce008" alt=""><figcaption><p>Danh mục khác</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2Fnaye0vFkt477xZ4DGLMS%2F28_category_ext_common_create.png?alt=media&amp;token=c233c37d-ae76-4f8a-9b29-9b2ecb64162a" alt=""><figcaption><p>Thêm danh mục khác</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FXjv88q3vbhGDDFYUi4ki%2F29_category_ext_common_view%26edit.png?alt=media&amp;token=86527062-9f6b-40bf-b612-bf0c4c44f96a" alt=""><figcaption><p>Xem/ Sửa danh mục khác</p></figcaption></figure>

### Báo cáo

* [x] Thống kê hóa đơn / Khách hàng
* [x] Báo cáo doanh thu / Khách hàng
* [x] Thống kê giao hàng / Tổng quan
* [x] Thống kê giao hàng / Khách hàng
* [x] Công nợ nhà cung cấp
* [x] Công nợ khách hàng
* [x] Công nợ khách hàng theo nhân viên
* [x] Khách hàng chưa phát sinh hóa đơn
* [x] Nguồn tạo khách hàng

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2Fy0bQvzXq1vmIa6YBxkel%2F30_report_order_customer.png?alt=media&amp;token=0323658d-805f-4a11-9fef-6e11998eb047" alt=""><figcaption><p>Thông kê hoá đơn / Khách hàng</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FmSeQMImqaxdhs1FaFFka%2F31_report_revenue_customer.png?alt=media&amp;token=560819db-9dd2-4e63-a7ca-e66f5ad67af5" alt=""><figcaption><p>Báo cáo doanh thu / Khách hàng</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2F5xCpbo3OV78lkdCpl61Z%2F32_report_delivery_common.png?alt=media&amp;token=576098ba-a09a-4b95-8170-d67aa053ab7e" alt=""><figcaption><p>Thống kê giao hàng / Tổng quan | Khách hàng</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FNy50H138iJPDgD8s2Bbb%2F33_report_supplier_dept.png?alt=media&amp;token=caef7c3e-863c-40f8-86c3-f2e89fdf89df" alt=""><figcaption><p>Công nợ nhà cung cấp</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2Fulx39rKYwAkAunCHFSIm%2F34_report_customer_dept.png?alt=media&amp;token=ab2cbadb-c801-436c-880f-ea84bd9c2744" alt=""><figcaption><p>Công nợ khách hàng</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2Fa3uSnPKoD3HV8S9jDhUl%2F35_report_customer_dept_by_staff.png?alt=media&amp;token=5bda7106-9b34-4b9a-97d2-c838b61cd3e6" alt=""><figcaption><p>Công nợ khách hàng theo nhân viên</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FnWbgi2sZYlJQcZdEjY1n%2F36_report_account_not_invoice.png?alt=media&amp;token=9f450e08-216b-4152-8821-ba446197f140" alt=""><figcaption><p>Khách hàng chưa phát sinh hóa đơn</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2F7ApVHOpBLmNJBM3Jgu8E%2F37_report_partner_create.png?alt=media&amp;token=9464daf3-b16e-4704-9179-de186dae8fa5" alt=""><figcaption><p>Nguồn tạo khách hàng</p></figcaption></figure>

### Cấu hình

* [x] Thêm công ty
* [x] Xem/ Sửa công ty
* [x] Thêm người dùng
* [x] Xem/ Sửa người dùng

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FLziYpNqIlGhJ2u8NBxex%2F38_company_create.png?alt=media&amp;token=4a94a67d-2d78-4f3d-a5e3-8602090a6e6f" alt=""><figcaption><p>Thêm công ty</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2F7pWu8jho6QGAFsYiN3hz%2F38_company_view%26edit.png?alt=media&amp;token=e2febe11-d787-499f-a946-849ce087ce64" alt=""><figcaption><p>Xem/ Sửa công ty</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FJIlQF8Tw2P8RMs8Vr2e2%2F40_application_user_create.png?alt=media&amp;token=f2e6c8be-0b7d-43ee-96b3-973da5e0b59e" alt=""><figcaption><p>Thêm người dùng</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2Fzr7R4WSWupCVjxKGQDGr%2F39_application_user_view%26detail.png?alt=media&amp;token=f26e8797-f6f5-4128-bb5c-c6da096b353c" alt=""><figcaption><p>Xem/ Sửa người dùng</p></figcaption></figure>

## TPage

* [x] Tất cả
* [x] Tin nhắn
* [x] Bình luận
* [x] Bài viết
* [x] Đơn hàng
* [x] Phiếu bán hàng / Danhg sách PBH
* [x] Phiếu bán hàng / Chi tiết PBH
* [x] Phiếu bán hàng / Thêm mới PBH
* [x] Phiếu bán hàng / Sao chép PBH
* [x] Phiếu bán hàng / Chỉnh sửa PBH
* [x] Khách hàng

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FwV9v2DDUNZUExP5UoX4l%2F41_tpage_conversations_partner_view.png?alt=media&amp;token=6cc0d833-69ef-4424-a723-503bb1529814" alt=""><figcaption><p>Tất cả cuộc trò truyện</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FuzahZQX9Q6lWWGTl8Rc3%2F42_tpage_conversations_partner_edit.png?alt=media&amp;token=19973f41-05bc-4a7e-8ac7-1aac58936d4b" alt=""><figcaption><p>Tin nhắn</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FOsLmQEc6wox6qnzdbkye%2F43_tpage_conversations_bill_create.png?alt=media&amp;token=a8a35ec6-b65b-49c5-b3a8-5916825b9f0e" alt=""><figcaption><p>Bình luận</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FynLrDnSomUrlMnQL44pZ%2F44_tpage_conversations_partner_recent_bill_detail.png?alt=media&amp;token=179201a8-d6ca-4f2f-b5e5-01318f15b6a1" alt=""><figcaption><p>Chi tiết phiêu mua hàng</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FbvjMOYxTgBBxqxYKQxjT%2F45_tpage_conversations_partner_popup_edit_order.png?alt=media&amp;token=158eefad-79d1-40eb-be58-9e296883898b" alt=""><figcaption><p>Sửa đơn hàng</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FIPMWZhzXkwmQBrCj6dtu%2F46_tpage_conversations_post_order_view.png?alt=media&amp;token=a4ae60eb-72df-4d31-95c1-a876c0125b50" alt=""><figcaption><p>Bình luận - Xem đơn hàng</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2Fgv3y3p02FOB3mGnZAvPj%2F47_tpage_conversations_post_order_edit.png?alt=media&amp;token=e37dbebd-efad-4f14-bbeb-4749efd917b6" alt=""><figcaption><p>Bình luận - Sửa đơn hàng</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FRsTaeFEZEWODqINpdjhY%2F48_tpage_order_list.png?alt=media&amp;token=f9268017-1ec5-459e-bdc8-a90b9e2b3865" alt=""><figcaption><p>Danh sách đơn hàng</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FM44pblV1etCjocSu3136%2F49_tpage_bill_list.png?alt=media&amp;token=04c38930-8cff-4597-b939-0bc7243f775c" alt=""><figcaption><p>Phiếu mua hàng</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FVh8NctdiWUnUZW2S7DmP%2F50_tpage_bill_detail.png?alt=media&amp;token=2cb3f5c5-1287-4d9e-895e-bde63b1946bf" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FJyXAC9NJNydwbRZ7V1y1%2F51_tpage_bill_crud.png?alt=media&amp;token=2813cecf-a69f-4acb-971d-e371eb4f78b0" alt=""><figcaption><p>Thêm/ Sửa phiếu mua hàng</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2F1QWX4xYkbc16Do3N02C2%2F52_tpage_customer_list.png?alt=media&amp;token=f73853dc-f683-469d-8069-f104c499a17b" alt=""><figcaption><p>Danh sách khách hàng</p></figcaption></figure>


# KiotViet

Các vị trí hỗ trợ hiển thị nút gọi nhanh Click-2-Call

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FBUU6FRwd83NMHN15MT0O%2FScreenshot%202025-06-12%20at%203.52.38%E2%80%AFPM.png?alt=media&amp;token=2cf71180-d699-4699-a974-8af8f09bcbcc" alt=""><figcaption><p>Cấu hình cho extension</p></figcaption></figure>

```
kiotviet.vn
```

### Retail

* [x] Giao dịch / Đặt hàng
* [x] Giao dịch / Hoá đơn
* [x] Giao dịch / Vận đơn
* [x] Đối tác / Khách hàng
* [x] Đối tác / Nhà cung cấp
* [x] Đối tác / Giao hàng khác
* [x] Đối tác / Bác sĩ
* [x] Nhân viên / Danh sách
* [x] Quản lý người dùng
* [x] Quản lý chi nhánh
* [x] SaleOnline / Hội thoại
* [x] SaleOnline / Đơn hàng
* [x] POS / Bán hàng

<div><figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FE2IF6aEgbFUHg5sYcj0D%2F1_main_orders.png?alt=media&amp;token=8324a5eb-ca08-429c-8452-ff388545ea9e" alt=""><figcaption></figcaption></figure> <figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FmUliskMZJDLl683DSJua%2F2_main_invoices.png?alt=media&amp;token=71ab7ed8-2398-4b24-acea-215cc0d327af" alt=""><figcaption></figcaption></figure></div>

<div><figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FD9coUrmq8TiDeKufVtrn%2F3_main_order_delivery.png?alt=media&amp;token=b0effae1-8fa3-4ff0-b37b-0abc116d0b77" alt=""><figcaption></figcaption></figure> <figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2Fu2ao4mIoVoLPzjHhATw3%2F4_main_order_warramty.png?alt=media&amp;token=820ea57a-9875-460d-b364-9e6d96b179b1" alt=""><figcaption></figcaption></figure></div>

<div><figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FYuOB6T9Mg0pkaXUmgEP9%2F5_main_customers.png?alt=media&amp;token=88866559-7d92-495b-a170-43ef18ed43c9" alt=""><figcaption></figcaption></figure> <figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FQI0cXsXjJMP4AkVPSkAF%2F6_main_suppliers.png?alt=media&amp;token=d22c0ee5-ee5a-43c8-a3c1-7f755701ed4c" alt=""><figcaption></figcaption></figure></div>

<div><figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FwuPESk1g8W98lS1gqeQ2%2F7_main_partner_delivery.png?alt=media&amp;token=38e1416e-ca4b-4867-aaac-0557e92caf09" alt=""><figcaption></figcaption></figure> <figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2F9FEF4ygsVWeJeSfsF1Di%2F8_main_employees.png?alt=media&amp;token=b8e405eb-351f-471b-8f48-5455acce3290" alt=""><figcaption></figcaption></figure></div>

<div><figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FBzbNgrvNcYz0jwYrayNj%2F9_retail_users.png?alt=media&amp;token=41615763-4c65-41e0-9613-893f4ee6fcf0" alt=""><figcaption></figcaption></figure> <figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FmLV4fgovLJSu6VNl2nvE%2F10_retail_branches.png?alt=media&amp;token=652b5233-b29c-4b3f-be07-e2a7f27f51ce" alt=""><figcaption></figcaption></figure></div>

<div><figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FRKrH5AyZgFselooKBpUz%2F11_retail_doctors.png?alt=media&amp;token=6434a20d-23fc-4f11-9ae9-703e6b2e4d5a" alt=""><figcaption></figcaption></figure> <figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FN9P0SDHOvURclGIIgGMs%2F12_retail_cash_flow.png?alt=media&amp;token=996cca3b-fc35-4b75-ba3b-6923b0c23e6e" alt=""><figcaption></figcaption></figure></div>

<div><figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FKdosCD9rV0qW9yoN7I7E%2F13_retail_warranty.png?alt=media&amp;token=52cfff2e-d035-46c9-978f-22e7f94f2be6" alt=""><figcaption></figcaption></figure> <figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FA1DAti4HI5ZP1AzOqcIZ%2F14_sale_new_order.png?alt=media&amp;token=dd7c6de7-1319-40d1-9656-c13728375aa6" alt=""><figcaption></figcaption></figure></div>

<div><figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FRTHGB0SVkjQCLFLkeoZA%2F15_sale_update_order.png?alt=media&amp;token=3c7627fd-133b-4c52-89a1-d0c92eaa1df8" alt=""><figcaption></figcaption></figure> <figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FA9GXqMVt36nfpSF1D6QF%2F16_saleonline_orders.png?alt=media&amp;token=bff264b7-e93c-4fab-be51-1810e63fd05c" alt=""><figcaption></figcaption></figure></div>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FKXHjVoPJYZFbMRxzVpYk%2F17_saleonline_conversations.png?alt=media&amp;token=596e0eee-6e3a-405b-a450-c80e5b95f05c" alt=""><figcaption></figcaption></figure>

### Fnb

* [x] Giao dịch / Hoá đơn
* [x] Đối tác / Khách hàng
* [x] Đối tác / Nhà cung cấp
* [x] Đối tác / Giao hàng khác
* [x] Nhân viên / Danh sách
* [x] Quản lý chi nhánh
* [x] POS - Thu ngân
* [x] POS - Lễ tân

<div><figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FFLSytwM3UavGnpOq64Rr%2F1.1_fnb_invoices.png?alt=media&amp;token=5b5b0e32-39de-4174-a1e2-3a740f3d5f00" alt=""><figcaption></figcaption></figure> <figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FUo4VQO3s77gFdS59gSEa%2F1.2_fnb_invoices.png?alt=media&amp;token=47e75c84-277b-4885-ab62-0d25294fd68e" alt=""><figcaption></figcaption></figure></div>

<div><figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FgfWRzPlWf4iEHAVd4MUn%2F2_fnb_customers.png?alt=media&amp;token=291c1548-d424-4b0e-acc4-7faa234340de" alt=""><figcaption></figcaption></figure> <figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2Ftsgzuhhp7bF6iFUPGYvB%2F3_fnb_suppliers.png?alt=media&amp;token=7b67d40a-e7ac-4b70-83df-b6edb1649293" alt=""><figcaption></figcaption></figure></div>

<div><figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FAXjuqm0cxAtwoQvUZU89%2F4_fnb_partner_delivery.png?alt=media&amp;token=c597294d-1891-4073-acec-78260c79314d" alt=""><figcaption></figcaption></figure> <figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FvMDagmUm3XOlxx32vv4B%2F5_fnb_employees.png?alt=media&amp;token=4dbfa038-98aa-4449-8248-59264073a273" alt=""><figcaption></figcaption></figure></div>

<div><figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FRvhnUC0J6E6ybYh0sXbJ%2F6_fnb_branches.png?alt=media&amp;token=19c81378-1b20-437d-a70f-c5bf8e142b40" alt=""><figcaption></figcaption></figure> <figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FYia9RymwBB1q2Kr9nB62%2F7_fnb_pos_cashier.png?alt=media&amp;token=ef6e1666-8925-4b60-8769-57d6938f161b" alt=""><figcaption></figcaption></figure></div>

<div><figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FCVpIN4sSrQNmL4qee5wD%2F8_fnb_pos_reception_list.png?alt=media&amp;token=8a9de16a-a7cf-46f0-9093-cab788841e65" alt=""><figcaption></figcaption></figure> <figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FFvk1L3xGMALgrlq0KkIs%2F9_fnb_pos_reception_calendar.png?alt=media&amp;token=797732b2-f2ba-4d13-8d2d-14d26fa70def" alt=""><figcaption></figcaption></figure></div>

### Salon

* [x] Giao dịch / Hoá đơn
* [x] Đối tác / Khách hàng
* [x] Đối tác / Nhà cung cấp
* [x] Đối tác / Giao hàng khác
* [x] Nhân viên / Danh sách
* [x] Quản lý chi nhánh
* [x] POS - Thu ngân
* [x] POS - Lễ tân

<div><figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FF03Pqlh0XH94OROpkleq%2F1_salon_invoices.png?alt=media&amp;token=435d19e7-a922-4ffc-9445-2c5c7c61cf31" alt=""><figcaption></figcaption></figure> <figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2Fs1BMZKvAGSBX53m1axST%2F2_salon_customers.png?alt=media&amp;token=a1104dbb-51b0-4d6f-bee5-da5404c6b6f1" alt=""><figcaption></figcaption></figure></div>

<div><figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FRJ29eYLg4l2YMhVYvgMz%2F3_salon_suppliers.png?alt=media&amp;token=1ad91fbb-19fd-47a0-8cf9-3b97fc48af84" alt=""><figcaption></figcaption></figure> <figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FLuQcvx3Vq2rB3vrau3Ji%2F4_salon_customer_card_combo_list.png?alt=media&amp;token=12ad187c-87c3-48cb-b3fa-3158b0e5d4b6" alt=""><figcaption></figcaption></figure></div>

<div><figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FQyVKB3WJdnsE9H0KR8r3%2F5_salon_employees.png?alt=media&amp;token=416b32b6-884d-4f52-85bf-07184f937b4b" alt=""><figcaption></figcaption></figure> <figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FDuRVhCUURnoXLmVawfmk%2F6_salon_cash_flow.png?alt=media&amp;token=161e472d-2a27-4a26-8aea-7529ad46fbc3" alt=""><figcaption></figcaption></figure></div>

<div><figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2Fuf2xDVqZmuwWuaA0EI3u%2F7_salon_branches.png?alt=media&amp;token=ec4cdbd9-f1d1-4998-a735-b185e2fe2555" alt=""><figcaption></figcaption></figure> <figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2F9rbQkv5pNLvm34h1Jifi%2F8.2_salon_pos_calendar.png?alt=media&amp;token=50ad139c-ff3f-4bd0-a90c-a5906bf70b38" alt=""><figcaption></figcaption></figure></div>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FWGF6fLHXv2PFFVdHDVuT%2F8.1_salon_pos_calendar.png?alt=media&amp;token=91c14638-f6e8-45cd-92ab-3720af10f485" alt=""><figcaption></figcaption></figure>

### Hotel

* [x] Giao dịch / Đặt hàng
* [x] Giao dịch / Hoá đơn
* [x] Đối tác / Khách hàng
* [x] Đối tác / Nhà cung cấp
* [x] Nhân viên / Danh sách
* [x] Quản lý chi nhánh
* [x] POS - Lễ tân

<div><figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FJdyTjXBC6aHsWZjXKS5T%2F1_hotel_orders.png?alt=media&amp;token=4ab54687-0556-4691-926e-d3c184c4a546" alt=""><figcaption></figcaption></figure> <figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2Fj639odHEx7o7goM3dkf4%2F2_hotel_invoices.png?alt=media&amp;token=93d2d92a-3749-4be5-837f-ba2c6990e29d" alt=""><figcaption></figcaption></figure></div>

<div><figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FNcmQk0Gmj8Gyxul8MMSD%2F3_hotel_customers.png?alt=media&amp;token=5dec6b40-b897-41e2-af9a-b70f7ebecc54" alt=""><figcaption></figcaption></figure> <figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2F2RMs8Ic1m83RYkCJrmrH%2F4_hotel_suppliers.png?alt=media&amp;token=fc8d106a-0121-436c-bae3-2089197eb070" alt=""><figcaption></figcaption></figure></div>

<div><figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FUSPurXGZzFi4RV2tkX1Y%2F5_hotel_employees.png?alt=media&amp;token=b0173b6b-2c27-4e84-b567-633c9feb6924" alt=""><figcaption></figcaption></figure> <figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2Fn2t6DhN5Zct67IUMkg1n%2F6_hotel_branches.png?alt=media&amp;token=29650529-7897-464a-b18c-69fbce5b86ab" alt=""><figcaption></figcaption></figure></div>

<div><figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2F0jVyL1Jic2OArPbQHMot%2F0.3_hotel_pos_reservation.png?alt=media&amp;token=62c44e43-484d-432f-8b7e-0f6edd6a0c80" alt=""><figcaption></figcaption></figure> <figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FVaQ3RPtpdrxVqSFFSflV%2F0.4_hotel_pos_reservation.png?alt=media&amp;token=6c0d0ef0-d004-4b1b-909f-4758bde11688" alt=""><figcaption></figcaption></figure></div>

<div><figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FJWkz7tusfp2pUlSHTSCu%2F0.5_hotel_pos_reservation.png?alt=media&amp;token=693b086c-b7d0-4421-84c9-afc0182cda9d" alt=""><figcaption></figcaption></figure> <figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FHdc2N3a1ioYZK1pCotbF%2F0.6_hotel_pos_reservation.png?alt=media&amp;token=ff1679c1-6d61-40d8-a23c-8b36fb413a64" alt=""><figcaption></figcaption></figure></div>

<div><figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FHyPotn4b3eTw0MZuCnGd%2F0.1_hotel_pos_reservation.png?alt=media&amp;token=3c8c42f7-c7a9-4d87-bd91-ed8d02b6bb65" alt=""><figcaption></figcaption></figure> <figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2F628SHwq4JcPcODTI6w75%2F0.2_hotel_pos_reservation.png?alt=media&amp;token=4c57a3b1-11c8-4bcb-b980-e27512f78d0b" alt=""><figcaption></figcaption></figure></div>


# Bitrix24

Các vị trí hỗ trợ hiển thị nút gọi nhanh Click-2-Call

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2F8CddeSMJSBDL4jFtZ5sU%2FScreenshot%202025-06-12%20at%203.54.19%E2%80%AFPM.png?alt=media&amp;token=93233c21-945a-4b6e-8fb4-4346eb7fdf3d" alt=""><figcaption><p>Cấu hình cho extension</p></figcaption></figure>

```
bitrix24.vn,bitrix24.com
```

* [x] Danh sách liên lạc
* [x] Chi tiết liên lạc
* [x] Danh sách công ty
* [x] Chi tiết công ty
* [x] Các giao dịch - Kanban
* [x] Các giao dịch - Danh sách
* [x] Các giao dịch - Các hoạt động
* [x] Chi tiết giao dịch
* [x] Khách hàng tiềm năng - Kanban
* [x] Khách hàng tiềm năng - Danh sách
* [x] Khách hàng tiềm năng - Các hoạt động
* [x] Chi tiết khách hàng tiềm năng
* [x] Nhà cung cấp: công ty
* [x] Nhà cung cấp: liên lạc
* [x] Tìm nhân viên
* [x] Chi tiết nhân viên
* [x] Bản tin nhân viên
* [x] Booking
* [x] Bản tin
* [x] Các bên ký kết
* [x] Chi tiết cuộc gọi

<div><figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2F0iGZwmXUEHKReEkqDBh1%2F1_crm_contact_list_1.png?alt=media&amp;token=ccadaffa-a972-451d-a1e5-6b6107a3e6bf" alt=""><figcaption></figcaption></figure> <figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FxpKHavVD65wlWwSJ3egO%2F2_crm_contact_list_2.png?alt=media&amp;token=2e33a370-4e90-46dc-8190-3800728faac6" alt=""><figcaption></figcaption></figure></div>

<div><figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2Fc0ERrBeq3SPd8pHWZoXs%2F3_crm_contact_list_3.png?alt=media&amp;token=d4f1a261-4008-47fe-bee1-a9957e1cbef4" alt=""><figcaption></figcaption></figure> <figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FXpveY5zQy8ReGb2Et7wp%2F4_crm_activity_planner.png?alt=media&amp;token=85b5807c-1dc3-416e-aad3-8cadddeab2c8" alt=""><figcaption></figcaption></figure></div>

<div><figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2F0Yx07VYiYG6uMSR5vh5o%2F5_crm_contact_detail_1.png?alt=media&amp;token=248ef9be-2d93-4c80-a4d7-4de0b8161b2c" alt=""><figcaption></figcaption></figure> <figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FidI50mJERxFFYpNlOu9K%2F6_crm_contact_detail_2.png?alt=media&amp;token=e29a8be2-dcf1-46a1-a489-62dc32bf9956" alt=""><figcaption></figcaption></figure></div>

<div><figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FsmZ0q6yxi7vWSB1m58Zk%2F7_crm_contact_detail_3.png?alt=media&amp;token=61f06f6e-63fc-4a4a-b75b-623c1891e62f" alt=""><figcaption></figcaption></figure> <figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FUKTuOeeEa9u0fNilPczs%2F8_crm_contact_detail_4.png?alt=media&amp;token=e26dac72-4961-4d3e-a264-307d7d78a0c5" alt=""><figcaption></figcaption></figure></div>

<div><figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2Fnon6F3qKl52dnSiccLIb%2F9_crm_contact_detail_5.png?alt=media&amp;token=719926c7-8363-4877-b1fa-63b94d3724b0" alt=""><figcaption></figcaption></figure> <figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FzxlBs1PRJsYPjG0i76pg%2F10_crm_bill_detail.png?alt=media&amp;token=8cae3772-c4c5-48e3-9d24-f783dcc6f742" alt=""><figcaption></figcaption></figure></div>

<div><figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FKpdSpomvaISZG88hrweJ%2F11_crm_detail_detail.png?alt=media&amp;token=16e07d3b-ba4b-47fb-a134-ef987cefc0e4" alt=""><figcaption></figcaption></figure> <figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FVBAV6KceEwdtYUG1kIMZ%2F12_crm_company_list.png?alt=media&amp;token=10bf07a2-d83b-4d1c-ab58-e1df959ea098" alt=""><figcaption></figcaption></figure></div>

<div><figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FNZl6PteynyTmTdNpeya7%2F13_crm_company_detail.png?alt=media&amp;token=bcd6d0eb-5034-4e43-8166-28e94a59ddef" alt=""><figcaption></figcaption></figure> <figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2Ft3abVOSiwosJNm1Ew9kl%2F14_sign_contact.png?alt=media&amp;token=c4b0e307-be4a-41f3-ba70-59f16ecc470e" alt=""><figcaption></figcaption></figure></div>

<div><figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2Ffw41E82XAugXyxX5HyCO%2F15_shop_documents_contractors.png?alt=media&amp;token=2c916aa9-e6ef-4a9f-bd00-a9c0bc4d18b2" alt=""><figcaption></figcaption></figure> <figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2F8ouD1JFxLSzOSaYNOB81%2F16_shop_documents_contractors_contacts.png?alt=media&amp;token=fe77d4b2-c2f4-48ad-9bf3-e8d6e5923c76" alt=""><figcaption></figcaption></figure></div>

<div><figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FEBx4c7PiBWwJozfBUet1%2F17_crm_lead_kanban.png?alt=media&amp;token=6c061263-a5ac-400f-b092-c7438aeb4b52" alt=""><figcaption></figcaption></figure> <figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FpDxMtw7G7P6SYIUkUNFP%2F18_crm_lead_list.png?alt=media&amp;token=303e69de-7ac5-4cc0-a8d1-d3183d6aa00e" alt=""><figcaption></figcaption></figure></div>

<div><figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FGFd1QLNJOtcFtiYwwOiz%2F19_crm_lead_activity.png?alt=media&amp;token=97ec4007-ecb0-4cac-9b00-d93891e3a25c" alt=""><figcaption></figcaption></figure> <figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2F04YEfrhJeiAtgmnGjLsH%2F20_crm_deal_kanban.png?alt=media&amp;token=065cac7c-ad98-4193-bc87-8b65e208e359" alt=""><figcaption></figcaption></figure></div>

<div><figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FqSlodtKAmY326xTt8Z5G%2F21_crm_deal_list.png?alt=media&amp;token=5de77ad5-cd74-4b09-bd22-ea090c911e1f" alt=""><figcaption></figcaption></figure> <figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2F7eOGNplV6HFonykyfeHV%2F22_crm_deal_activity.png?alt=media&amp;token=a02c19db-50c9-496d-985d-17e550bddaf2" alt=""><figcaption></figcaption></figure></div>

<div><figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2Fcvh6nMF7CB99Kb895yX0%2F23_crm_company_employee_list.png?alt=media&amp;token=4f35aaa6-5f5f-4a04-82ea-cd8f10b3ae5d" alt=""><figcaption></figcaption></figure> <figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FtYswmWYre5oa9Iad6bXU%2F24_crm_company_employee_detail.png?alt=media&amp;token=37933dce-fbb3-4524-8092-4a2de02f3ef9" alt=""><figcaption></figcaption></figure></div>

<div><figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FXQPrtv0HNmfPtNDiWUf2%2F25_crm_company_employee_blog.png?alt=media&amp;token=36fb7e7f-6aba-4dcf-90fd-d68af055de9f" alt=""><figcaption></figcaption></figure> <figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FhT8FZ2S5k5JtUIYlTr3M%2F26_stream.png?alt=media&amp;token=c57b52ae-3ca6-454e-bb1f-1e0f710eb776" alt=""><figcaption></figcaption></figure></div>

<div><figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FTZVjiGHQ8SPhWFJk2j2G%2F27_booking.png?alt=media&amp;token=d011f1ba-05e1-4a7a-b82e-b2a5ce553326" alt=""><figcaption></figcaption></figure> <figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FNGBwzU1yFnLZuwQnv8iZ%2F28_telephony_detail.png?alt=media&amp;token=1a1e63f6-ad5c-4410-89cd-5f8fdded534c" alt=""><figcaption></figcaption></figure></div>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FzlSN0WGohpMoVacfryML%2F29_bx_im_messenger.png?alt=media&amp;token=b3a531cd-a51d-4984-87ba-492dcb02b8d5" alt=""><figcaption></figcaption></figure>


# HubSpot

Các vị trí hỗ trợ hiển thị nút gọi nhanh Click-2-Call

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FkU5V4Bk9QcgSshIcjEy0%2FScreenshot%202025-06-12%20at%203.55.00%E2%80%AFPM.png?alt=media&amp;token=8a3237d6-8a9f-4280-bea9-e15a5494eca2" alt=""><figcaption><p>Cấu hình cho extension</p></figcaption></figure>

```
hubspot.com
```

## CRM

* [x] Contacts (https\://\*.hubspot.com/contacts/\*/objects/0-1/views/\*/list)
* [x] Companies (https\://\*.hubspot.com/contacts/\*/objects/0-2/views/\*/list)
* [x] Deals (https\://\*.hubspot.com/contacts/\*/objects/0-3/views/\*/list)
* [x] Contact Record (https\://\*.hubspot.com/contacts/\*/record/\*/\*)
* [x] Contact Fitler Detail (https\://\*.hubspot.com/contacts/\*/objectLists/\*/filters)
* [x] Calls (https\://\*.hubspot.com/contacts/\*/objects/0-48/views/\*/list)
* [x] Call Review (https\://\*.hubspot.com/calls/\*/review/\*)
* [x] Inboxs (https\://\*.hubspot.com/live-messages/\*/inbox/\*#\*)
* [x] Tasks (https\://\*.hubspot.com/tasks/\*/view/\*)

<div><figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FIzcN42nSeVQauKCqJRjc%2F1_crm_contacts_list.png?alt=media&amp;token=21af9a89-0cd0-4303-a93a-964e6e71f145" alt=""><figcaption></figcaption></figure> <figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FHPIWSXJt3n9sXSwuci9v%2F2_crm_contacts_filter.png?alt=media&amp;token=7da791f0-7480-46fe-a70b-dfdabcc9cbbb" alt=""><figcaption></figcaption></figure></div>

<div><figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FXoeVRAt7ELjDbczzzEvG%2F3_crm_contacts_detail_1.png?alt=media&amp;token=149db5a1-373b-49d0-9c4c-e52372436fae" alt=""><figcaption></figcaption></figure> <figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2Fm7TMvYyM64QIWT1V4UC2%2F3_crm_contacts_detail_2.png?alt=media&amp;token=4d8fe8d1-909b-4519-87ba-37547e26bc43" alt=""><figcaption></figcaption></figure></div>

<div><figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FlaMu3b4LJ1XZuTx0ehKh%2F4_crm_calls_list.png?alt=media&amp;token=10e407d6-00db-4e03-a3f4-f2640d94cdd7" alt=""><figcaption></figcaption></figure> <figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FZnJNbyi4PnpHGU6fDwvb%2F4_crm_calls_preview_1.png?alt=media&amp;token=a0fff44c-2f7c-49b1-9c99-c8d1eff22b4b" alt=""><figcaption></figcaption></figure> <figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2F9vhbzWCD2QXuqtFj4Oij%2F4_crm_calls_preview_2.png?alt=media&amp;token=d5346f5c-a252-4a54-a463-797d625d1be5" alt=""><figcaption></figcaption></figure></div>

<div><figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FcrkvBRB9G627gORKL6Bu%2F5_crm_calls_review_associations_1.png?alt=media&amp;token=8ac0360e-b635-4c39-b315-4e99ea690604" alt=""><figcaption></figcaption></figure> <figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FCYwZxjowMJpfYfIGcAjD%2F5_crm_calls_review_associations_2.png?alt=media&amp;token=7eec0212-d121-4a59-8352-8c08a2b19f78" alt=""><figcaption></figcaption></figure></div>

<div><figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FAm9HiMH74hSlP7T6B8DZ%2F6_crm_companies_list_1.png?alt=media&amp;token=39cbc239-cbf0-4655-840b-28445e50648c" alt=""><figcaption></figcaption></figure> <figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FSJsxmezKn9uceSilSrXi%2F6_crm_companies_list_2.png?alt=media&amp;token=0c84197c-cea2-4ed5-81e1-e2cdecbdfcf8" alt=""><figcaption></figcaption></figure> <figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FUZGWmOFesVHgLcSvAts0%2F7_crm_companies_detail.png?alt=media&amp;token=28862eb7-9833-4489-a108-81572b24f780" alt=""><figcaption></figcaption></figure></div>

<div><figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FHoBUmQzHXxBfD3tax9De%2F8_crm_deals_list.png?alt=media&amp;token=aeafd863-9d66-4b5c-b939-4ef0518f04f4" alt=""><figcaption></figcaption></figure> <figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2F2mvtdV6I6JfhbyCBWMla%2F9_crm_deals_detail.png?alt=media&amp;token=88288056-4411-4324-98b9-1bbaf481fcc7" alt=""><figcaption></figcaption></figure></div>

<div><figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2Fsw8w6Sjd3cNuGRLxI4Vv%2F10_crm_tickets_list.png?alt=media&amp;token=fc339a9c-8728-4ac7-a871-7d4f6c8f8ed5" alt=""><figcaption></figcaption></figure> <figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2Fce7ZeSj5XvgNvl7kRo7f%2F11_crm_tickets_detail.png?alt=media&amp;token=33ec13f0-2087-4176-8e3d-02a271cef2b0" alt=""><figcaption></figcaption></figure></div>

<div><figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FtY83HzPuCVZueADVRVX1%2F12_crm_inboxs_1.png?alt=media&amp;token=b0ad6cd4-1101-46b9-a25d-e28b6a96eb7e" alt=""><figcaption></figcaption></figure> <figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FflxdVplxDP1oCv3mtcfg%2F12_crm_inboxs_2.png?alt=media&amp;token=750c1bbc-ee73-4a72-b2d9-e0dbfa34ca55" alt=""><figcaption></figcaption></figure></div>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FblXBElP8irHIyyumVA7h%2F13_crm_tasks_list.png?alt=media&amp;token=5d0ee47e-c92d-4437-9206-9e58c365005d" alt=""><figcaption></figcaption></figure>

## Sales

* [x] Playlist (https\://\*.hubspot.com/prospecting/\*/playlist/\*/\*)
* [x] Leads (https\://\*.hubspot.com/prospecting/\*/leads/view/\*)
* [x] Deals (https\://\*.hubspot.com/prospecting/\*/deals/\*)
* [x] Tasks (https\://\*.hubspot.com/prospecting/\*/tasks/view/\*)
* [x] Execution (https\://\*.hubspot.com/prospecting/\*/execution/adhoc/\*)
* [x] Forecast Detail (https\://\*.hubspot.com/forecasting/\*/owner/\*)

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FvOER7LUs7OjTY1vuR28F%2F14_sales_workspace_summary.png?alt=media&amp;token=60cfbf42-e0de-4472-8ab8-fd28b7f1baf0" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FbPEx66cmPxUURupHhCHl%2F15_sales_workspace_playlist.png?alt=media&amp;token=e653b499-46cb-4cbf-81e3-9a8dcfa7063a" alt=""><figcaption></figcaption></figure>

<div><figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FQE5RyCeCc3xPdFoSvKS7%2F16_sales_workspace_leads_1.png?alt=media&amp;token=cbe40ab7-4245-48c5-a3b3-a7a7a0ebc238" alt=""><figcaption></figcaption></figure> <figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2Fn0i76afewkXdorBQaBTt%2F16_sales_workspace_leads_2.png?alt=media&amp;token=58fcb120-83d0-4612-8b10-4136b163f195" alt=""><figcaption></figcaption></figure></div>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FRyR3wRtlg0N1Qlybvhlb%2F17_sales_workspace_deals.png?alt=media&amp;token=ef1f3e03-6d72-4ecf-bcb1-e498c6b582ba" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FbRu873h9NBMXdhQms0Cm%2F18_sales_workspace_tasks.png?alt=media&amp;token=d55ac6ff-3727-4bcb-9a38-104e806abc2b" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FGfuuL9L8tmMX4dkMFgbJ%2F19_sales_forecast_detail.png?alt=media&amp;token=5dca7ae4-3d3c-4960-8093-b43cb21cc435" alt=""><figcaption></figcaption></figure>

## Commerce

* [x] Subscriptions (https\://\*.hubspot.com/contacts/\*/objects/0-69/views/\*/list)
* [x] Invoices (https\://\*.hubspot.com/contacts/\*/objects/0-53/views/\*/list)

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FyrBIDw90XZUjHeM6NBIP%2F20_commerce_subscriptions_list.png?alt=media&amp;token=3f18dc86-e2c6-4896-b0e3-76cfd8eba024" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FsqKlMRT6DW8BfdA1IBGF%2F21_commerce_invoices_list.png?alt=media&amp;token=ab5ca949-09d5-477e-9847-9530f9b63b13" alt=""><figcaption></figcaption></figure>


# Web SDK

OMICall WebSDK: công cụ bao gồm thư viện và tài liệu mà OmiCall cung cấp cho đối tác, để đối tác xây dựng tính năng call ngay chính trên ứng dụng web của mình.

Các phiên bản hiện có:

## Version 3 - OMICallSDK

Latest version: 3.0.41 (2026-01-15)

[Integration](/sdk/web-sdk/v3-integration) - [Changelog](/sdk/web-sdk/v3-changelog)

## Version 2 - omiSDK

Latest version: 2.1.25 (2025-10-12)

[Integration](/sdk/web-sdk/v2-integration) - [Changelog](/sdk/web-sdk/v2-changelog)


# v3 Integration

OMICallSDK: phiên bản SDK thứ 3 dành cho trình duyệt của OMICall, áp dụng mọi công nghệ mới nhất và hầu hết tính năng hiện có của OMICall SaaS, đem lại hiệu năng và chất lượng cuộc gọi tốt nhất.

## Giới thiệu

\- Sử dụng Webpack và TailwindCSS để tối ưu kích thước tập tin SDK cần nhúng\
\- Áp dụng Vanilla JS để xử lý hiển thị lẫn tính năng, đem lại hiệu năng tốt nhất\
\- Tự động giữ kết nối với tổng đài mỗi khi trạng thái kết nối mạng thay đổi\
\- Tính điểm chất lượng tín hiệu của cuộc gọi realtime

## Tích hợp

### Example

{% file src="/files/TicYmUp3Q9Vbl1YiE5rw" %}

Bên trên là code mẫu luồng tích hợp và sử dụng SDK với UI mặc định.

### Nhúng script

* **Cách 1**:  thông qua CDN, khai báo thẻ \<script>

```html
<body>
    <!-- Your app HTML -->
    <script
        omi-call-sdk
        type="text/javascript"
        src="https://cdn.omicrm.com/sdk/web/{{version}}/core.min.js"
    ></script>
</body>
```

Để lấy thông tin {{version}}, xem tại: [Web SDK](/sdk/web-sdk) hoặc [v3 Changelog](/sdk/web-sdk/v3-changelog)

* **Cách 2**: Thông qua `npm` : comming soon...

### Khởi tạo

Sau khi script `core.min.js` được load xong, sẽ có thêm biến global `window.OMICallSDK`

**`OMICallSDK`**: biến `global` chính của call SDK, quản lý kết nối tới tổng đài và xử lý các sự kiện của cuộc gọi.

**`OMICallUI`**: biến `global` khi sử dụng UI mặc định của SDK, có một số method để chủ động tương tác với UI mặc định.&#x20;

Dưới đây là mô tả các tuỳ chọn để khởi tạo SDK:

```groovy
type UIConfigs = {
    /*
     *  toggleDial: trạng thái hiển thị nút mở giao diện nhập số gọi ra
     * default: 'show'
     */
    toggleDial?: 'show' | 'hide';
    /*
     * dialPosition: vị trí hiển thị nút mở giao diện nhập số gọi ra
     * default: 'right'
     */
    dialPosition?: 'left' | 'right';
    /*
     * theme: màu sắc của giao diện SDK
     */
    theme?: {
        white: '#ffffff';
        black: '#000000';
        primary: '#1e3150';
        info: '#00b1ff';
        success: '#56cc6e';
        warning: '#fea220';
        error: '#ff5955';
        pink: '#e82a8f';
        purple: '#a540b8';
        blue: '#57bfdb';
    };
    /*
     * cấu hình tự động hiển thị cuộc gọi mới ở chế độ thu gọn
     * áp dụng cả cuộc gọi ra lẫn gọi vào
     * default: false
     */
    minimizeNewCall?: boolean;
};
```

```typescript
type CtaButtonOnClick = (callData: CallData) => void;

type CtaButton = {
    action: string;
    label: string;
    /*
     * get icon `code` from:
     * https://cdn.omicrm.com/common/icon/fluent-systems-filled/index.json
     */
    icon: string;
    /*
     * override callback chung cho riêng button này
     */
    onClick?: CtaButtonOnClick;
};

type CallTab = {
    id: string;
    label: string;
    /*
     * Các cách để xử lý hiển thị nội dung tuỳ biến:
     *
     * #1: set trực tiếp HTML/CSS cần thiết
     * tabNode.innerHTML = '<div>your HTML/CSS</div>';
     *
     * #2: với React 18+, dùng thư viện react-dom/client
     * createRoot(tabNode).render(<YourComponent />);
     *
     * #3: các framework khác tương tự ReactJS
     */
    render: (
        callData: CallData,
        tabNode: HTMLDivElement,
        tabDetail: {
            id: string;
            label: string;
        },
    ) => void;
};
```

```typescript
type SdkInitConfigs = {
    /*
     * lng: ngôn ngữ hiển thị trên UI
     * default: 'vi'
     */
    lng?: 'vi' | 'en' | 'km';
    /*
     * ui: cấu hình giao diện mặc định của SDK
     */
    ui?: UIConfigs;
    /*
     * control ringtone volume
     * default: 1
     */
    ringtoneVolume?: number /* 0 -> 1 */;
    /*
     * control phone number masking
     */
    phoneMasked?: {
        enable: boolean;
        /*
         * length: độ dài cho phép hiển thị số
         */
        len: number;
        /*
         * character: *, #, x, ✨, ...
         */
        char: string;
        /*
         * ltr: left-to-right
         */
        ltr: boolean;
    };
    /*
     * show list of CTA buttons, under remote contact info of calling dialog
     */
    ctaButtons?: {
        unknown?: CtaButton[]; // show when `remoteContact` is null
        exists?: CtaButton[]; // show when `remoteContact` is not null
        base?: CtaButton[]; // always show these buttons
        onClick?: CtaButtonOnClick; // callback chung cho tất cả cta button
    };
    /**
     * thay thế UI "Thông tin cuộc gọi" bằng UI dạng tabs
     * vẫn giữ lại giao diện cũ dưới dạng tab cuối cùng
     */
    callTabs?: CallTab[];
    /**
     * your main app's root body element
     * use for app need to passing a custom tab component into call dialog
     * use this option if your component required `HOCs` or `Context Provider`
     */
    rootBody?: HTMLElement;
    /**
     * custom search remote contact function
     */
    searchRemoteContact?: (callData: CallData) => Promise<RemoteContact | null>;
    /**
     * check the permission to make a call is allowed or not
     */
    validateCallOut?: (
        remoteNumber: string,
        options: MethodMakeCallOptions,
    ) => Promise<{ status: boolean; reason?: string }>;
    /**
     * list of custom icons using in default UI
     * will be loaded and caching
     */
    icons: string[];
    sounds?: Record<
        | 'ringtone' /* sound when have incoming call */
        | 'ringing' /* sound when outgoing call don't have "early-media" */
        | 'accepted'
        | 'ended',
        {
            src: string;
            volume: number /* 0 -> 1 */;
        }
    >;
    /**
     * control searching recent call from OMICall or not
     */
    searchRecentCall?: boolean;
};
```

<pre class="language-typescript"><code class="lang-typescript"><strong>const SdkInitConfigs: Partial&#x3C;SdkInitConfigs> = {
</strong>    /* tuỳ chỉnh cấu hình */
};
const initSuccess: Boolean = await OMICallSDK.init(SdkInitConfigs);
if (!initSuccess) {
    // nếu khởi tạo SDK có lỗi, không thực hiện register tổng đài
    return;
}
</code></pre>

### Kết nối

```typescript
type SdkRegisterConfigs = {
    /**
     * `isGuest`: skip all authentication and internal APIs
     * still allow to connect and make call with switchboard
     */
    isGuest?: boolean;
    sipRealm: string;
    sipUser: string;
    sipPassword: string;
};

type SdkRegisterResult = {
    status: boolean;
    message?: string;
    error?: string;
};

/* Thông tin số nội bộ */
const sipRealm = 'demo01'; // domain tổng đài
const sipUser = '100'; // số nội bộ
const sipPassword = 'ABC123!@#'; // mật khẩu của số nội bộ

// Để kết nối tới tổng đài
const registerStatus: SdkRegisterResult = await OMICallSDK.register({
    sipRealm,
    sipUser,
    sipPassword,
} as SdkRegisterConfigs);

// Để ngắt kết nối tới tổng đài
OMICallSDK.unregister();
```

Để lấy thông tin số nội bộ:

* **Cách 1**: dùng API public tại [Tổng đài](/omicall-api/call-center#danh-sach-so-noi-bo)
* **Cách 2**: truy cập màn hình **Cấu hình ▸ Tổng đài ▸ Số nội bộ** trong website OMICall

### Methods

1. Để gọi nhanh một số sđt, sử dụng function: <br>

   ```typescript
   type SipNumber = {
       number: string;
   };
   type RemoteContact = {
       name: string;
       avatar?: string; // URL | Base64
       gender?: 'male' | 'female' | 'other';
   };
   type MakeCallOptions = {
       isVideo?: boolean;
       sipNumber?: SipNumber;
       remoteContact?: RemoteContact;
       /* userData: custom data, will be attach to call history */
       userData?: string;
   };
   const remoteNumber: string = ''; /* phone number or Zalo User ID */
   const options: MakeCallOptions | null = null;
   OMICallSDK.makeCall(remoteNumber, options);
   ```
2. Để mở/ đóng cửa sổ nhập số gọi ra của UI mặc định: `OMICallUI.toggleDial();`
3. Để thực hiện tạo phiên gọi tới số điện thoại cho các phiên đăng nhập (ví dụ thao tác click-2-call từ web để gọi ra nhanh cho 1 SĐT bằng máy bàn):<br>

   ```javascript
   const remoteNumber = ''; // Số điện thoại cần gọi, bắt buộc
   const sipNumber = ''; // Số hotline muốn dùng để gọi ra, không bắt buộc
   OMICallSDK.remoteCall(remoteNumber, sipNumber);
   ```

### Sự kiện & Dữ liệu

```typescript
/*
  Một eventName có thể đăng ký bởi nhiều callback function, vậy nên khi huỷ đăng ký,
  cần truyền đúng eventCallback đã đăng ký trước đó
*/
OMICallSDK.on(eventName, eventCallback);
OMICallSDK.off(eventName, eventCallback);

type EventName =
  // event trạng thái kết nối tổng đài, callback data: `type RegisterData`
  'register'
  // các events của cuộc gọi, callback data: `type CallData`
  | 'connecting' // khi cuộc gọi ra bắt đầu kết nối
  | 'ringing' // khi cuộc gọi bắt đầu đổ chuông
  | 'on_ringing' // mỗi giây, khi đang đổ chuông
  | 'accepted' // khi cuộc gọi được bắt máy
  | 'on_calling' // mỗi giây, khi đang trong cuộc gọi đã bắt máy
  | 'set_sip_number' // khi có được số hotline đang dùng để gọi ra
  | 'ended' // khi cuộc gọi kết thúc
;

type RegisterData = {
    status: 'connecting' | 'connected' | 'disconnect';
    name: string; // đa ngôn ngữ của trạng thái kết nối
};

type CallData = {
    uid: string; // UUID tự sinh
    uuid?: string; // UUID từ tổng đài
    state: 'connecting' | 'ringing' | 'accepted' | 'ended'; // trạng thái hiện tại
    direction: 'outbound' | 'inbound';
    isVideo: boolean;
    isOutbound: boolean;
    isInternal: boolean;
    isHangup?: boolean; // khi người dùng chủ động từ chối cuộc gọi
    sipNumber?: SipNumber;
    remoteContact?: RemoteContact;
    remoteNumber: string;
    displayNumber: string; // áp dụng theo phân quyền ẩn sđt
    streams: Record<'local' | 'remote', MediaStream>;
    players: Record<'local' | 'remote', HTMLVideoElement>;
    startTs: number; // thời gian bắt đầu cuộc gọi, Timestamp
    startAt: string; // thời gian bắt đầu cuộc gọi, format: HH:mm:ss
    held: boolean; // trạng thái giữ cuộc gọi
    audio: boolean; // trạng thái bật/ tắt microphone
    video: boolean; // trạng thái bật/ tắt camera
    ua: string; // window.navigator.userAgent
    devices: {
        audio: boolean;
        video: boolean;
    }; // trạng thái khả dụng của thiết bị microphone/ camera
    rtcpStat: any; // thống kê chất lượng kết nối của cuộc gọi
    rejectCode?: string; // mã lỗi từ tổng đài
    blockedProvider?: string; // nhà mạng của SĐT từ chối cuộc gọi
    ringingDuration: CallDuration;
    callingDuration: CallDuration;
    userData?: string;
    // internal data
    isEnded?: boolean; // trạng thái cuộc gọi đã kết thúc
    // các function để tương tác với cuộc gọi
    end: () => void; // hành động chung để kết thúc cuộc gọi
    decline: () => void; // hoàn toàn kết thúc cuộc gọi tới, không tiếp tục phân bổ cuộc gọi
    accept: () => void;
    mute: (cb?: () => boolean) => void; // bật/ tắt microphone, `cb` trả về trạng thái mới
    camera: (cb?: () => boolean) => void; // bật/ tắt camera, `cb` trả về trạng thái mới
    hold: (cb?: () => boolean) => void; // bật/ tắt giữ cuộc gọi, `cb` trả về trạng thái mới
    dtmf: (tone: string) => void; // gửi tương tác bấm phím, mỗi `tone` là 1 ký tự [0-9*#]
    transfer: (target: string) => void; // target: số nội bộ, nhóm nội bộ, nhóm bên ngoài, tương tác bấm phím
    save: (
        info: {
            note?: string;
            tags?: string[];
        },
        onSave: () => void,
        onFinish: () => boolean
    ) => void; // gọi function này, khi bạn muốn lưu note hoặc tags vào OMICall
    /**
     * cho phép chủ động trigger việc phóng to/ thu nhỏ UI của call dialog
     * @param getCustomPosition: cho phép tuỳ biến vị trí tiếp theo sẽ hiển thị, sau khi cập nhật kích thước UI
     */
    minimize: (getCustomPosition?: (data: { width: number; height: number }) => { x: number; y: number }) => void;
};

type SipNumber = {
    // thông tin luôn có
    number: string;
    /*
        Các data khác chỉ có khi gọi bằng UI mặc định
        Cấu trúc riêng của OMICall, có thể thay đổi trong tương lai
        Không khuyến khích dử sụng
    */
};

type RemoteContact = {
    name: string;
    avatar?: string; // URL | Base64
    gender?: 'male' | 'female' | 'other';
};

type CallDuration = {
    value: number; // 0
    text: string; // '00:00'
};
```

### Giao diện tuỳ biến

Khi sử dụng SDK cho giao diện tuỳ biến, hãy đảm bảo thực hiện đủ các nghiệp vụ bên dưới:\
1\. Sau khi đã đảm bảo SDK đã được tải, hãy [#khoi-tao](#khoi-tao "mention") SDK \
2\. [#ket-noi](#ket-noi "mention") tới tổng đài\
3\. Đăng ký các sự kiện kết nối và trạng thái của cuộc gọi theo [#su-kien-and-du-lieu](#su-kien-and-du-lieu "mention")\
4\. Cache lại giá trị `Object` `CallData` trong event callback phía dưới:\
&#x20;  \- Event `connecting` cho cuộc gọi ra\
&#x20;  \- Event `ringing` cho cuộc gọi đến\
5\. Render 2 thẻ `<video />` ứng với 2 người trong cuộc gọi (nên để 2 thẻ này là children của dialog cuộc gọi tuỳ biến):

```html
<video 
    id="${callData.uid}-local"
    style="display:none"
    playsinline autoplay hidden mute
/>
<video
    id="${callData.uid}-remote"
    style="display:none"
    playsinline autoplay hidden
/>
```

6\. Dùng các method trong `CallData` để:\
&#x20;\- Nhận cuộc gọi: `callData.accept();`\
&#x20;\- Từ chối hoặc kết thúc cuộc gọi: `callData.end();`\
&#x20;\- Bật/ Tắt microphone: `callData.mute(cb);`\
&#x20;\- Bật/ Tắt camera: `callData.camera(cb);`\
&#x20;\- Bật/ Tắt giữ cuộc gọi: `callData.hold(cb);`\
&#x20;\- Gửi tương tác bấm phím: `callData.dtmf(tone);`\
&#x20;\- Chuyển tiếp cuộc gọi: `callData.transfer();`\
&#x20;\- Lưu ghi chú hoặc Tag vào OMICall: `callData.save({ note:'', tags: ['test'] });`

## Giao diện mặc định

### Screenshots

<div><figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FWsFDN1IPCIFmaFbRD1Gs%2F01_img_dial_dialog.png?alt=media&amp;token=9f56dbf8-021e-481d-b6dd-a6ae123133c0" alt=""><figcaption><p>UI gọi ra</p></figcaption></figure> <figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FR1CwwXDMaQHdGJcc1AjW%2F02_img_dial_tab_call_history.png?alt=media&amp;token=3f329c5e-bdb8-47be-9501-96eb26c83240" alt=""><figcaption><p>Tab lịch sử cuộc gọi</p></figcaption></figure></div>

<div><figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FktI5SX7JUSUn8wDTsLDL%2F03_img_dial_tab_internal_number.png?alt=media&amp;token=ad0c37e9-9f94-47f3-bde5-e74f2fd497e4" alt=""><figcaption><p>Tab toàn bộ số nội bộ của doanh nghiệp</p></figcaption></figure> <figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FrXNoCxYIGHWkzfYFLboN%2F04_img_dial_tab_key_interaction.png?alt=media&amp;token=8830a4de-885e-4de5-86cc-e30709080d51" alt=""><figcaption><p>Tab toàn bộ cấu hình tương tác phím</p></figcaption></figure></div>

<div><figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2F0eKymIZf8OrEifKQpVEk%2F05_img_sip_number_menu.png?alt=media&amp;token=7528e9df-7bea-4fdf-aed9-03b8632804e5" alt=""><figcaption><p>UI chọn đầu số gọi ra</p></figcaption></figure> <figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FK8zACMO8bcgTqwrCEbHl%2F06_img_agent_call_setting_menu.png?alt=media&amp;token=50322176-8e0a-4acc-957e-3cc243c60093" alt=""><figcaption><p>UI cấu hình cuộc gọi của nhân viên (theo phân quyền)</p></figcaption></figure></div>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2F9nDTmobKIvTdkVb6bcTq%2F07_img_calling_dialog_1.png?alt=media&amp;token=45bd436b-901c-4c4c-836e-87344264965f" alt=""><figcaption><p>UI trong cuộc gọi + Input tương tác bấm phím</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2Ft0gRZqHBITkrNybM9xzf%2F08_img_calling_dialog_2.png?alt=media&amp;token=ca8112b6-206a-4e51-86e2-78e522b8d709" alt=""><figcaption><p>UI trong cuộc gọi + Popup chuyển tiếp cuộc gọi</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FynSfMhO75R6Fp63yyOob%2F09_img_calling_dialog_minimized_1.png?alt=media&amp;token=9401f52e-c0ac-4410-9ca6-923bcb335289" alt=""><figcaption><p>UI gọi khi đang thu nhỏ</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FmANW8LfK3Ay9fTlgF89k%2F10_img_calling_dialog_minimized_2.png?alt=media&amp;token=94e77633-6148-47bb-957b-78ea02d93d5e" alt=""><figcaption><p>UI Gom cụm các cuộc gọi đang thu nhỏ</p></figcaption></figure>

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2F7Z3zbtS4UIrhU7tF0lkv%2Fpreview%20new%20callCtas%20%2B%20callTabs.webp?alt=media&amp;token=575b2e29-a95d-45fc-be3b-808ad779063b" alt=""><figcaption><p>UI tuỳ biến nút CTAs dưới thông tin người gọi và Tabview cho thông tin cuộc gọi</p></figcaption></figure>

### Tính năng

* [x] Hỗ trợ đa ngôn ngữ:
  * [x] Tiếng Việt
  * [x] Tiếng Anh
  * [x] Tiếng Cambodia
* [x] Nút ẩn/ hiện cửa sổ gọi ra
  * [x] Đổi được vị trí hiển thị: `ui.dialPosition = left | right`
  * [x] Có thể ẩn được nút ẩn/ hiện: `ui.toggleDial = show | hiden`
  * [x] Xem được trạng thái kết nối tổng đài
  * [x] Đổi được trạng thái kết nối tổng đài
* [x] Giao diện cửa sổ gọi ra\
  Tái hiện toàn bộ giao diện gọi ra của web OMICall. Tuỳ biến một số sang diện danh sách và lịch sử cuộc gọi dành riêng cho SDK
  * [x] Đổi được vị trí hiển thị: `ui.dialPosition = left | right`
  * [x] Giao diện bàn phím số
  * [x] Giao diện lịch sử cuộc gọi:\
    \- Tối ưu cho giao diện nhỏ gọn của SDK từ phiên bản web\
    \- Hiển thị tối đa 50 cuộc gọi trong 7 ngày gần nhất\
    \- Hỗ trợ tìm kiếm theo số điện thoại hoặc tên người gọi\
    \- Hỗ trợ nghe lại file ghi âm của cuộc gọi\
    \- Bấm để nhập nhanh vào ô số cần gọi ra
  * [x] Giao diện danh sách số nội bộ:\
    \- Hiển thị tất cả số nội bộ của doanh nghiệp\
    \- Tự động hiển thị kết quả trong khi nhập tìm kiếm\
    \- Bấm để nhập nhanh vào ô số cần gọi ra
  * [x] Giao diện danh sách nhóm nội bộ:\
    \- Hiển thị tất cả nhóm nội bộ của doanh nghiệp\
    \- Tự động hiển thị kết quả trong khi nhập tìm kiếm\
    \- Bấm để nhập nhanh vào ô số cần gọi ra
  * [x] Giao diện danh sách nhóm bên ngoài:\
    \- Hiển thị tất cả nhóm nội bộ của doanh nghiệp\
    \- Tự động hiển thị kết quả trong khi nhập tìm kiếm\
    \- Bấm để nhập nhanh vào ô số cần gọi ra
  * [x] Giao diện danh sách tương tác bấm phím:\
    \- Hiển thị tất cả tương tác bấm phím của doanh nghiệp\
    \- Tự động hiển thị kết quả trong khi nhập tìm kiếm\
    \- Bấm để nhập nhanh vào ô số cần gọi ra
  * [x] Cấu hình đầu số gọi ra:\
    \- Hiển thị đầu số gọi ra hiện tại của số nội bộ\
    \- Cho phép đổi "tạm thời" số dùng để gọi ra trong phiên kết nối này
  * [x] Cấu hình cuộc gọi cá nhân:\
    \- Xem được các cấu hình cuộc gọi đang áp dụng của số nội bộ:\
    &#x20;  \+ Remote Call: Cuộc gọi sẽ thực hiện trực tiếp trên IP Phone, Softphone\
    \- Cập nhật "tạm thời" cấu hình "Remote Call" cho các cuộc gọi của phiên kết nối này
  * [x] Hỗ trợ cuộc gọi Audio
  * [x] Hỗ trợ cuộc gọi Video
  * [x] Hỗ trợ gọi ra bằng đầu số ZCC: có đủ UX/UI cấp quyền và kiểm tra trạng thái được phép gọi tới sđt của tài khoản Zalo
* [x] Hỗ trợ hiển thị nhiều dialog cuộc gọi đồng thời
* [x] Hỗ trợ di chuyển vị trí của dialog cuộc gọi
* [x] Giao diện trong cuộc gọi

  \- Tái hiện toàn bộ\* giao diện và tính năng trong cuộc gọi của web OMICall\
  &#x20;  *\*Ngoại trừ  duy nhất tính năng "LazyCall"*\
  \- Tối ưu giao diện gọi Video. Hỗ trợ thay đổi giao diện khi camera của người gọi xoay hướng\
  \- Tối ưu giao diện gom nhóm khi có nhiều của sổ cuộc gọi đang hiển thị\
  \- Áp dụng đầy đủ phân quyền và cấu hình cuộc gọi như ở web OMICall


# v3 Changelog

WebCallSDK release versions changelog

## 3.0.46 (2026-07-17)

* Support customer header when make call + customer UA options + fix some issues

## 3.0.45 (2026-07-10)

* Support two simultaneous calls

## 3.0.44 (2026-07-11)

* Fix connection issues when the internet is lost

## 3.0.43 (2026-06-18)

* Update mobile UI support
* Add transfer feature

## 3.0.42 (2026-05-14)

* Fix issue with dialog close calls
* Add AI Assistant

## 3.0.41 (2026-01-15)

* Support custom SIP Register `expires`

## 3.0.40 (2026-01-13)

* Fix issues for dynamic `WSS URI` of different nation

## 3.0.39 (2026-01-12)

* Fix issues for new nation `la` and `ht`

## 3.0.38 (2026-01-08)

* Support speech to text & status employee tranfer & sync status state

## 3.0.37 (2025-12-18)

* apply dynamic config `ice_transport_policy` from API
* Handle call with prority same network config

## 3.0.37 (2025-10-30)

* Support load UI script from external sources

## 3.0.35 (2025-10-21)

* Support `Guest` mode, able to use SDK with any SIP account
* Fix some UX/UI and alert issues

## 3.0.34 (2025-10-17)

* Update some UI components to match OMIWeb and clean up the codebase.
* Apply flow priority for switchboard connections based on network provider.
* Apply new audio constraints for improved call quality.

## 3.0.33 (2025-08-15)

* Update call reject cause message for checking trial package

## 3.0.32 (2025-07-21)

* Hotfix issue with option `callTabs`, causing loss of call note data

## 3.0.31 (2025-07-09)

* Hotfix issue with option `callTabs`, causing loss of call note data

## 3.0.30 (2025-07-09)

* Update CSS to prevent issues with some plugins have default:

  ```css
  * {
      margin: 0;
      padding: 0;
  }
  ```
* Show alert for invalid or inactive SIP user when auth failed
* Support new init option: `validateCallOut`, check the permission to make a call is allowed or not

## 3.0.29 (2025-07-08)

* Fix Call UI:
  * when have very long last call note
  * not hide CTA buttons on minimize mode

## 3.0.28 (2025-06-28)

* Fixed missing `uuid` in call data when triggering the `ringing` event
* Fixed the `set_sip_number` event not being triggered when the call had been rejected
* Supported more display cases for `ctaButtons` configs

## 3.0.27 (2025-06-10)

* Apply statusCode `486: Busy Here` when manually reject call
* Add new call method `decline()`: inbound call will stop immidiately, without ringing to other extensions
* Update call reject message same as other platforms
* Hotfix `phone undefined` when searching remote contact
* Hotfix CSS issues with `tailwindcss@4.x` for some UI
* Limit timeout for option `searchRemoteContact` in `5 seconds`
* Update dependency to `FloatingUI@1.7.1`

## 3.0.26 (2025-06-09)

* Apply permission to see phone number in call history

## 3.0.25 (2025-05-30)

* Support new init option: `minimizeNewCall: true`, to display new call as minimized mode
* Public function `minimize` to `callData` instance, allow to control minimize call dialog manually

## 3.0.24 (2025-05-19)

* Support new init options `rootBody` and `searchRemoteContact`

## 3.0.23 (2025-05-15)

* Add params `callData` for custom `callTabs[$].render(callData, tabNode, tabItem)`
* Reset switchboard online state when change sip user

## 3.0.22 (2025-05-14)

* Support custom UI for call session dialog:
  * Show CTA buttons under remote contact: Preview
  * Show call info as tabs: Preview

## 3.0.21 (2025-04-16)

* Support new init options `phoneMasked`, allow to control phone number masking

## 3.0.20 (2025-04-10)

* Remove unsupported codec `red` and rule filter codec

## 3.0.19 (2025-04-02)

* Remove action reject invitation when already in call

## 3.0.18 (2025-03-21)

* Add init options `allowMultiTab`: skip checking inbound call between browser tabs

## 3.0.17 (2025-03-07)

* Add `utm_source` params for all api request

## 3.0.16 (2025-02-18)

* Support passing options `userData` when manual make call
* Support custom `wssUri` and `iceServers` when register
* Disable `iceRestart` option on hold inbound call

## 3.0.15 (2024-12-04)

* Move Dial HTML to outside of `document.body`
* Update-2-date some dependencies

## 3.0.14 (2024-11-27)

* Move some base CSS/Fonts/Vars to always init
* Update some Enums in `OMICallSDK` and initialization to support integration

## 3.0.13 (2024-11-08)

* Update rule detect ZCC sip number
* Support to show Zalo user info for ZCC
* Apply end call foward config

## 3.0.12 (2024-10-15)

* Fix CSS for `nhanh.vn`
* Fix loading of calling sip number

## 3.0.11 (2024-10-02)

* Support show calling sip number custom name at any case

## 3.0.10 (2024-10-02)

* Show warning and prevent call if already having a call in other tab of browser

## 3.0.9 (2024-08-23)

* Move `dialPosition: 'hidden'` config to new config, allow to hide toggle dial button, but still able to show dial dialog by global method:

  ```
  ui: {
      toggleDial: 'show' | 'hide'
  }
  ```
* Default ignore browser event `beforeunload` when loaded SDK inside iframe
* Add new call reject message for event `DESTINATION_ADS_CALL_OUT_OF_TIME_RANGE`, `SERVICE_PACKAGE_NOT_ALLOW`
* Add browser UserAgent in call event data: `call.ua`
* Add devices status in call event data: `call.devices = { audio: true, video: false }`

## 3.0.8 (2024-07-29)

**Update:**

* Support not showing dial dialog toggle button
* Show call out SIP number when use Click-2-Call

**Fix:**

* Fix CSS issues for ZOHO

## 3.0.7 (2024-07-25)

* Add video call status text for internal call

## 3.0.6 (2024-07-22)

**Update:**

* Support Zalo Cloud Connect (ZCC) call feature
* Add validate call settings with features of package

**Fix:**

* Fix some issues of auto close and save call
* Fix not prevent to open dial dialog when setting offline

## 3.0.5 (2024-07-19)

* Reconnect/ Dispose switchboard when internal connection changed

## 3.0.4 (2024-07-19)

**Update:**

* Support show Outer Group
* Move code init sound and notification permission to after register success
* Apply config ringtone and alert sound
* Apply config auto open call form when call accepted or declined
* Apply config auto close call dialog

**Fix:**

* Still validate SIP number when make internal call
* Duplicate call event ended when call had been reject

## 3.0.3 (2024-07-18)

**Update:**

* Support video call feature
* Add property disablePictureInPicture to call player

**Fix:**

* Set call stream to call player multi time

## 3.0.2 (2024-07-18)

**Update:**

* Minimize call dialog feature
* Apply utils for all set style code
* Update call dialog draggable anchor to full of container
* Update more anchor to re-index focused call dialog
* Improve dom.util `ref` argument

**Fix:**

* Issues not remove parent of call plugin element

## 3.0.1 (2024-07-17)

* Support for Firefox browser

## 3.0.0 (2024-07-16)

* First CallSDK version, with brand new SIP Core and UX/UI


# v2 Integration

OmiCall Web SDK : là công cụ bao gồm thư viện và tài liệu mà OmiCall cung cấp cho đối tác, để đối tác xây dựng tính năng call ngay chính trên ứng dụng web của mình.

```markup
Latest version : 2.1.26
Release date : 22/07/2026
Changelog : https://api.omicall.com/sdk/web-sdk-changelog
```

### Hướng dẫn cài đặt

![Giao diện Dialog Call](https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LukDt3aTxo8xMLonIwO%2F-MaaYP_FsurjffQi9bhd%2F-MaabZGf0actFZxjALoK%2Fsdk1.png?alt=media\&token=485002ba-1655-4521-9fc7-d5533c679f11)

![Giao diện Dialog Call với Input Note mặc định](https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FbBVf3Mi5SufZAuDOfDQS%2FScreen%20Shot%202022-06-26%20at%2012.14.16%20PM%20\(1\).png?alt=media\&token=865127c9-022d-458d-940c-d9e08bac4537)

![Giao diện dialog gọi với custom form data](https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FNQt15sktQZgK058Ub64E%2Fnew-sdk-form-end-validate.png?alt=media\&token=d6beb6ea-5efb-4789-a351-d2ff78fe81cb)

Nhúng Web SDK vào HTML của website cần tích hợp

```markup
<body>

    <!-- other html -->
    
    <script omi-sdk type="text/javascript" src="https://cdn.omicrm.com/sdk/2.0.0/sdk.min.js"></script>
    
    <script>
        document.addEventListener('DOMContentLoaded', () => {
            // Ví dụ về một số config có thể dùng khi init SDK
            let config = {
                theme: 'default',
                callbacks: {
                    register: (data) => {
                        // Sự kiện xảy ra khi trạng thái kết nối tổng đài thay đổi
                        console.log('register:', data);
                    },
                    connecting: (data) => {
                        // Sự kiện xảy ra khi bắt đầu thực hiện cuộc gọi ra
                        console.log('connecting:', data);
                    },
                    invite: (data) => {
                         // Sự kiện xảy ra khi có cuộc gọi tới
                         console.log('invite:', data);
                    },
                    inviteRejected: (data) => {
                         // Sự kiện xảy ra khi có cuộc gọi tới, nhưng bị tự động từ chối
                         // trong khi đang diễn ra một cuộc gọi khác
                         console.log('inviteRejected:', data);
                    },
                    ringing: (data) => {
                        // Sự kiện xảy ra khi cuộc gọi ra bắt đầu đổ chuông
                        console.log('ringing:', data);
                    },
                    accepted: (data) => {
                         // Sự kiện xảy ra khi cuộc gọi vừa được chấp nhận
                         console.log('accepted:', data);
                    },
                    incall: (data) => {
                         // Sự kiện xảy ra mỗi 1 giây sau khi cuộc gọi đã được chấp nhận
                         console.log('incall:', data);
                    },
                    acceptedByOther: (data) => {
                         // Sự kiện dùng để kiểm tra xem cuộc gọi bị kết thúc
                         // đã được chấp nhận ở thiết bị khác hay không
                         console.log('acceptedByOther:', data);
                    },
                    ended: (data) => {
                         // Sự kiện xảy ra khi cuộc gọi kết thúc
                         console.log('ended:', data);
                    },
                    holdChanged: (status) => {
                         // Sự kiện xảy ra khi trạng thái giữ cuộc gọi thay đổi
                         console.log('on hold:', status);
                    },
                    saveCallInfo: (data) => {
                        // let { callId, note, ...formData } = data;
                        // Sự kiện xảy ra khi cuộc gọi đã có đổ chuông hoặc cuộc gọi tới, khi user có nhập note input mặc định hoặc form input custom
                        console.log('on save call info:', data);
		    },
                    infoLastCall: (data) => {
                        // Sự kiện xảy ra khi có bật options.showInfoLastCall và SDK có get được data cho số điện thoại đang gọi
                        console.log('on found info last call:', data);
		    },
                }
            };
            omiSDK.init(config, () => {
                // Truy cập OMICall
                // Vào menu : Cấu hình >> Tổng đài >> Số nội bộ
                // Mở chi tiết 1 số nội bộ để lấy thông tin 
                // omiSDK.register({
                //    domain: 'abc',
                //    username: '100', 
                //    password: '123456'
                // });
                omiSDK.register({
                    domain: '',
                    username: '', // tương đương trường "sip_user" trong thông tin số nội bộ
                    password: ''
                });
            });
            // Cách khác để khai báo các SDK events:
            // omiSDK.on('register', (data) => {
            //     // Sự kiện xảy ra khi trạng thái kết nối tổng đài thay đổi
            //     console.log('register:', data);
            // });
            // Cách khác để huỷ khai báo các SDK events:
            // omiSDK.off('register');
        });
    </script>

</body>
```

{% file src="/files/ZX2bUovLHQWBfOFuFuhm" %}
File demo tích hợp SDK
{% endfile %}

**Phương thức**

|                                                                                                                    **Phương thức** | **Mô tả**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |                                    |          |       |                                                                                                                     |
| ---------------------------------------------------------------------------------------------------------------------------------: | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------- | -------- | ----- | ------------------------------------------------------------------------------------------------------------------- |
|                                                                                             omiSD&#x4B;**.init(config, callback)** | Khởi tạo các cấu hình cần thiết cho SDK và load UI nếu có truyền theme                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |                                    |          |       |                                                                                                                     |
|                                                                                                        omiSDK.**register(params)** | <ul><li>Gọi tới khi sau khi function SDK init callback.</li><li>Phương thức ghi danh tổng đài: <strong>Object</strong></li></ul><p><code>{</code><br>   <code>domain : "abc" // domain tổng dài</code></p><p>   <code>username: "100", // Số nội bộ</code></p><p>   <code>password: "\*\*\*" // Mật khẩu số nội bộ</code></p><p><code>}</code></p><p></p><p><strong>\*Lưu ý:</strong> Có thể lấy các thông tin ghi danh tổng đài ở cấu hình số nội bộ hoặc thông qua API của OMICall</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |                                    |          |       |                                                                                                                     |
|                                                                                                            omiSDK.**unregister()** | Ngưng kết nối với tổng đài                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |                                    |          |       |                                                                                                                     |
|                                                                                                      omiSDK.**reregister(params)** | Ngưng kết nối với tổng đài và tạo một phiên kết nối mới với params trước đó hoặc từ params mới truyền                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |                                    |          |       |                                                                                                                     |
|                                                                                                         omiSDK.**makeCall(phone)** | <p><strong>- phone</strong>:</p><ul><li>Số điện thoại khách hàng</li><li>Số nội bộ của nhân viên</li><li>Số nội bộ của nhóm</li><li>Số nội bộ của nhóm bên ngoài</li></ul>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |                                    |          |       |                                                                                                                     |
| <p>omiSDK.<strong>makeCall(phone, hotline)</strong><br><strong>or</strong><br>omiSDK.<strong>makeCall(phone, options)</strong></p> | <p><strong>- <code>phone</code></strong><code>:</code></p><ul><li>Số điện thoại khách hàng</li><li>Số nội bộ của nhân viên</li><li>Số nội bộ của nhóm</li><li>Số nội bộ của nhóm bên ngoài</li></ul><p>- <strong><code>hotline</code></strong><code> (String)</code><strong>:</strong> đầu số tổng đài dùng để gọi ra (\*<strong>Lưu ý</strong>: phải là đầu số cho phép gọi ra và tài khoản nhân viên thực hiện cuộc gọi được quyền sử dụng đầu số này)<br>- <strong><code>options</code></strong><code> (Object)</code><strong>:</strong> <br>{<br>     <strong>sipNumber</strong>: String,</p><p>     <strong>sneakyType</strong>: String,<br>     <strong>datas</strong>: { <br>          'User-Data': String<br>     }<br> }<br>  + <strong>sipNumber:</strong> như param <strong>hotline</strong> cũ<br>  + <strong>sneakyType</strong>: loại cuộc gọi giám giát số nội bộ khác, gồm: <br>     > <strong>monitoring</strong>: Giám sát <br>     > <strong>whisper</strong>: Thì thầm<br>     > <strong>colloquy</strong>: Đàm thoại 3 bên<br>  + <strong>datas:</strong> dữ liệu truyền lên tổng đài để lưu thêm dữ liệu tuỳ chỉnh vào lịch sử cuộc gọi, max length của string data là 256</p> |                                    |          |       |                                                                                                                     |
|                                                                                                              omiSDK.**stopCall**() | Từ chối cuộc gọi/ Kết thúc cuộc gọi                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |                                    |          |       |                                                                                                                     |
|                                                                                                            omiSDK.**acceptCall**() | Chấp nhận cuộc gọi                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |                                    |          |       |                                                                                                                     |
|                                                                                                 omiSDK.**transferCall(extension)** | <p>Chuyển tiếp cuộc gọi. </p><p><strong>extension</strong> : Là số máy lẻ nhân viên cần chuyển tới<br>\*L<strong>ưu ý</strong>: chỉ hỗ trợ chuyển tiếp khi cuộc gọi đã được bắt máy</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |                                    |          |       |                                                                                                                     |
|                                                                                                          omiSDK.**sendDTMF(tone)** | <p>Gửi tín hiệu tương tác bấm phím</p><p><strong>tone</strong>: các số từ 0-9 hoặc \*#</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |                                    |          |       |                                                                                                                     |
|                                                                                                      omiSDK.**toggleMute(status)** | <p>Bật tắt âm thanh từ micro của bạn</p><p><strong>status:</strong></p><ul><li><strong>true</strong>: tắt âm thanh</li><li><strong>false</strong>: bật âm thanh</li></ul>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |                                    |          |       |                                                                                                                     |
|                                                                                                      omiSDK.**toggleHold(status)** | <p>Thay đổi trạng thái giữ cuộc gọi</p><p><strong>status:</strong></p><ul><li><strong>true</strong>: giữ cuộc gọi</li><li><strong>false</strong>: bỏ giữ cuộc gọi</li></ul>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |                                    |          |       |                                                                                                                     |
|                                                                                                             omiSDK.**getStatus()** | <p>Lấy trạng thái kết nối hiện tại của SDK với tổng đài:</p><ul><li><strong>registering</strong>: đang kết nối</li><li><strong>registered</strong>: đã kết nối</li><li><strong>unregistered</strong>: chưa kết nối</li></ul>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |                                    |          |       |                                                                                                                     |
|                                                                                                          omiSDK.**toggleDialog()** | Chủ động ẩn hiện dialog cuộc gọi của SDK nếu có sử dụng theme                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |                                    |          |       |                                                                                                                     |
|                                                                                                             omiSDK.**isCalling**() | Trả về giá trị true/false                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |                                    |          |       |                                                                                                                     |
|                                                                                               omiSDK.**updateContactInfo**(Object) | <p>Cập nhật Tên và Avatar của khách hàng trên cửa số cuộc gọi</p><p></p><p><em>omiSDK.<strong>updateContactInfo</strong>({</em></p><p>   <em>name : "Nguyễn Thanh Sang",</em></p><p>   <em>avatar : "https\://...."</em></p><p><em>});</em></p><p></p><p><em>\*G</em>iá trị <strong>avatar</strong> sẽ được truyền vào thuộc tính <code>src</code> của thẻ <code>img</code>: có thẻ là http link hoặc base64,...</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |                                    |          |       |                                                                                                                     |
|                                                                                                        omiSDK.**getAccessToken**() | Trả về **accessToken** của phiên kết nối tổng đài hiện tại, có thể dùng để gọi các API public của OMI                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |                                    |          |       |                                                                                                                     |
|                                                                                                omiSDKTheme.**setFormData**(Object) | Set value cho các text input với id tương ứng khi truyền mảng "forms" trong cấu hình                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |                                    |          |       |                                                                                                                     |
|                                                                                                         omiSDK.**setBusy**(status) | <p><strong>status</strong> (<strong>String</strong>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  | <strong>Boolean</strong>): inbound | outbound | local | all</p><p>Cập nhật trạng thái BUSY của SDK, được lưu trong localStorage để đồng bộ giứa các tab của trình duyệt</p> |
|                                                                                                       omiSDK.**isBusy**(direction) | <p><strong>direction</strong> (<strong>String</strong>): nhận các giá trị của param <strong>status</strong> khi dùng <strong>omiSDK.setBusy(status)</strong> (Nếu không truyền, giá trị mặc định là <strong>inbound</strong>).<br>Trả về trạng thái BUSY hiện tại của SDK theo  hướng cuộc gọi.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |                                    |          |       |                                                                                                                     |

**Dữ liệu callback từ sự kiện**

| **Tham số**                     | **Loại**    | **Mô tả**                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| ------------------------------- | ----------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **direction**                   | **String**  | Hướng của cuộc gọi: **`outbound, inbound`**                                                                                                                                                                                                                                                                                                                                                                                                     |
| **directionTxt**                | **String**  | Tên hướng của cuộc gọi                                                                                                                                                                                                                                                                                                                                                                                                                          |
| **status**                      | **String**  | Trạng thái hiện tại của cuộc gọi: **`connecting, ringing, connected, ended, hold`**                                                                                                                                                                                                                                                                                                                                                             |
| **statusTxt**                   | **String**  | Tên trạng thái hiện tại của cuộc gọi                                                                                                                                                                                                                                                                                                                                                                                                            |
| **remoteNumber** hoặc **phone** | **String**  | <ul><li>với <strong>direction outbound</strong>: số được gọi ra</li><li>với <strong>direction inbound</strong>: số đang gọi tới</li></ul>                                                                                                                                                                                                                                                                                                       |
| **sipDomain**                   | **String**  | Domain tổng đài của phiên kết nối hiện tại                                                                                                                                                                                                                                                                                                                                                                                                      |
| **sipUser**                     | **String**  | Số nội bộ của phiên kết nối hiện tại                                                                                                                                                                                                                                                                                                                                                                                                            |
| **sipNumber**                   | **String**  | Số tổng đài đang dùng để thực hiện cuộc gọi ra hay nhận cuộc gọi tới                                                                                                                                                                                                                                                                                                                                                                            |
| **startTime**                   | **Date**    | Thời gian bắt đầu cuộc gọi                                                                                                                                                                                                                                                                                                                                                                                                                      |
| **answerTime**                  | **Date**    | Thời gian bắt đầu chấp nhận cuộc gọi                                                                                                                                                                                                                                                                                                                                                                                                            |
| **endTime**                     | **Date**    | Thời gian kết thúc cuộc gọi                                                                                                                                                                                                                                                                                                                                                                                                                     |
| **endCause**                    | **String**  | <p>Nguyễn nhân kết thúc cuộc gọi.</p><p>Gồm:</p><ul><li><strong>BUSY</strong>: máy bận</li><li><strong>NO\_ANSWER</strong>: hết thời gian đổ chuông</li><li><strong>TRIAL\_REJECTION</strong>: khi gọi tới số điện thoại chưa gọi vào số tổng tài (với tài khoản OMI Trial)</li><li><strong>LIMITATION\_DECLINE</strong>: quá thời lượng cho phép gọi ra</li><li><strong>ALLOTTED\_TIMEOUT</strong>: Cuộc gọi đạt giới hạn thời lượng</li></ul> |
| **uuid**                        | **String**  | **Transaction ID** của cuộc gọi                                                                                                                                                                                                                                                                                                                                                                                                                 |
| **duration**                    | **Number**  | Thời gian gọi giữa 2 người sau khi chấp nhận cuộc gọi cho tới khi cuộc gọi kết thúc                                                                                                                                                                                                                                                                                                                                                             |
| **durationTxt**                 | **String**  | Thời gian gọi giữa 2 người sau khi chấp nhận cuộc gọi cho tới khi cuộc gọi kết thúc và đã được định dạng theo thời gian: **`00:00`**                                                                                                                                                                                                                                                                                                            |
| **totalDuration**               | **Number**  | Tổng thời gian từ khi bắt đầu thực hiện/nhận cuộc gọi tới khi kết thúc                                                                                                                                                                                                                                                                                                                                                                          |
| **ping**                        | **Object**  | Dữ liệu về trạng thái tín hiệu của cuộc gọi                                                                                                                                                                                                                                                                                                                                                                                                     |
| **isAccepted**                  | **Boolean** | Trạng thái đã nhận cuộc gọi giữa hai bên                                                                                                                                                                                                                                                                                                                                                                                                        |

**Cấu hình và Sự kiện**

|              config.**theme** | **String**          | <p>Giao diện dialog cuộc gọi (nếu để trống thì sẽ không có giao diện). Hoặc một trong các giá trị sau </p><ul><li><strong>default</strong> : Giao diện (như ảnh ở trên)</li></ul>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |                                                                                                                                                           |                                                                                                                                                                                                                   |                                                                                                                                                                          |
| ----------------------------: | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|              config.**debug** | **Boolean**         | <p>Bật tắt chức năng log các sự kiện của SDK.</p><p>Mặc định: <strong>false</strong></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |                                                                                                                                                           |                                                                                                                                                                                                                   |                                                                                                                                                                          |
|               config.**busy** | **Boolean**         | Trạng thái cho phép thực hiện cuộc gọi ra, nhưng sẽ tự động từ chối tất cả các cuộc gọi tới                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |                                                                                                                                                           |                                                                                                                                                                                                                   |                                                                                                                                                                          |
|           config.**language** | **String**          | <p>Ngôn ngữ hiển thị dialog cuộc gọi mặc định của SDK.</p><p>Gồm: <br> "<strong>vi</strong>" : Tiếng Việt (<strong>default</strong>)<br> "<strong>en</strong>" : Tiếng anh</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |                                                                                                                                                           |                                                                                                                                                                                                                   |                                                                                                                                                                          |
|     config.**ringtoneVolume** | **Number**          | Âm lượng chuông, khi khách gọi tới (từ 0 - 1)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |                                                                                                                                                           |                                                                                                                                                                                                                   |                                                                                                                                                                          |
|            config.**options** | **Object**          | <p></p><ul><li><em><strong><code>hideCallButton</code></strong></em><code>: </code><strong><code>Boolean</code></strong> Ẩn hiện nút gọi</li><li><strong><code>showContactLoading</code></strong><code>:</code><strong><code>Boolean</code></strong> Ẩn hiện loading vị trí tên của người gọi trong dialog cuộc gọi</li><li><strong><code>maskedPhoneNumberFormat: Array</code></strong> tùy chỉnh format ẩn số điện thoại ở dialog gọi.<br><strong>E.g.</strong>:<br>- <strong><code>\['start', 4, 'x']</code></strong> => <strong>xxxx749346</strong><br>- <strong><code>\['end', 3, 'x']</code></strong> => <strong>0394749xxx</strong></li><li><strong><code>draggable: Boolean</code></strong> để cho phép để thay đổi vị trí của nút bật tắt dialog call và dialog cuộc gọi</li><li><strong><code>btnCloseText: String</code></strong> để tuỳ chỉnh nội dung chữ của nút đóng và lưu lại cuộc gọi nếu có hiển thị input note hoặc custom forms</li><li><strong><code>showNoteInput: Boolean | { required: Boolean }</code></strong>  hiển thị input note mặc định và nút "<strong>Đóng và lưu lại</strong>"</li><li><strong><code>showTagField: Boolean | { required: Boolean }</code></strong> hiển thị field chọn tag ở form data bên phải dialog call, nếu trước đó mảng <strong>forms</strong> chưa có field id = 'tag'</li><li><strong><code>showInfoLastCall: Boolean | { overrideContact: Boolean }</code></strong> hiển thị thời gian và note gần nhất với remoteCall đang gọi, hiện thị avatar và name của contact tương ứng nếu có</li></ul> |
|              config.**forms** | **Array \[Object]** | <p>Mảng form data tuỳ chỉnh. </p><ul><li><strong>id</strong>: ID định danh của field input</li><li><strong>label</strong>: Tên của field input</li><li><strong>plh</strong>: placeholder của input</li><li><strong>multiline</strong>: hiện thị input dạng textarea</li><li><strong>required</strong>: thêm dấu <mark style="color:red;">\*</mark> bên cạnh tên của input và chặn đóng dialog call khi chưa nhập input</li><li><strong>className</strong>: class tuỳ chỉnh truyền vào div ngoài cùng của field input</li><li><strong>height</strong>: chiều cao tuỳ chỉnh cho input multiline</li></ul><p>\*Ví dụ: <br>{</p><p>   <strong>id</strong>: 'address', <em>=> bắt buộc</em><br>   <strong>label</strong>: 'Địa chỉ',<br>   <strong>plh</strong>: 'Nhập địa chỉ',<br>   <strong>multiline</strong>: <em>true/fasle</em>,<br>   <strong>required</strong>: <em>true/fasle</em>,<br>   <strong>className</strong>: <em>String</em>,<br>   <strong>height</strong>: '200px',<br>}</p>      |                                                                                                                                                           |                                                                                                                                                                                                                   |                                                                                                                                                                          |
|            config.**classes** | **Object**          | <ul><li><strong><code>btnToggle</code></strong><code>:</code><strong><code>String</code></strong> được truyền vào thuộc tính <strong><code>class</code></strong> của div ngoài cùng của button đóng mở UI cuộc gọi</li><li><strong><code>dialog</code></strong><code>:</code><strong><code>String</code></strong> được truyền vào thuộc tính <strong><code>class</code></strong> của div ngoài cùng của dialog UI cuộc gọi</li></ul>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |                                                                                                                                                           |                                                                                                                                                                                                                   |                                                                                                                                                                          |
|             config.**styles** | **Object**          | <p></p><ul><li><strong><code>btnToggle</code></strong><code>:</code><strong><code>Object</code></strong> được truyền vào thuộc tính <strong><code>style</code></strong> của div ngoài cùng của button đóng mở UI cuộc gọi</li><li><strong><code>dialog</code></strong><code>:</code><strong><code>Object</code></strong> được truyền vào thuộc tính <strong><code>style</code></strong> của div ngoài cùng của dialog UI cuộc gọi</li></ul><p><strong>E.g. Object style</strong>:<br>{<br>   'background-color': 'blue',<br>   justifyContent: 'center',          <br>   color: 'red'<br>}, </p>                                                                                                                                                                                                                                                                                                                                                                                                  |                                                                                                                                                           |                                                                                                                                                                                                                   |                                                                                                                                                                          |
|          config.**callbacks** | **Object**          | Object chứa các event function callback                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |                                                                                                                                                           |                                                                                                                                                                                                                   |                                                                                                                                                                          |
|        callbacks.**register** | **Function**        | Sự kiện xảy ra khi trạng thái kết nối tổng đài thay đổi                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |                                                                                                                                                           |                                                                                                                                                                                                                   |                                                                                                                                                                          |
|      callbacks.**connecting** | **Function**        | Sự kiện xảy ra khi bắt đầu thực hiện cuộc gọi ra                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |                                                                                                                                                           |                                                                                                                                                                                                                   |                                                                                                                                                                          |
|          callbacks.**invite** | **Function**        | Sự kiện xảy ra khi có cuộc gọi tới                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |                                                                                                                                                           |                                                                                                                                                                                                                   |                                                                                                                                                                          |
|  callbacks.**inviteRejected** | **Function**        | Sự kiện xảy ra khi có cuộc gọi tới, nhưng bị tự động từ chối                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |                                                                                                                                                           |                                                                                                                                                                                                                   |                                                                                                                                                                          |
|         callbacks.**ringing** | **Function**        | Sự kiện xảy ra khi cuộc gọi ra bắt đầu đổ chuông                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |                                                                                                                                                           |                                                                                                                                                                                                                   |                                                                                                                                                                          |
|        callbacks.**accepted** | **Function**        | Sự kiện xảy ra khi cuộc gọi vừa được chấp nhận                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |                                                                                                                                                           |                                                                                                                                                                                                                   |                                                                                                                                                                          |
|          callbacks.**incall** | **Function**        | Sự kiện xảy ra mỗi 1 giây sau khi cuộc gọi đã được chấp nhận                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |                                                                                                                                                           |                                                                                                                                                                                                                   |                                                                                                                                                                          |
| callbacks.**acceptedByOther** | **Function**        | Sự kiện dùng để kiểm tra xem cuộc gọi bị kết thúc, đã được chấp nhận ở thiết bị khác hay không                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |                                                                                                                                                           |                                                                                                                                                                                                                   |                                                                                                                                                                          |
|           callbacks.**ended** | **Function**        | Sự kiện xảy ra khi cuộc gọi kết thúc                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |                                                                                                                                                           |                                                                                                                                                                                                                   |                                                                                                                                                                          |
|     callbacks.**holdChanged** | **Function**        | Sự kiện xảy ra khi trạng thái giữ cuộc gọi thay đổi                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |                                                                                                                                                           |                                                                                                                                                                                                                   |                                                                                                                                                                          |
|    callbacks.**saveCallInfo** | **Function**        | Sự kiện xảy ra khi cuộc gọi đã có đổ chuông hoặc cuộc gọi tới, khi user có nhập note input mặc định hoặc form input custom                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |                                                                                                                                                           |                                                                                                                                                                                                                   |                                                                                                                                                                          |
|    callbacks.**infoLastCall** | **Function**        | Sự kiện xảy ra khi có bật options.showInfoLastCall và SDK có get được data cho số điện thoại đang gọi                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |                                                                                                                                                           |                                                                                                                                                                                                                   |                                                                                                                                                                          |


# v2 Changelog

Lịch sử cập nhật tính năng của Web SDK

## 2.2.1 (2026-08-18)

* Fix issues not reset ready to show call contact in dialog call

## 2.2.0 (2026-08-14)

* Support using SDK with CDN by version path: `/:version/sdk.min.js`
* Using SIP dependency same like SDK v3 (fixes WebRTC/SDP compatibility issues on newer browsers)

## 2.1.27 (2026-08-10)

* Fix crash issues with SDK inside iframe but don't have `unload` permission

## 2.1.26 (2026-07-22)

* Fix permission seeing phone number on call history

## 2.1.25 (2025-10-12)

* Update rule to set calling out SIP number to SDP header

## 2.1.24 (2025-07-08)

* Hotfix issues auto reject invite call

## 2.1.23 (2025-07-04)

* Remove checking calling session between browser tabs

## 2.1.22 (2025-06-10)

* Apply statusCode `486: Busy Here` when manually reject call
* Add new call method `omiSDK.declineCall()`: inbound call will stop immidiately, without ringing to other extensions
* Add new call method `omiSDK.endCall()`: clone from `omiSDK.stopCall()`
* Update call reject message same as other platforms

## 2.1.21 (2025-04-11)

* Support new init options `phoneMasked`, allow to control phone number masking

## 2.1.20 (2025-04-11)

* Rollback codec `red`

## 2.1.19 (2025-04-10)

* Remove unsupported codec `red`

## 2.1.18 (2025-04-04)

* Add init option `autoReject: Boolean` to control action reject invitation when already in call

## 2.1.17 (2025-04-02)

* Remove action reject invitation when already in call

## 2.1.16 (2025-03-20)

* Auto end call when disconnected with switchboard

## 2.1.15 (2025-03-07)

* Add `utm_source` params for all api request

## 2.1.14 (2024-12-09)

* Fix issues show wrong missed call status

## 2.1.13 (2024-11-11)

* Hotfix issues with end call foward config

## 2.1.12 (2024-11-08)

* Apply end call foward config

## 2.1.11 (2024-09-17)

* Add method to validate invite call before process it:

  ```html
  config.validateInvite = async (data) => { 
      return await doSomeValidation(call);
  }
  ```
* Fixed delay trigger `incall` event because new stream calculator

## 2.1.10 (2024-09-08)

* Add datetime for SIP debug event log data
* Add call stream calculator and save stream stat to call transition

## 2.1.9 (2024-08-19)

* Add new call reject message for event `SERVICE_PACKAGE_NOT_ALLOW`, `CALL_REACH_MAX_CCU`, `CALL_REACH_MAX_QUOTATION`
* Default ignore browser event `beforeunload` when loaded SDK inside iframe

## 2.1.8 (2024-08-16)

* Add new call reject message for event 'DESTINATION\_ADS\_CALL\_OUT\_OF\_TIME\_RANGE'
* Add validate microphone and show alert message when no device available
* Add browser UserAgent in call event data: `call.ua`
* Add devices statues in call event data: `call.devices = { audio: true, video: false }`
* Add margin top CSS for call rejected toast message while calling for embedded theme
* Fix issues don't show correct OMI Contact avatar while calling

## 2.1.7 (14/08/2024)

\- Add default theme script src to prod build

## 2.1.6 (09/08/2024)

\- Hiển thị thông báo và trả thêm nội dung chi tiết nguyên nhân kết thúc cuộc gọi

## 2.0.91 (02/11/2023)

\- Sửa lỗi đôi khi không hiển thị đầu số đang gọi ra\
\- Bổ sung tính năng hiển thị Popup chọn đầu số khác để thực hiện lại cuộc gọi nếu không có người nghe máy

## 2.0.90 (28/10/2023)

\- Update tính năng cấu hình trạng thái "Không làm phiền". Hỗ trợ thêm cấu hình theo nhiều hướng cuộc gọi hơn thay vì chỉ áp dụng cho hướng gọi đến.

## 2.0.89 (23/10/2023)

\- Update thêm cho UI chọn đầu số

## 2.0.88 (18/10/2023)

\- Support UI chuyển tiếp tới **nhóm nội bộ** và **tương tác phím**

## 2.0.86 (10/10/2023)

\- Thêm event tự động **unregister** khi **window\.onbeforeunload**

## 2.0.85 (23/09/2023)

\- Thêm thông báo chặn khi gọi cho chính mình\
\- Fix lỗi không dùng được config "**debug**"\
\- Áp dụng cấu hình doanh nghiệp/ cá nhân cho luồng chọn đầu số gọi ra\
\- Thêm luồng lưu data "**ping\_stat**" cho lịch sử cuộc gọi\
\- Fix lỗi không phát được nhạc chờ khi gọi nội bộ\
\- Tự động mở dialog nhập số gọi ra khi trigger function "**omiSDK.setDialNumber**"

## 2.0.71 (05/07/2023)

\- Bổ sung giao diện chọn đầu số tương tự như phiên bản Web của OMICall\
\- Fix lỗi hiển thị sai thời gian của thông tin cuộc gọi gần nhất

## 2.0.66 (15/02/2023)

\- Thêm form field id "**note**", type "**text**", multiline, khi không có **forms** và bật cả hai **options.showNoteInput** và **options.showTagField**\
\- Fix bug không hiển thị contact info khi gọi nội bộ tới chính mình\
\- Luồng API lưu thông tin cuộc gọi: bổ sung param "**tag**" từ form data, nếu có

## 2.0.0-rc.65 (14/02/2023)

\- Cập nhật **iceServers** IP config\
\- Thêm **options.showTagField**, thêm nhanh form field id "**tag**", type "**multiselect**" cho **forms**\
\- Thêm **options.showInfoLastCall**, search contact ở OMI và info last call của **remoteNumber** đang gọi. Nếu truyền giá trị **{ overrideContact: true }**, sẽ ưu tiên hiển thị contact info từ API, dù trước đó đã dùng **omiSDK.updateContactInfo()**\
\- Support thêm form field với type "**multiselect**" (thường dùng cho việc gán tag cuộc gọi,...).\
&#x20; Dùng kèm với các function:\
&#x20;  \+ **omiSDKTheme.setSelections(id, selections)**\
&#x20;  \+ **omiSDKTheme.setSelecteds(id, selecteds)**\
&#x20;   \* **selections và selecteds:** mảng dữ liệu, item có thể là **String** hoặc **Object(label, value)**\
&#x20;   **\* selecteds** phải là mảng con, thuộc mảng **selections** => dùng **omiSDKTheme.setSelections** trước **omiSDKTheme.setSelecteds**

## 2.0.0-rc.64 (03/02/2023)

\- **Salesforce:** Support **runApex** trong khi thực hiện cuộc gọi và thêm nút "Logout" ở UI dial

## 2.0.0-rc.63 (23/12/2022)

\- **Fix BUG**: không gọi ra được nếu đang set busy = true\
\- Thêm method **omiSDK.setBusy(Boolean)** và **omiSDK.isBusy()**, thay cho omiSDK.busy như trước đó, hiện sẽ lưu trạng thái busy trong localStorage để đồng bộ trạng thái giữa các tab của trình duyệt, vẫn có thể cập nhật trạng thái busy trong config khi init như cũ

## 2.0.0-rc.62 (23/12/2022)

\- **Fix BUG**: error trong callback event, chỉ chặn makeCall khi có calling session 1 lần,...\
\- Support khai báo callback event dạng:\
&#x20; \+ **omiSDK.on('eventName', callback);**\
&#x20; \+ **omiSDK.off('eventName');**\
\- Support UX/UI cho **Salesforce**

## 2.0.0-rc.61 (08/10/2022)

\- Cập nhật một số màu cơ bản và bộ icon của theme default\
\- Thêm chức năng hiển thị thời gian đổ chuông ở dialog call in và out\
\- Thêm chức năng chỉ đổ chuông cuộc gọi tới khi không có cuộc gọi nào đang diễn ra ở trong cùng một trình duyệt\
\- Thêm biến **isAccepted** trong callback event data để biết cuộc gọi đã được trả lời hay chưa\
\- Thêm menu chức năng hiển thị danh sách cuộc gọi gần đây của số nội bộ đang kết nối\
\- Fix một số bug console.log lỗi ko cần thiết

## 2.0.0-rc.60 (24/08/2022)

\- Bổ sung biến **sipDomain và sipUser** trong callback data\
\- Remove việc sử dụng **encodeURIComponent** với data customize cần lưu thêm vào lịch sử cuộc gọi

## 2.0.0-rc.59 (22/08/2022)

\- Remove biến **session** trong callback data để hạn chế lỗi không xác định\
\- Update method **omiSDK.makeCall,** cho phép truyền tham số thứ 2 dạng Object để có thể truyền thêm custom data và thực hiện cuộc gọi giám sát.\
&#x20;Ví dụ: \
&#x20;\+ **`omiSDK.makeCall('100', { sneakyType: 'whisper' });`** : thực hiện cuộc gọi giám sát thì thầm tới số nội bộ 100;\
&#x20;\+ **`omiSDK.makeCall('0394749346', { datas: { 'User-Data': '{"module":"contact","emp_id":"1"}' } });`** : truyền một String bất kỳ hoặc Object đã stringify (max length = 256 ) để lưu thông tin thêm vào lịch sử cuộc gọi, dữ liệu này sẽ được **encodeURIComponent** trước khi truyền lên tổng đài

## 2.0.0-rc.58 (02/08/2022)

\- Thêm options **`extraUserAgentString: String`** sẽ cộng chuỗi thêm vào userAgentString của phiên kết nối tổng đài, có format là: \
**`defualtUserAgentString + ';' + extraUserAgentString`**

\- Cập nhật STUN IP cho kết nối tới tổng đài để fix lỗi DNS

## 2.0.0-rc.57 (10/07/2022)

\- Thêm options **`draggable: Boolean`** để cho phép để thay đổi vị trí của nút bật tắt dialog call và dialog cuộc gọi

\- Thêm options **`btnCloseText: String`** để tuỳ chỉnh nội dung chữ của nút đóng và lưu lại cuộc gọi nếu có hiển thị input note hoặc custom forms

## 2.0.0-rc.56 (30/06/2022)

\- Fix lỗi không hiển thị nút "**Đóng và lưu lại**" khi có truyền **forms** tuỳ chỉnh

## 2.0.0-rc.55 (29/06/2022)

\- Cập nhật âm lượng âm báo khi kết thúc cuộc gọi bằng **`0.25 * ringtoneVolume`**

## 2.0.0-rc.54 (27/06/2022)

\- Thêm options **`showNoteInput: Boolean`** để hiển thị input note mặc định và nút "**Đóng và lưu lại**"


# MOBILE SDK

Tích hợp tính năng nghe thoại vào ứng dụng của bạn một cách nhanh chóng, hiệu quả


# Tổng Quan

## SDK OMICALL <a href="#plivo-android-sdk" id="plivo-android-sdk"></a>

OMICALL  SDK cho phép bạn tạo các ứng dụng có khả năng thực hiện và nhận cuộc gọi trong ứng dụng Android/IOS của bạn. SDK này hỗ trợ cả mạng IPv4 và IPv6, có nghĩa là bạn có thể thực hiện và nhận cuộc gọi khi thiết bị của bạn được kết nối với mạng sử dụng một trong hai hoặc cả hai phiên bản của giao thức. **SDK hỗ trợ Android phiên bản 6 trở lên và Android API cấp 21 trở lên với IOS thì hỗ trợ IOS 11 trở lên** .

Phiên bản hiện tại của  SDK được xây dựng dựa trên giao thức SIP 2.0, với lỗi là WebRTC các bộ mã được hỗ trợ đầy đủ giúp tối ưu hoá chất lượng cuộc gọi như : OPUS/G.711/G711a/G729/GSM

### Điều kiện bắt buộc <a href="#prerequisites" id="prerequisites"></a>

Trước khi bạn bắt đầu viết mã ứng dụng của mình:

1. [Đăng ký tài khoản OMICALL](https://sso.omicrm.io/). Bạn cần có tài khoản OMICALL để tạo kết nối từ SDK này vào hệ thống OMICALL để thực hiện cuộc gọi
2. Cấu hình tài khoản để tạo các người dùng có thể thực hiện cuộc gọi trên hệ thống OMICALL. Đầu tiên chúng ta cần tạo các tài khoản nhân viên tại [đây](https://docs.omicrm.io/nhan-vien/gioi-thieu) , mỗi tài khoản nhân viên này được cấp phát 1 số nội bộ, cùng với đó là user và mật khẩu để đăng nhập vào SDK OMICALL được tạo và chỉnh sửa ở [đây](https://docs.omicrm.io/cau-hinh-tong-dai/so-noi-bo)&#x20;
3. Cấu hình thông tin để tích hợp phần Notification vào ứng dụng&#x20;

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FiVn79Wybjt74E1Oku6sb%2Fimage.png?alt=media&amp;token=f3ae7de7-0e78-4193-bd6b-d694d572a396" alt=""><figcaption></figcaption></figure>


# Tại sao lại sử dụng OMICALL

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FJvczXxE5718owrd9BaqJ%2Fimage.png?alt=media&amp;token=6dad662e-6c84-4041-be16-cde428cdc3bd" alt=""><figcaption></figcaption></figure>

Ngày nay với sự phát triển của công nghệ để tạo một ứng dụng nghe gọi qua công nghệ Voip là vô cùng đơn giản, chỉ cần vài dòng code là đã có thể thực hiện được.

Tuy nhiên việc áp dụng VOIP vào môi trường production nơi mà mọi sai sót đều phải giảm thiểu tối đa, mọi thông số cần tối ưu hoá, để phù hợp với đại đa số hoàn cảnh thực tế , Điều này đòi hỏi kinh nghiệm và không phải đơn vị/ cá nhân nào cũng có thể làm tốt được.

Với một cuộc gọi Voip, thông thường các thông số sau sẽ cần được quan tâm:

* Jitter: độ trễ khi nhận các gói tin,  cao sẽ làm méo, giật giọng &#x20;
* Latency: độ trễ giữa các lần gửi các gói tin , cao sẽ làm méo, giật giọng&#x20;
* Package loss:  mất mát gói tin , cao sẽ làm méo, giật giọng&#x20;
* MOS: điểm đánh giá chất lượng cuộc gọi , điểm thấp sẽ làm méo, giật giọng&#x20;

Để tối ưu 4 thông số trên đòi hỏi phải quan tâm đến rất nhiều thông số bao gồm:

* **Phía client:**
  * Codec thoại phù hợp với từng dòng thiết bị smartphone&#x20;
  * Các thông số như frame rate/ bit rate cần được tính toán thời gian thực để có quyết định mã hoá cũng như giải mã với tốc độ vừa phải không ảnh hưởng chất lượng thoại&#x20;
  * Jitter buffer: thông số cực kỳ quan trọng trong điều kiện mạng yếu, buffer sẽ giúp chúng ta không bị loss dữ liệu, chiến thuật buffer như nào, chiến thuật để xử lý các gói tin tràn buffer ra sao là vấn đề quan trọng&#x20;
* **Phía máy chủ:**
  * Đòi hỏi phải tinh chỉnh các thông số codec tương tự&#x20;
  * Tuỳ vào bản tin phía client để xác định điều kiện mạng từ  đó đưa ra chiến thuật encode phù hợp để client có thể giải mã nhanh nhất ( giảm bit rate )&#x20;
  * Monitor thường xuyên các thông số bandwidth/ latency /RAm/CPU để có phương án dự phòng, nâng cấp, tránh làm giảm chất lượng ví dụ khi cần convert nhiều codec thì CPU sẽ cao, cần nâng cấp khi tới ngưỡng để tránh ảnh hưởng cuộc gọi

Hệ thống phải có các báo cáo rỏ ràng về các thông số trên để theo dõi, cảnh báo chất lượng thoại VOIP một cách tường minh.

Ở Omicall với đội ngũ kinh nghiệm hơn 10 năm VOIP, xây dựng Omicall hơn 5 năm, hoàn toàn có kinh nghiệm xử lý các vấn đề bên trên để đảm bảo chất lượng thoại, video call mượt mà nhất, ngay cả thời điểm chất lượng mạng kém.

Với Omicall không chỉ phục vụ như một tổng đài mà còn cả hệ sinh thái phía sau cuộc gọi : chiến dịch automation workflow,Ticket, Đã kênh, Mail, Drive ...., AI Callbot, AI Phân tích cuộc gọi, AI Speech 2 text ...


# Định nghĩa đầu số

mô tả các đầu số trong tổng đài, ý nghĩa, định dạng từng loại đầu số

Hiện tại trong tổng đài có nhiều tập dữ liệu khác nhau:

* Contact: lưu trữ thông tin liên hệ của khách hàng gồm tên/ số điện thoại ...&#x20;
* Nhân viên: lưu trữ các tài khoản của nhân viên, được phép truy cập vào web của công ty tuỳ theo phân quyền để sử dụng các chức năng . <mark style="color:green;">**Mỗi nhân viên được gán 1 đầu số gọi là số nội bộ để có thể tiếp nhận cuộc gọi hoặc gọi qua lại lẫn nhau**</mark>
* Nhóm nội bộ: Trong tổng đài Omicall cho phép gom nhóm nhiều nhân viên với nhau để tạo thành 1 nhóm các nhân viên, mục đích chia phòng ban, nhóm nhỏ để có thể lắng nghe cuộc gọi ví dụ nhóm chăm sóc khách hàng sẽ được phân nghe số hotline xxx . <mark style="color:green;">**Mỗi nhóm nội bộ được gán 1 đầu số nội bộ và có thể gọi tới đầu số nội bộ này từ một số nội bộ khác ví dụ số nội bộ của nhân viên gọi vào số nội bộ của nhóm nộ bộ, vẫn hợp lệ**</mark>&#x20;
* Tương tác phím: hay còn gọi là IVR , là một chương trình dùng để cấu hình tương tác với người dùng trong cuộc gọi, cho phép bắt được các sự kiện nhấn phím trên điện thoại của người dùng để có các hành động khác nhau ( phát nhạc chờ, chuyển cuộc gọi ...) khi người dùng nhấn phím 1, thì sẽ làm gì, phím 2 thì sẽ làm gì . <mark style="color:green;">**Mỗi tương tác phím được gán một đầu số nội bộ và có thể gọi tới đầu số nội bộ này từ một số nội bộ khác ví dụ số nội bộ của nhân viên gọi vào số nội bộ của nhóm nộ bộ, vẫn hợp lệ**</mark>
* Kịch bản : là một chương trình quy định các tham số cấu hình cuộc gọi cho một đầu số, tóm lại kịch bản sẽ quy định cách đầu số hoạt động như trỏ vào nhóm nội bộ nào, hay trỏ vào nhân viên nào... . <mark style="color:green;">**Mỗi  Kịch bản được gán một đầu số nội bộ và có thể gọi tới đầu số nội bộ này từ một số nội bộ khác ví dụ số nội bộ của nhân viên gọi vào số nội bộ của nhóm nộ bộ, vẫn hợp lệ**</mark>
* Đầu số của doanh nghiệp: là số SIP doanh nghiệp thuê của nhà mạng để đón cuộc gọi của khách hàng, định dạng 10 số&#x20;
* Số điện thoại khách hàng: là đầu số mobile phone của khách hàng dạng 10 số&#x20;

Định dạng ( Format ) của các đầu số :&#x20;

* Số điện thoai khách hàng thường: 10 chữ số&#x20;
* Số nội bộ:
  * Số nhân viên < 5 số&#x20;
  * Số kịch bản từ 5 -> 9 số&#x20;
  * Số cây tương tác phím IVR từ 5 -> 9 số&#x20;
  * Số nhóm nội bộ từ 5 -> 9 số


# Các SDK Hỗ Trợ

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FQH4qXG6luRX07ImccyxU%2Fimage.png?alt=media&amp;token=4ad5e53f-01b7-4443-925f-9f6dcf76d5f6" alt=""><figcaption></figcaption></figure>

Hiện tại Omicall hỗ trợ 4 SDK cho 4 ngôn ngữ mobile phổ biến nhất như sau:

### IOS native:

* GIT  <https://github.com/VIHATTeam/OmiKit>&#x20;
* Cocoapod: OmiKit

### Android Native:

* Git: <https://github.com/VIHATTeam/OMICALL-Android-SDK-Example>

### Flutter&#x20;

* Git: <https://github.com/VIHATTeam/OMICALL-Flutter-SDK-Sample>
* Pub: <https://pub.dev/packages/omicall_flutter_plugin>

### React-Native

* Git: <https://github.com/VIHATTeam/OMICALL-React-Native-SDK>
* NPM: <https://www.npmjs.com/package/omikit-plugin>

Ngoài ra đối với các ngôn ngữ hybrid có thể dễ dàng wrapper lại native SDK ( android/ios) của omicall để thực hiện cuộc gọi call/videocall


# Tài khoản đăng nhập

Lưu ý chỉ đăng nhập được bằng tài khoản nhân viên, hoăc đăng nhập bằng Apikey vào SDK để thực hiện cuộc gọi

## Cách 1: đăng nhập bằng tài khoản nhân viên:

Mỗi nhân viên có một số nội bộ để thực hiện cuộc gọi , số này được cấu hình trong tổng đài, khi đăng nhập vào web/mobile app hệ thống sẽ tự lấy số nội bộ này đăng nhập cho bạn.

Đối với SDK chúng ta cần 3 trường thông tin để đăng nhập vào thực hiện cuộc gọi&#x20;

* user: số nội bộ&#x20;
* password: mật khẩu
* realm: domain tổng đài&#x20;

Các thông tin này tìm chúng ta có thể truy cập trong phần : Cấu hình -> Tổng Đài -> Số nội bộ -> Nhấn vào chi tiết 1 số nội bộ&#x20;

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FJ2j5Y4Oud4mgqCsY07YJ%2Fimage.png?alt=media&amp;token=4270e2fc-8ad8-45d2-8815-9a7f3949ef53" alt=""><figcaption></figcaption></figure>

## Cách 2: đăng nhập bằng Api key:

Mỗi tài khoản sẽ được cấp một API key để truy cập dịch vụ&#x20;

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FjQjIuZPp0cd8s7MisE3g%2Fimage.png?alt=media&amp;token=be7581a5-ef51-4f07-9964-c812cdb1b023" alt=""><figcaption></figcaption></figure>

**Login SDK bằng lệnh:**

```
[OmiClient initWithUUID:<#(NSString * _Nonnull)#> fullName:<#(NSString * _Nullable)#> apiKey:<#(NSString * _Nonnull)#>]
```

Trong đó:

* uuid: là id định dạng của user ( có thể lấy username khách hàng của đối tác tích hợp SDK để làm uuid )
* fullName: Tên của khách hàng dùng để hiển thị khi có cuộc gọi đến&#x20;
* apiKey: key dùng để xác minh khách hàng


# IOS SDK


# Cấu hình Push Notification

OMICALL iOS SDK - Thiết lập thông tin Push Notification

Tài liệu này giải thích cách lấy thông tin đăng nhập bạn cần để nhận cuộc gọi đến trên OMICALL iOS SDK bằng PushKit. Để nhận cuộc gọi đến, bạn phải:

1. Bật các dịch vụ VoIP trong ứng dụng của bạn.
2. Tạo chứng chỉ dịch vụ VoIP.
3. Tạo hồ sơ cấp phép cho ứng dụng của bạn.
4. Tạo thông tin xác thực đẩy (tệp .p12) bằng chứng chỉ VoIP.
5. Cập nhật thông tin trên bảng điều khiển OMICALL.

Thực hiện từng bước này như sau.

**Bật các dịch vụ VoIP trong ứng dụng của bạn**

Để bật các dịch vụ VoIP từ Xcode, hãy chọn tab Capabilities, sau đó:

1. Đảm bảo đã thêm Push Notifications and Background Modes.
2. Trong Chế độ nền Background Modes, enable Audio, AirPlay, and Picture in Picture; Voice over IP; Background Fetch; and Remote Notifications settings.

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2F83a01pd3FY0AH4uQYH5U%2FPicture1.jpg?alt=media&amp;token=b3e0ad0f-4407-42f0-9697-9baf7fd673f9" alt=""><figcaption></figcaption></figure>

1. Trên tab Thông tin, thêm “App provides Voice over IP services” vào danh sách “Required Background Modes”

.

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2Fbd3GsbhMcvnQDibUIPZe%2FPicture2.jpg?alt=media&amp;token=32a47de0-42c5-4fb5-bd46-5259888d2296" alt=""><figcaption></figcaption></figure>

**Thêm Quyền truy cập Microphone/Camera cho ứng dụng**&#x20;

`Mở file cấu hình info.plist để thêm các key sau vào cấu hình`

```markup
<key>NSMicrophoneUsageDescription</key>
<string>Need microphone access for make Call</string>
<key>NSCameraUsageDescription</key>
<string>Need camera access for video call functions</string>
```

**Tạo chứng chỉ dịch vụ VoIP**

Để tạo Chứng chỉ dịch vụ VoIP, hãy tạo yêu cầu ký chứng chỉ (CSR), sau đó tạo chứng chỉ dịch vụ bằng CSR.

**Tạo yêu cầu ký chứng chỉ (CSR)**

Yêu cầu ký chứng chỉ (CSR) là điều kiện tiên quyết để tạo chứng chỉ trong [Dev Center](https://developer.apple.com/membercenter).

&#x20;. Để tạo CSR:

1. Mở quyền truy cập Chuỗi khóa bằng cách chọn “Truy cập chuỗi khóa” trong thư mục Tiện ích.

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FTWqaKiPAPEKXPwMa5tbk%2FPicture3.jpg?alt=media&amp;token=fb0f6dbc-fe98-4c41-9be5-ca9b15b338ce" alt=""><figcaption></figcaption></figure>

1. Từ menu “Truy cập chuỗi khóa”, điều hướng đến **Certificate Assistant > Request a Certificate From a Certificate Authority**

![](https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FfXPTRsFEPltO7K2moIPb%2FPicture4.jpg?alt=media\&token=4a4d3a6e-5048-49b3-9cb0-d8c03bd4f496)

1. Nhập tên mô tả cho CSR của bạn. Ví dụ: ios\_OMICALL\_app.certSignsRequest.
2. Chọn vị trí để lưu nó trên ổ cứng của bạn, sau đó nhấp vào **Lưu** .
3.

```
<figure><img src="/files/YrIXeRlV3ZsQ68HS9KtT" alt=""><figcaption></figcaption></figure>
```

4. Đăng nhập vào [Bảng điều khiển dành cho nhà phát triển của Apple](https://developer.apple.com/) .&#x20;

&#x20;

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FXXaplxP03ZyRBzlBomeG%2FPicture6.png?alt=media&amp;token=d9a64d4f-22ef-4160-8996-6d228cd27ed7" alt=""><figcaption></figcaption></figure>

1. Điều hướng đến trang Certificates, Identifiers & Profiles và nhấp vào '+' để thêm chứng chỉ mới.

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FJtK3EDSbkBvwtqGtDtvI%2FPicture7.jpg?alt=media&amp;token=5c038401-ac1f-4219-b8c3-e0512da35f5e" alt=""><figcaption></figcaption></figure>

1. Trong loại chứng chỉ, hãy chọn VoIP Services Certificate', sau đó nhấp vào Continue.

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FDzmk79vfz2fPcnV7sJSZ%2FPicture8.jpg?alt=media&amp;token=48c30afc-d148-45c0-bf73-1f36a9b6b259" alt=""><figcaption></figcaption></figure>

1. Nhấp vào Continue để tiếp tục.
2. Từ danh sách ID ứng dụng, hãy chọn ID ứng dụng được liên kết với ứng dụng của bạn.

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FRL4j7NzhpQdVH95v6PDL%2FPicture9.jpg?alt=media&amp;token=d8587058-e9e7-4245-8729-63f83c89db3d" alt=""><figcaption></figcaption></figure>

1. Để chọn và tải lên tệp CSR được tạo từ Keychain, hãy nhấp vào Choose File.

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2F2WlDawzYr6bCZewXOzPL%2FPicture10.jpg?alt=media&amp;token=f1893ab7-0a8d-489f-b1ce-56284e817cac" alt=""><figcaption></figcaption></figure>

1. Để tải xuống và lưu chứng chỉ VoIP, hãy nhấp vào 'Download'.

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FruCxc2vM1dpLTXBFgXt7%2FPicture11.jpg?alt=media&amp;token=7421e638-7554-4bcf-8470-5c93838bacd1" alt=""><figcaption></figcaption></figure>

**Tạo hồ sơ cấp phép cho ứng dụng của bạn**

Để tạo hồ sơ cấp phép cho ứng dụng của bạn:

1. Điều hướng đến phần Hồ sơ cấp phép trên [Apple Developer Portal](https://developer.apple.com/account/ios/profile/)
2. Nhấp vào “+” để thêm Hồ sơ cấp phép mới.

**Để thiết lập hồ sơ cấp phép cho môi trường thử nghiệm**

1. Chọn Phát triển ứng dụng iOS làm loại hồ sơ cấp phép.
2. Nhấp vào Tiếp tục.
3. Chọn ID ứng dụng của bạn.
4. Chọn chứng chỉ nhà phát triển bạn muốn đưa vào hồ sơ cấp phép này.
5. Chọn thiết bị của nhà phát triển mà bạn muốn đưa vào hồ sơ cấp phép này.
6. Nhập tên cho hồ sơ cấp phép.
7. Nhấp vào Tải xuống để tải xuống và lưu hồ sơ đã tạo.

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FlzbcDurym5Z6X8lsUoU9%2FPicture12.jpg?alt=media&amp;token=ab9721de-2f1f-4329-862d-9546f63d2f76" alt=""><figcaption></figcaption></figure>

**Để thiết lập hồ sơ cấp phép cho môi trường Triển khai ( Production)**

1. Nếu bạn định gửi ứng dụng của mình lên cửa hàng ứng dụng, hãy chọn Cửa hàng ứng dụng trong Phân phối cho môi trường sản xuất. Nếu không, hãy chọn loại phân phối Ad Hoc.

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FCxijHwR8pO29NwbEfG2o%2FPicture13.jpg?alt=media&amp;token=4e8a1824-9ffa-42ef-b9f7-4f67a7d0f11c" alt=""><figcaption></figcaption></figure>

1. Nhấp vào Tiếp tục.
2. Chọn ID ứng dụng của bạn.
3. Chọn chứng chỉ phân phối iOS mà bạn muốn đưa vào hồ sơ cấp phép này. Đây phải là chứng chỉ App Store hoặc Ad Hoc cho ứng dụng sản xuất của bạn.
4. Nhập tên cho hồ sơ cấp phép.
5. Nhấp vào Tải xuống để tải xuống và lưu hồ sơ đã tạo.

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FjSPFm0xrqxl26YKet3ln%2FPicture14.jpg?alt=media&amp;token=038a32c3-5601-4b55-b2b8-e3fb21ae76d4" alt=""><figcaption></figcaption></figure>

**Ghi chú:**

Tệp được tải xuống với phần mở rộng .mobileprovision.

**Tạo thông tin đăng nhập đẩy với Chứng chỉ dịch vụ VoIP của bạn**

Để tạo thông tin đăng nhập đẩy với Chứng chỉ dịch vụ VoIP của bạn:

1. Xuất Chứng chỉ dịch vụ VoIP của bạn dưới dạng **.p12** tệp từ Truy cập chuỗi khóa.<br>

   <figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2Fovt7CXFDOVQQPNSoaKfM%2FPicture15.jpg?alt=media&amp;token=76e16b19-1e73-483d-a100-c787f1f2857e" alt=""><figcaption></figcaption></figure>
2. Nhập tên duy nhất cho chứng chỉ, sau đó nhấp vào Lưu.<br>

   <figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FGNzVCwRBEnaXCJAMzqYC%2FPicture16.jpg?alt=media&amp;token=f75838e2-70c0-40c9-8c15-9f565218b3e1" alt=""><figcaption></figcaption></figure>

**Ghi chú:**

*Bạn không cần nhập mật khẩu để tạo tệp .p12. Bấm OK nếu bạn được nhắc nhập mật khẩu để bảo vệ mục đã xuất. Khóa riêng tư của ứng dụng sẽ được lưu trữ ở định dạng .p12.*

\
![](https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2F0pDUo4RmRJk8uY1FNN8I%2FPicture17.png?alt=media\&token=7e1c1d6b-8bb5-43d8-9407-a39043b8dfdc)

**Cập nhật thông tin trên bảng điều khiển OMICALL**

**1. Cập nhật thông tin trên bảng điều khiển OMICALL**

**Ghi chú:**

Bạn có thể thay đổi môi trường từ thử nghiệm ( Sandbox) sang Triển khai ( Production ), nhưng không thể thay đổi môi trường từ Production sang Sandbox. Để thay đổi môi trường của bạn thành Sandbox từ phiên bản Production, hãy xóa chứng chỉ và tạo một chứng chỉ mới cho Sandbox. Nếu bạn xóa chứng chỉ Production, bạn sẽ ngừng nhận cuộc gọi đến.

1. Mở tệp chứng chỉ ( certificate ), chỉ lấy nội dung khoá từ —–BEGIN CERTIFICATE—– đến—–END CERTIFICATE—–.
2. Từ tệp khóa ( Key ), chỉ lấy nội dung khoá từ —–BEGIN RSA PRIVATE RSA—– và —–END RSA PRIVATE RSA—–.
3. Trong bảng điều khiển OMICALL, đi tới [Cài đặt -> Tích hợp](https://ocp52033.omicrm.vn/config/company/integrated/api) .&#x20;

&#x20;

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FXUb1fYVXF9FrCQ1XaFKr%2FPicture18.png?alt=media&amp;token=9ea39a6c-9031-40f5-9534-66771cf58884" alt=""><figcaption></figcaption></figure>

Chọn tiếp Chỉnh sửa -> Nhấn nút thêm chứng chỉ

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FGnIQEHq0CvkPitF6F0qi%2Fimage.png?alt=media&amp;token=a1e5c1f3-3bd5-45c9-85bd-974373241b76" alt=""><figcaption></figcaption></figure>

Đối với IOS chúng ta chọn APNS và Android là FCM

&#x20;


# Cài đặt

Cài đặt SDK IOS

SDK Kit hỗ trợ Omi OO

## Bạn có thể cài đặt bằng 2 cách&#x20;

### Cách 1: Cài đặt thủ công

* Tải  File cài đặt tại đây <https://github.com/VIHATTeam/OmiKit/archive/refs/tags/1.0.2.zip>
* Sau đó giải nén chúng ta được Framework như hình

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FqVJXLu3DRacdIcrcTThh%2Fimage.png?alt=media&amp;token=feacf43e-a9d4-43b6-918f-9e8e16983b84" alt=""><figcaption></figcaption></figure>

* Bước tiếp theo click chuột vào thư mục OmiKit.xcframework sau đó kéo vào bất kỳ nơi nào của Project để sử dụng

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2F90eNyylmcZVrpXDk62Kh%2Fimage.png?alt=media&amp;token=35479e72-4345-4351-9e85-f6225ac303bd" alt=""><figcaption></figcaption></figure>

* Bước cuối cùng cần vào phần cài đặt Target của Project để cấu hình framework chọn option Embed & Sign framework như hình:
*

```
<figure><img src="/files/nu6s0OlUb2xjkKwyeOEW" alt=""><figcaption></figcaption></figure>
```

### Cách 2: Cài đặt tự động

Chúng ta sẽ sử dụng POD để cài đặt tự động&#x20;

Trong Podfile chúng ta khai báo bổ sung 1 dòng như sau:

*<mark style="color:blue;">pod 'OmiKit', :git => '<https://github.com/VIHATTeam/OmiKit.git>'</mark>*

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2Fwfyap09n2eoZCixN7AG7%2Fimage.png?alt=media&amp;token=88e79e11-c9a2-4a33-b46a-4bca043250ae" alt=""><figcaption></figcaption></figure>

* Sau đó vào thư mục gốc chạy lệnh *pod install* để cài đặt tự động

Sau bước cài đặt framework chúng ta đã có thể import vào để sử dụng:

&#x20;

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2F8nCpovJ91DXupquX1EQl%2Fimage.png?alt=media&amp;token=cdf70cee-ae1a-4952-8635-1cea9e993fb4" alt=""><figcaption></figcaption></figure>


# Khởi tạo SDK

Đối với IOS Omicall cung cấp cài đặt cho 2 môi trường kiểm thử ( Sanbox ) và triển khai  ( Production )

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FkoomYpw8t2ZgBGHGS04n%2Fimage.png?alt=media&amp;token=7faf6bf2-1694-4208-94c1-40718e437acb" alt=""><figcaption><p>Cấu hình các chứng chỉ cho từng môi trường phát triển trên Omicall</p></figcaption></figure>

Chúng ta cần import lớp thư viện để bắt đầu

```objectivec
#import <OmiKit/OmiKit.h>
```

## Bước 1: cài đặt môi trường:&#x20;

```objectivec

[OmiClient setEnviroment:KEY_OMI_APP_ENVIROMENT_SANDBOX];
có 2 biến môi trường:
- KEY_OMI_APP_ENVIROMENT_SANDBOX
- KEY_OMI_APP_ENVIROMENT_PRODUCTION
```

## Bước 2: Cài đặt lớp xử lý Voip Push :&#x20;

```objectivec
provider = [[CallKitProviderDelegate alloc] initWithCallManager: [OMISIPLib sharedInstance].callManager ];
voipRegistry = [[PKPushRegistry alloc] initWithQueue:dispatch_get_main_queue()];
pushkitManager = [[PushKitManager alloc] initWithVoipRegistry:voipRegistry];
```

## Bước 3: Cài đặt xử lý Push notification:

```objectivec
- (void)requestPushNotificationPermissions
{
    // iOS 10+
    UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter];
    [center getNotificationSettingsWithCompletionHandler:^(UNNotificationSettings * _Nonnull settings) {
        switch (settings.authorizationStatus)
        {
            // User hasn't accepted or rejected permissions yet. This block shows the allow/deny dialog
            case UNAuthorizationStatusNotDetermined:
            {
                center.delegate = self;
                [center requestAuthorizationWithOptions:(UNAuthorizationOptionSound | UNAuthorizationOptionAlert | UNAuthorizationOptionBadge) completionHandler:^(BOOL granted, NSError * _Nullable error)
                 {
                     if(granted)
                     {
                         dispatch_async(dispatch_get_main_queue(), ^{
                             [[UIApplication sharedApplication] registerForRemoteNotifications];
                         });
                     }
                     else
                     {
                         // notify user to enable push notification permission in settings
                     }
                 }];
                break;
            }
            case UNAuthorizationStatusAuthorized:
            {
                dispatch_async(dispatch_get_main_queue(), ^{
                    [[UIApplication sharedApplication] registerForRemoteNotifications];
                });
                break;
            }
            default:
                break;
        }
    }];
}

- (void)application:(UIApplication*)app didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)devToken
{
    // parse token bytes to string
    const char *data = [devToken bytes];
    NSMutableString *token = [NSMutableString string];
    for (NSUInteger i = 0; i < [devToken length]; i++)
    {
        [token appendFormat:@"%02.2hhX", data[i]];
    }
    [OmiClient setUserPushNotificationToken:[token copy]];
}


```

## Bước 4: Khởi tạo thư viện

Có 2 cách khơi tạo:

#### Cách 1: khởi tạo bằng thông tin của số nội bộ ( cấp cho nhân viên - [xem ở đây ](/sdk/mobile-sdk/dinh-nghia-dau-so))

```objectivec
    [OmiClient initWithUsername:@"xx" password:@"xx" realm:@""];
    [OmiClient startOmiService];
```

#### Cách 2: khởi tạo bằng apiKey cấp phát cho doanh nghiệp:

Mỗi tài khoản sẽ được cấp một API key để truy cập dịch vụ&#x20;

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FjQjIuZPp0cd8s7MisE3g%2Fimage.png?alt=media&amp;token=be7581a5-ef51-4f07-9964-c812cdb1b023" alt=""><figcaption></figcaption></figure>

**Login SDK bằng lệnh:**

```
[OmiClient initWithUUID:<#(NSString * _Nonnull)#> fullName:<#(NSString * _Nullable)#> apiKey:<#(NSString * _Nonnull)#>]
```

Trong đó:

* uuid: là id định dạng của user ( có thể lấy username khách hàng của đối tác tích hợp SDK để làm uuid )
* fullName: Tên của khách hàng dùng để hiển thị khi có cuộc gọi đến&#x20;
* apiKey: key dùng để xác minh khách hàng


# Xử lý các sự kiện

## Notification callback

### Call notification:

#### 1. To listen event of Call we setting notification:

```
   [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(callStateChanged:) name:OMICallStateChangedNotification object:nil];
```

Declare function Listen event Call State to know when call confirm or invite state: Notification key: OMICallStateChangedNotification Example

```
- (void)callStateChanged: (NSNotification *)notification {
   
   __weak typeof(self)weakSelf = self;
   dispatch_async(dispatch_get_main_queue(), ^{
       __weak  OMICall *call = [[notification userInfo] objectForKey:OMINotificationUserInfoCallKey];
       switch(call.callState)
       {
           case OMICallStateEarly:
               OMILogDebug(@"callStateChanged OMICallStateEarly : %@",call.uuid.UUIDString);
               break;
           case OMICallStateCalling:
               OMILogDebug(@"callStateChanged OMICallStateCalling : %@",call.uuid.UUIDString);
               break;
           case OMICallStateIncoming:{
               OMILogDebug(@"callStateChanged OMICallStateIncoming : %@",call.uuid.UUIDString);
               break;
           }
           case OMICallStateConnecting:
               OMILogDebug(@"callStateChanged OMICallStateConnecting : %@",call.uuid.UUIDString);
               break;
           case OMICallStateConfirmed:{
               OMILogDebug(@"callStateChanged OMICallStateConfirmed : %@",call.uuid.UUIDString);
              
               break;
           }
           case OMICallStateDisconnected:
               OMILogDebug(@"callStateChanged OMICallStateDisconnected : %@",call.uuid.UUIDString);
               break;
       }
   });
}
```

#### 2. Listen event Media event:

Notification key: OMICallMediaStateChangedNotification Example:

```
- (void)callMediaStateChanged: (NSNotification *)notification {
    
    __weak typeof(self)weakSelf = self;
    dispatch_async(dispatch_get_main_queue(), ^{
        OMICallMediaState mediaState = (OMICallMediaState)[[notification userInfo] objectForKey:OMINotificationUserInfoCallMediaStateKey];
        switch(mediaState)
        {
            case OMICallStateMuted:
                OMILogDebug(@"OMICallMediaState OMICallStateMuted");
                break;
            case OMICallStateToggleSpeaker:
                OMILogDebug(@"OMICallMediaState OMICallStateToggleSpeaker");
                break;
            case OMICallStatePermissionCameraDenied:
                OMILogDebug(@"OMICallMediaState OMICallStateToggleSpeaker");
                break;
            case OMICallStatePermissionMicrophoneDenied:
                OMILogDebug(@"OMICallMediaState OMICallStateToggleSpeaker");
                break;
            
        }
    });
}
```

#### 3. Listen event call misscall:

```
[Omiclient setMissedCallBlock:^(OMICall * _Nonnull __weak call) {
        <#code#>
}];
```

#### 4. Listen the Video call state

when event come we need to re-render video screen Detail sample project can view here: <https://github.com/VIHATTeam/IOS-Objective-VideoCall-Example>

```
### Listen: 
```

````
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(videoNotification:) name:OMICallVideoInfoNotification object:nil];
    ```
    ### Process: 
```ruby
    -(void) videoNotification:(NSNotification *) noti {
        NSDictionary *dic = [noti userInfo];
        NSNumber * state = [dic valueForKey:OMIVideoInfoState];
        switch([state intValue]){
            case OMIVideoRemoteReady:{
                [self startPreview];
                break;
            }
        }
    }
````

```
### Show Video Preview:
```

```
    - (void)startPreview {
        __weak typeof(self) weakSelf = self;
        if(!_remoteVideoRenderView || !_localVideoRenderView) return;
        
            dispatch_async(dispatch_get_main_queue(), ^{
                weakSelf.remoteVideoRenderView.contentMode = UIViewContentModeScaleAspectFill;
                [weakSelf.remoteVideoRenderView setView:[self.videoManager createViewForVideoRemote:weakSelf.remoteVideoRenderView.frame]];
                weakSelf.localVideoRenderView.contentMode = UIViewContentModeScaleAspectFill;
                [weakSelf.localVideoRenderView setView:[self.videoManager createViewForVideoLocal:weakSelf.localVideoRenderView.frame]];
            });
    }
```

#### 5. Listen the network health for update UI instruction for user

The information we calculator on MOS score and device 3 level bellow

```
    Listen: 
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateNetworkHealth:) name:OMICallNetworkQualityNotification object:nil];
    
    Process: 
    
    -(void) updateNetworkHealth:(NSNotification *) noti {
        NSDictionary *dic = [noti userInfo];
        NSNumber * state = [dic valueForKey:OMINotificationNetworkStatusKey];
        switch([state intValue]){
            case OMINetworkGood:{
                [self.networkStatus setImage: [UIImage imageNamed: @"network_best"]];
                break;
            }
            case OMINetworkMedium:{
                [self.networkStatus setImage: [UIImage imageNamed: @"network_medium"]];
                break;
            }
            case OMINetworkBad:{
                [self.networkStatus setImage: [UIImage imageNamed: @"network_bad"]];
                break;
            }
        }
    }
```

<br>


# Android SDK

Hướng dẫn chi tiết việc tích hợp vào OMICALL SDK trên Android


# Cấu hình SDK

Để tạo một ứng dụng Android hỗ trợ VoIP:

1. Cầu hình setting.gradle của Project như sau:

```java
dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        google()
        mavenCentral()
        jcenter() // Warning: this repository is going to shut down soon
        maven {
            url("https://vihat.jfrog.io/artifactory/vihat-local-repo")
            credentials {
                username = "anonymous"
            }
        }
    }
}
```

2\. Cấu hình trong File build.gradle ở thư mục app như sau :&#x20;

`implementation 'vn.vihat.omicall:omisdk:0.9.6'`

3\. Add library required by SDK

```java
implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.fragment:fragment-ktx:1.4.0'
implementation 'androidx.activity:activity-ktx:1.4.0'
implementation 'androidx.appcompat:appcompat:1.5.0'
implementation 'com.google.android.material:material:1.6.1'
implementation 'com.google.firebase:firebase-messaging-ktx:23.0.8'
implementation 'com.google.android.flexbox:flexbox:3.0.0'
implementation "com.google.code.gson:gson:2.8.6"

```

&#x20;4\. Bổ sung đoạn mã sau ở đầu File  build.gradle:

```java
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'

```

`5.` Sync project with gradle


# Cấu hình Push Notification

**Thiết lập Push Notification**

Phần này giải thích cách nhận cuộc gọi đến trên OMICALL Android SDK bằng Firebase. Để nhận cuộc gọi đến, bạn phải:

1. Tạo một dự án trên Firebase.
2. Đăng ký ứng dụng của bạn trên Firebase.
3. Thêm tệp cấu hình Firebase và SDK vào ứng dụng của bạn.
4. Sao chép khóa máy chủ dự án Firebase vào trang tổng quan OMICALL.

Các bước thực hiện như sau:

1. Tạo một dự án trên Firebase
2.

```
* Trên [bảng điều khiển Firebase](https://console.firebase.google.com/) , nhấp vào Thêm dự án.
```

```
* Thêm tên dự án và nhấp vào Tạo dự án.&#x20;

&#x20;

<figure><img src="/files/i1uHUoRcirhaQhuT3GEc" alt=""><figcaption></figcaption></figure>
```

3\. Đăng ký ứng dụng của bạn trên Firebase
4\.

```
* Chuyển đến phần Android trên trang chủ Dự án của bạn.
* Đăng ký App Android của bạn trên Firebase.&#x20;

&#x20;

* Bấm vào Đăng ký ứng dụng.

<figure><img src="/files/JzEqmfTNCd1YwCv36JEL" alt=""><figcaption></figcaption></figure>
```

5\. Thêm tệp cấu hình Firebase và SDK vào ứng dụng của bạn
6\.

```
* Tải xuống tệp Firebase google-services.json.



* Di chuyển google-services.json đã tải xuống vào thư mục gốc mô-đun ứng dụng Android của bạn.
* Nhấp vào Tiếp theo.
* Thực hiện cập nhập cấu hình Gradle của ứng dụng Android của bạn theo hướng dẫn.



* Chờ xác minh hoàn tất, sau đó tiếp tục đến bảng điều khiển.



<figure><img src="/files/VgJANfOVgFSh5jVaJR87" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/IPL2lJw75IVIIJHTW9BX" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/VMuvxMeaqsXMOb0LGGv9" alt=""><figcaption></figcaption></figure>
```

7\. Sao chép khóa máy chủ dự án Firebase vào trang tổng quan OMICALL
8\.  Vào phần cài đặt của dự án -> Cloud Messaging để lấy khoá gửi tin thông báo . &#x20;

```
<figure><img src="/files/IMkx9A2FbszQ4eRGsfvi" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/roGMXu9jT7oovqpi13bk" alt=""><figcaption></figcaption></figure>
```

&#x20;

9\. Trong bảng điều khiển OMICALL, đi tới [Cài đặt -> Tích hợp](https://ocp52033.omicrm.vn/config/company/integrated/api) .&#x20;

&#x20;

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FXUb1fYVXF9FrCQ1XaFKr%2FPicture18.png?alt=media&amp;token=9ea39a6c-9031-40f5-9534-66771cf58884" alt=""><figcaption></figcaption></figure>

Chọn tiếp Chỉnh sửa -> Nhấn nút thêm chứng chỉ

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FaTZowZkFFqDhVce8xmMT%2FPicture19.png?alt=media&amp;token=acba4f45-b47b-44c2-b724-4ee3f53a1317" alt=""><figcaption></figcaption></figure>

Đối với Android chúng ta chọn FCM và điền thông tin Key vào , lưu lại

&#x20;


# Khởi tạo SDK

## Omi SDK usages

### Thông tin tài khoản cần cung cấp cho SDK <a href="#user-content-account-informations-for-initialize-sdk" id="user-content-account-informations-for-initialize-sdk"></a>

Mỗi tài khoản thực hiện cuộc gọi trong OMI là tài khoản tổng đài của nhân viên, tài khoản này dùng để đăng nhập vào hệ thống tổng đài gồm các thông tin

* User name : Tên đăng nhập
* Password : Mật khẩu
* Realm : Domain của doanh nghiệp , domain này khi đăng ký và đăng nhập trên Web sẽ hiện thị đường dẫn có domain như sau:&#x20;

![](https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FcxTEvRY6B3kt1wvBC7Wm%2Fimage.png?alt=media\&token=29c56b4a-1d6c-446a-91bd-a496ba7bbde7)

* customUI: Dùng để tuỳ chỉnh màn hình thoại đến và đi

Khởi tạo Omi SDK bằng cách thêm đoạn mã sau vào trong MainActivity của Project

```java
OmiClient(requireContext()).register(
    userName,
    password,
    realm,
    customUI = true
)
OmiSDKUtils.startOmiService(requireActivity())
```

### Xử lý kết quả trả về khi xin các quyền cần thiết  <a href="#user-content-handle-permissions-result" id="user-content-handle-permissions-result"></a>

Use OmiSDKUtils to handle permissions results

```java
override fun onRequestPermissionsResult(
        requestCode: Int,
        permissions: Array<out String>,
        grantResults: IntArray
) {
    super.onRequestPermissionsResult(requestCode, permissions, grantResults)
    OmiSDKUtils.handlePermissionRequest(requestCode, permissions, grantResults, requireActivity())
}
```

### &#x20;<a href="#user-content-listeners" id="user-content-listeners"></a>


# Lắng nghe các sự kiện

### Thực hiện cuộc gọi

&#x20;Để thực hiện một cuộc gọi ra chúng ta gọi hàm như sau

```java
InCallActivity.startInCall(
                requireContext(),
                phoneNumber
            )

```

### &#x20;<a href="#user-content-handle-call-by-yourself" id="user-content-handle-call-by-yourself"></a>

### Lắng nghe các sự kiện <a href="#user-content-listeners" id="user-content-listeners"></a>

Khi sử dụng SDK các sự kiện từ SDK sẽ được notification ra bằng cách lắng nghe các lớp&#x20;

* `OmiListener` Lắng nghe các sự kiện trong cuộc gọi

`OmiListener`&#x20;

<table><thead><tr><th>Tên hàm</th><th width="214">Mô tả </th><th>Ví dụ</th></tr></thead><tbody><tr><td><code>onAccountRegistered</code></td><td>Sự kiện được gọi khi tài khoản đăng nhập thành công</td><td></td></tr><tr><td>onAccountRegisterFailed</td><td>Sự kiện được gọi khi tài khoản đăng nhập thất bại</td><td></td></tr><tr><td>onCallEstablished</td><td>Sự kiện được gọi khi cuộc gọi được thiết lập thành công</td><td></td></tr><tr><td>onCallEnd</td><td>Sự kiện được gọi khi cuộc gọi kết thúc</td><td></td></tr><tr><td>incomingReceived</td><td>Sự kiện được gọi khi có cuộc gọi đến</td><td></td></tr><tr><td>onRinging</td><td>Cuộc gọi kết nối thành công đang đổ chuông</td><td></td></tr><tr><td>onConnectionTimeout</td><td>Cuộc gọi kết nối thất bại do không nhận được phản hồi của máy chủ </td><td></td></tr><tr><td>onHold</td><td>Cuộc gọi bị giữ lại</td><td><p></p><pre><code>OmiClient.instance.toggleHold()
</code></pre><p></p></td></tr><tr><td>onMuted</td><td>Cuộc gọi bị tắt âm thanh</td><td><pre><code>OmiClient.instance.toggleMute()
</code></pre></td></tr></tbody></table>

để làm việc này chúng ta cần thực hiện như sau:

```java
OmiClient.instance.setListener(OmiListener)
```

### Thông báo cuộc gọi đến <a href="#user-content-handle-call-by-yourself" id="user-content-handle-call-by-yourself"></a>

Initialize SDK with customUI parme set to true

Thông thường SDK sẽ tự có màn hình để hiển thị cuộc gọi đến như sau:

<img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2F5FOVxDC8o4Pq5oNzGLYY%2Fimage.png?alt=media&amp;token=c05909e2-6f7e-42f0-888e-f3c1ff8a94aa" alt="" data-size="original">

Trường hợp bạn muốn mình tự Custom màn hình này thì có thể tuỳ chỉnh cấu hình SDK như sau:

```java
OmiClient(requireContext()).initSDK(
    userName,
    password,
    realm,
    customUI = true
)
```

Sau đó chúng ta sẽ cài đặt Listenner để lắng nghe sự kiện thông báo cuộc gọi tới như sau:

```java
OmiClient.instance.setListener(OmiListener)
```

### Các sự kiện khi cuộc gọi diễn ra <a href="#user-content-actions-when-in-a-call" id="user-content-actions-when-in-a-call"></a>

Các sự kiện chúng ta có thể thực hiện để can thiệp vào một cuộc gọi bao gồm :

&#x20;

<table><thead><tr><th>Tên hàm</th><th>Mô tả</th><th>Ví dụ</th></tr></thead><tbody><tr><td>pickUp</td><td>chấp nhận cuộc gọi tới</td><td><pre><code>OmiClient.instance.pickUp()
</code></pre></td></tr><tr><td>decline</td><td>Từ chối cuộc gọi</td><td><p></p><pre><code>OmiClient.instance.decline()
</code></pre><p></p></td></tr><tr><td>hangup</td><td>Tự chối cuộc gọi </td><td><p></p><pre><code>OmiClient.instance.hangUp()
</code></pre><p></p></td></tr><tr><td>toggleHold</td><td>Giữ cuộc gọi hiện tại </td><td><p></p><pre><code>OmiClient.instance.toggleHold()
</code></pre></td></tr><tr><td>toggleMute</td><td>Tắt âm thanh cuộc gọi hiện tại</td><td><pre><code>OmiClient.instance.toggleMute()
</code></pre></td></tr></tbody></table>


# Flutter SDK

Để cài đặt và cấu hình  Flutter SDK, xem chi tiết tại:

* Git: <https://github.com/VIHATTeam/OMICALL-Flutter-SDK-Sample>
* Pub: <https://pub.dev/packages/omicall_flutter_plugin>


# React-Native SDK

\
Để cài đặt và cấu hình React-Native SDK, xem chi tiết tại&#x20;

* Git: <https://github.com/VIHATTeam/OMICALL-React-Native-SDK>
* NPM: <https://www.npmjs.com/package/omikit-plugin>


# Deep Links App to App

&#x20;Tài liệu hướng dẫn mở Deep Links App to App

### 1.  Yêu Cầu&#x20;

#### **a. Thiết bị đã cài đặt ứng dụng OMICALL cho cả  lẫn  android và ios**

&#x20; \- Link cài đặt iOS: [https://apps.apple.com/app/omicall](https://apps.apple.com/app/id1588489273)

&#x20;  \- Link cài đặt Android: [https://play.google.com/store/apps/omicall](https://play.google.com/store/apps/details?id=vn.vihat.omicall)

#### b. Yêu cầu người dùng đã đăng nhập sẵn vào ứng dụng OMICALL và luôn bật trạng thái kết nối tổng đài

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FyK3DeWpPQOaJyG92TnLM%2FCleanShot%202024-08-19%20at%2011.07.29.png?alt=media&amp;token=05c75205-87e9-435d-930c-1c87fbe0e0e1" alt=""><figcaption></figcaption></figure>

\- Hình ảnh mô tả trường hợp người dùng tắt kết nối tổng đài

### 2. Hướng dẫn

#### a. Hướng dẫn thực hiện hiện cuộc gọi từ app khách hàng sang app OMICAL

* Từ App của khách hành thực hiện cuộc gọi sang App OMICALL trên nền tảng iOS/Android theo cú pháp:

**omicall-call:\[phoneNumber]\&deeplink=\[yourDeepLink]\&param1=\[yourContent1]& param2=yourContent2]**

*Trong đó :*

* “**omicall-call**” là cú pháp của OMI
* “**\[phoneNumber]**” là chuỗi string số điện thoại khách hàng cần gọi đến *(lưu ý: quý khách hàng tự validate số điện thoại của mình hợp lệ trước khi gọi sang OMI).*
* “**\[yourDeepLink]**” là deeplink ứng dụng khách hàng cần callback mở lại app của mình sau khi KH bấm nút SaveCall trên app OMI.
* **\[yourContent1]** là nội dung khách hàng cần lưu vào cuộc gọi khi truyền sang app OMI.
* **\[yourContent2]** là nội dung khách hàng cần lưu vào cuộc gọi khi truyền sang app OMI.

*Lưu ý:*  &#x20;

*- Định dạng khi lưu sẽ là: **yourContent1-yourContent2***

*- DeepLink khách hàng truyền sang OMI là định dạng **https**.*

*- Các giá trị \&deeplink, \&param1, \&param2 đều là các gía trị không bắt buộc, định dạng String.*

\- Ví dụ minh hoạ:

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2Fh6tX7M9EM0aZb8173naQ%2Fimage.png?alt=media&amp;token=f42f62be-176c-4779-9b16-7baf4fea1553" alt=""><figcaption></figcaption></figure>

\-       Định dạng deepLink OmiCall mở lại app của bạn:

**\[yourDeepLink]://?callomiId=\[callId]**

&#x20;    \-   Trong đó: giá trị callomiId là chuỗi string call id của cuộc gọi.\
&#x20;    \- *Khai báo cấu hình deeplink của OMI cho ios: Trong file Info.plit của ios KH cần khai báo thêm key sau:*

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2Fi6af9CuwsoEePY8OKQB2%2Fimage.png?alt=media&amp;token=2de0e906-8d9a-4ce3-af8f-e878a0dc35b8" alt=""><figcaption></figcaption></figure>

b. **Hướng dẫn cấu hình phân quyền nâng cao**

Trước tiên, khách hàng cần truy cập vào mục *Cấu hình* tại Web OMI (sso.omicrm.io) với tài khoản quản trị của mình.

\- Tiếp theo chọn mục *Doanh Nghiệp* -> *Phân Quyền*. Chọn bộ phân quyền cần cập nhật của khách hàng.

&#x20;\- *Bật/tắt tính năng ẩn/hiện số điện thoại khách hàng gọi đến/ra.* o Khách hàng chọn *Menu Tính Năng* -> *Khách hàng* -> Bảo mật dữ liệu

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FzmDNYwBTbeYdWMxVSzos%2FCleanShot%202024-08-27%20at%2011.24.27.png?alt=media&amp;token=be7b80f9-b145-4c24-bf81-382060d432ef" alt=""><figcaption></figcaption></figure>

*Cho phép xem Số điện thoại*: Tích chọn, cho phép nhân viên xem được số điện thoại trên ứng dụng

&#x20;*Cấu hình cho phép nhân viên thực hiện cuộc gọi*&#x20;

Khách hàng chọn mục *Nâng Cao*.

* *Nhập thủ công*: Tích chọn là cho phép nhân viên nhập số điện thoại gọi ra ở màn hình bàn phím.
* *Khách hàng*: Tích chọn là cho phép nhân viên thực hiện cuộc gọi ra *thuộc tab OMI và thiết bị* ở màn hình *Danh bạ* trên App OMICALL.
* *Nhân viên*: Tích chọn là cho phép nhân viên thực hiện cuộc gọi ở *tab Nhân viên* thuộc màn hình *Danh bạ* trên app OMICALL.
* *Lịch sử cuộc gọi*: Tích chọn là cho phép nhân viên thực hiện cuộc gọi ở màn hình *lịch sử cuộc gọi* trên app OMICALL.

![](https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FBqYtp16nemzIxyQilXyH%2FCleanShot%202024-08-27%20at%2011.24.44.png?alt=media\&token=a9afe610-9d52-40fd-a4dd-c45c7a4bae00)&#x20;

### &#x20; 3. Demo

* Link video demo tại:

<https://drive.google.com/file/d/17LJdpvcKz9rVHCAqADcbuWwkW1QKUHnj/view?usp=sharing>

\- Hình ảnh demo:

<figure><img src="https://3454047468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LukDt3aTxo8xMLonIwO%2Fuploads%2FkKnTNCat0KvVbA6WWuZe%2FCleanShot%202024-08-19%20at%2011.05.54.png?alt=media&amp;token=9da6a173-2231-4219-90a6-be1f1f451fb0" alt=""><figcaption></figcaption></figure>

\- Giao diện cuộc gọi trong ứng dụng OMICALL khi quý khách hàng đẩy số điện thoại sang và giao diện CallKit của hệ thống iOS khi thực hiện cuộc gọi


# Tổng quan

> ```
> URL : https://public-v1-stg.omicall.com
> Version : 2.3
> Last Updated : 20/04/2021
> ```

{% hint style="success" %}
**LIÊN HỆ OMICALL, ĐỂ ĐƯỢC CẤP SUPPER KEY CHO VIỆC TRUY CẬP API ĐỐI TÁC**
{% endhint %}

{% content-ref url="/pages/-MIH8VRNb0-nYpR2qzWc" %}
[Kho đầu số](/partner/public_number)
{% endcontent-ref %}

{% content-ref url="/pages/-MIH8V6sT66SR7oC47mU" %}
[Gói dịch vụ](/partner/service_package)
{% endcontent-ref %}

{% content-ref url="/pages/-MIHBRG-S-a9VD\_sxlEi" %}
[Lịch sử thanh toán](/partner/payment-history)
{% endcontent-ref %}

{% content-ref url="/pages/-MG7VIiXrUQ0i3kzMfKN" %}
[Quản lý doanh nghiệp](/partner/tenant)
{% endcontent-ref %}

{% content-ref url="/pages/-MIge8H\_ni4UapsOb7Cq" %}
[Thông tin đối tác](/partner/me)
{% endcontent-ref %}


# Kho đầu số

Danh sách kho đầu số

## Danh sách kho đầu số

<mark style="color:blue;">`GET`</mark> `[URL]/api/partner/public_number/list`

Danh sách kho đầu số

#### Query Parameters

| Name | Type    | Description                       |
| ---- | ------- | --------------------------------- |
| page | number  | Trang (Bắt đầu từ 1)              |
| size | boolean | Kích thước trang (Mặc định là 50) |

#### Headers

| Name          | Type   | Description                           |
| ------------- | ------ | ------------------------------------- |
| Authorization | string | Access token : Bearer 'partner token' |

{% tabs %}
{% tab title="200 Danh sách đầu số" %}

```
{
    "status_code": 9999,
    "payload": {
        "next_page": 2,
        "page_number": 1,
        "has_previous": false,
        "has_next": true,
        "total_pages": 3,
        "previous_page": 1,
        "items": [
            {
                "created_date": 1583725991806, // Ngày tạo
                "last_updated_date": 1601005495717, // Cập nhật lần cuối
                "number": "842477778823", // Số hotline
                "provider": "Itelecom", // Nhà mạng
                "provider_type": "itel", // Tên ngắn
                "number_type": "fixed", // Loại đầu số (Cố định, di động, 1900, 1800, ... )
                "nation": "vn" // Quốc gia,
                "maintaining_prices": [ // Phí duy trì đầu số
                    {
                        "currency": "VND",
                        "price": 22000
                    },
                    {
                        "currency": "USD",
                        "price": 0.977
                    }
                ],
                call_pricing { // Giá thoại
                }
            },
            {
                "created_date": 1583725991806,
                "last_updated_date": 1601092490032,
                "number": "842477778814",
                "provider": "Itelecom",
                "provider_type": "itel",
                "number_type": "fixed",
                "nation": "vn"
            },
            ......
        ],
        "total_items": 140,
        "page_size": 50
    },
    "key_enabled": false
}
```

{% endtab %}
{% endtabs %}

## Mua đầu số&#x20;

<mark style="color:green;">`POST`</mark> `[URL/api/partner/public_number/buy`

Mua số hotline

#### Path Parameters

| Name          | Type   | Description                           |
| ------------- | ------ | ------------------------------------- |
| Authorization | string | Access token : Bearer 'partner token' |

#### Request Body

| Name          | Type   | Description                          |
| ------------- | ------ | ------------------------------------ |
| number\_count | number | Số tháng sử dụng (Tối thiểu 6 tháng) |
| note          | string | Mô tả                                |
| number        | string | Số hotline                           |
| email         | string | Email chủ doanh nghiệp               |

{% tabs %}
{% tab title="200 Mua đầu số thành công" %}

```
```

{% endtab %}
{% endtabs %}


# Gói dịch vụ

Danh sách gói dịch vụ

## Gói dịch vụ v1

### Danh sách gói dịch vụ

<mark style="color:blue;">`GET`</mark> `[URL]/api/partner/service_package/list`

Danh sách gói dịch vụ

#### Headers

| Name          | Type   | Description                          |
| ------------- | ------ | ------------------------------------ |
| Authorization | string | Access token: Bearer 'partner token' |

{% tabs %}
{% tab title="200 Danh sách gói dịch vụ" %}

```
{
    "status_code": 9999,
    "instance_id": "stg",
    "payload": [
        {
            "code_name": "trial", // Mã
            "service_name": "Trial", // Tên
            "staff_num": 5, // Số lượng nhân viên
            "customer_num": 100, // Số lượng khách hàng
            "note": "5 người dùng \n100 khách hàng \n500MB dữ liệu" // Mô tả
            "fee_setups" [ // Phí cài đặt VND
                
            ],
            "fee_holds" : [ // Phí duy trì VND
                
            ]
        },
        {
            "code_name": "omi_start",
            "service_name": "Omi Start",
            "staff_num": 5, // Số lượng nhân viên
            "customer_num": 0, // Không giới hạn
            "note": "5 người dùng \nKhông giới hạn khách hàng \n10GB dữ liệu"
            "fee_setups" [ // Phí cài đặt VND
                {
                    "currency": "VND",
                    "price": 300000
                }
                ....
            ],
            "fee_holds" : [ // Phí duy trì VND
                {
                    "currency": "VND",
                    "price": 350000
                },
                ....
            ]
        },
        {
            "code_name": "omi_business",
            "service_name": "Omi Business",
            "staff_num": 10,
            "customer_num": 0,
            "note": "5 người dùng \nKhông giới hạn khách hàng \n50GB dữ liệu"
        },
        {
            "code_name": "omi_advance",
            "service_name": "Omi Advance",
            "staff_num": 20,
            "customer_num": 0,
            "note": "20 người dùng \nKhông giới hạn khách hàng \n100GB dữ liệu"
        },
        {
            "code_name": "omi_pro",
            "service_name": "Omi Pro",
            "staff_num": 30,
            "customer_num": 0,
            "note": "30 người dùng \nKhông giới hạn khách hàng \n100GB dữ liệu"
        },
        {
            "code_name": "customize",
            "service_name": "Omi Enterprise",
            "staff_num": 35,
            "customer_num": 0,
            "note": "50 người dùng \nKhông giới hạn khách hàng \n1000GB dữ liệu"
        }
    ],
    "key_enabled": false
}
```

{% endtab %}
{% endtabs %}

### Nâng cấp gói dịch vụ

<mark style="color:green;">`POST`</mark> `[URL]/api/partner/service_package/upgrade`

Nâng cấp gói dịch vụ\
**Số tiền nâng cấp** = **Phí thiết lập** + **Phí duy trì \* số tháng**

#### Path Parameters

| Name          | Type   | Description                           |
| ------------- | ------ | ------------------------------------- |
| Authorization | string | Access Token : Bearer 'partner token' |

#### Request Body

<table><thead><tr><th>Name</th><th width="249">Type</th><th>Description</th></tr></thead><tbody><tr><td>email</td><td>string</td><td>Email chủ doanh nghiệp</td></tr><tr><td>code_name</td><td>string</td><td>Mã gói dịch vụ</td></tr><tr><td>month_num</td><td>number</td><td>Số tháng (Ít nhất là 6 tháng)</td></tr><tr><td>note</td><td>string</td><td>Ghi chú (Lớn hơn 10 ký tự)</td></tr></tbody></table>

{% tabs %}
{% tab title="200 Nâng cấp gói dịch vụ thành công" %}

```
```

{% endtab %}
{% endtabs %}

### Gia hạn gói dịch vụ

<mark style="color:green;">`POST`</mark> `[URL]/api/partner/service_package/extend`

Gia hạn gói dịch vụ\
**Số tiền gia hạn = Phí duy trì \* Số tháng**

#### Headers

| Name          | Type   | Description                            |
| ------------- | ------ | -------------------------------------- |
| Authorization | string | Access Token : Bearer 'partner token'. |

#### Request Body

| Name       | Type    | Description                          |
| ---------- | ------- | ------------------------------------ |
| month\_num | integer | Số tháng gia hạn (Tối thiểu 6 tháng) |
| note       | string  | Ghi chú (Tối thiểu 10 ký tự)         |
| email      | string  | Email chủ doanh nghiệp               |

{% tabs %}
{% tab title="200 Gia hạn gói dịch vụ" %}

```
```

{% endtab %}
{% endtabs %}

## Gói dịch vụ v2

### Danh sách gói dịch vụ của đại lý

<mark style="color:blue;">`GET`</mark> `[URL]/api/partner/service_package_v2/template/list`

Danh sách gói dịch vụ đang bán của đại lý

#### Path Parameters

<table><thead><tr><th width="191">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>Authorization</td><td>string</td><td>Access token: Bearer '<strong>partner</strong> token'</td></tr></tbody></table>

#### Response

{% tabs %}
{% tab title="200 Danh sách gói dịch vụ" %}

```
//Thông tin gói dịch vụ của đại lý
```

{% endtab %}
{% endtabs %}

### Nâng cấp gói dịch vụ (gói nhân viên)

<mark style="color:green;">`POST`</mark> `[URL]/api/partner/service_package_v2/user/buy_many`

Nâng cấp gói dịch vụ

#### Path Parameters

| Name          | Type   | Description                              |
| ------------- | ------ | ---------------------------------------- |
| Authorization | string | Access Token : Bearer '**tenant** token' |

#### Request Body

| Name        | Type   | Description                        |
| ----------- | ------ | ---------------------------------- |
| code        | string | service\_code                      |
| total       | number | Tổng số gói mua                    |
| unit        | string | Đơn vị thời hạn: "month"           |
| value       | number | Số tháng gia hạn (Tối đa 60 tháng) |
| description | string | Ghi chú (Tối thiểu 50 ký tự)       |

{% tabs %}
{% tab title="Body" %}

```postman_json
{
    "packages": [
        {
            "code": "abc",
            "total": "1",
            "duration": {
                "unit": "month",
                "value": "1"
            }
        }
    ],
    "description": "mua 1 goi 1 thang cho 1 nhan vien, co day du tinh nang"
}
```

{% endtab %}
{% endtabs %}

#### Response

{% tabs %}
{% tab title="200 Nâng cấp gói dịch vụ thành công" %}

```
// Thông tin gói đã mua
```

{% endtab %}
{% endtabs %}

### Gia hạn gói dịch vụ (gói nhân viên)

<mark style="color:green;">`POST`</mark> `[URL]/api/partner/service_package_v2/user/extend`

Gia hạn gói dịch vụ

#### Path Parameters

| Name          | Type   | Description                              |
| ------------- | ------ | ---------------------------------------- |
| Authorization | string | Access Token : Bearer '**tenant** token' |

#### Request Body

<table><thead><tr><th width="248">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>note</td><td>string</td><td>Ghi chú</td></tr><tr><td>usp_id</td><td>string</td><td>Id gói nhân viên</td></tr><tr><td>unit</td><td>string</td><td>Đơn vị thời hạn: "month"</td></tr><tr><td>value</td><td>number</td><td>Số tháng gia hạn (Tối đa 60 tháng)</td></tr></tbody></table>

{% tabs %}
{% tab title="Body" %}

<pre class="language-postman_json"><code class="lang-postman_json"><strong>{
</strong>    
    "note": "note ",
    "usp_id": "6640d2389f78763bd5dfdgdg",
    "duration": {
        "unit": "month",
        "value": "1"
    }
}
</code></pre>

{% endtab %}
{% endtabs %}

#### Response

{% tabs %}
{% tab title="200 Nâng cấp gói dịch vụ thành công" %}

```
// Thông tin gói đã gia hạn
```

{% endtab %}
{% endtabs %}

### Danh sách gói dịch vụ đã mua (gói nhân viên)

<mark style="color:blue;">`POST`</mark> `[URL]/api/partner/service_package_v2/user/list`

Danh sách gói nhân viên mà doanh nghiệp đã mua

#### Path Parameters

| Name          | Type   | Description                              |
| ------------- | ------ | ---------------------------------------- |
| Authorization | string | Access Token : Bearer '**tenant** token' |

#### Request Body

<table><thead><tr><th width="248">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>assigned_employee</td><td>Array&#x3C;string></td><td>"assigned"/ "unassigned" / null</td></tr></tbody></table>

#### Response

{% tabs %}
{% tab title="200 Nâng cấp gói dịch vụ thành công" %}

```
// Thông tin tất cả gói nhân viên đã mua
```

{% endtab %}
{% endtabs %}

### Gỡ nhân viên liên kết gói

<mark style="color:blue;">`POST`</mark> `[URL]/api/partner/service_package_v2/user/remove_agent?lng=vi`

Gỡ nhân viên liên kết ra khỏi gói nhân viên

#### Query Parameters

<table><thead><tr><th width="248">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>lng</td><td>string</td><td>vi</td></tr></tbody></table>

#### Path Parameters

| Name          | Type   | Description                              |
| ------------- | ------ | ---------------------------------------- |
| Authorization | string | Access Token : Bearer '**tenant** token' |

#### Request Body

<table><thead><tr><th width="277">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>is_all</td><td>Boolean</td><td>"false": chỉ gỡ những gói được truyền vào list include_ids<br>"true": gỡ toàn bộ gói</td></tr><tr><td>include_ids</td><td>Array</td><td>ID gói (_id)<br>is_all: "true" không cần truyền Parameters</td></tr></tbody></table>

#### Response

{% tabs %}
{% tab title="200 Gỡ gói nhân viên thành công" %}

```
{
    "instance_id": "stg",
    "payload": true,
    "instance_version": "1.2.164",
    "key_enabled": false,
    "status_code": 9999
}
```

{% endtab %}
{% endtabs %}

### Xoá gói nhân viên

<mark style="color:blue;">`POST`</mark> `[URL]/api/partner/service_package_v2/user/delete?id=&lng=vi`

#### Query Parameters

<table><thead><tr><th width="248">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>id</td><td>string</td><td>ID gói (_id)</td></tr><tr><td>lng</td><td>string</td><td>vi</td></tr></tbody></table>

#### Path Parameters

| Name          | Type   | Description                              |
| ------------- | ------ | ---------------------------------------- |
| Authorization | string | Access Token : Bearer '**tenant** token' |

#### Response

{% tabs %}
{% tab title="200 Xoá gói nhân viên thành công" %}

```
{
    "instance_id": "stg",
    "payload": true,
    "instance_version": "1.2.164",
    "key_enabled": false,
    "status_code": 9999
}
```

{% endtab %}
{% endtabs %}


# Lịch sử thanh toán

Lịch sử thanh toán


# Quản lý doanh nghiệp

Quản lý doanh nghiệp thuộc đối tác hoặc đại lý

## Tạo doanh nghiệp

<mark style="color:green;">`POST`</mark> `[URL]/api/partner/tenant/add`

Tạo doanh nghiệp đối tác\
Sau khi tạo doanh nghiệp xong, sẽ mất khoảng **3 - 10s** để kích hoạt xong doanh nghiệp và khởi tạo dữ liệu ban đầu

#### Headers

| Name          | Type   | Description                          |
| ------------- | ------ | ------------------------------------ |
| Authorization | string | Bearer Access Token : Bearer 'token' |

#### Request Body

| Name         | Type    | Description                                                      |
| ------------ | ------- | ---------------------------------------------------------------- |
| email        | string  | Email chủ doanh nghiệp                                           |
| password     | string  | Mật khẩu. Bao gồm 8 ký tự (In hoa, thường, số và ký tự đặc biệt) |
| fullName     | string  | Tên doanh nghiệp (Nhỏ hơn 255 ký tự)                             |
| ownerName    | string  | Tên chủ doanh nghiệp (Nhỏ hơn 255 ký tự)                         |
| phone        | string  | Số điện thoại chủ doanh nghiệp                                   |
| isAutoActive | boolean | Tự động kích hoạt tài khoản hoặc không                           |

{% tabs %}
{% tab title="200 Tạo doanh nghiệp thành công" %}

```
{
    "status_code": 9999,
    "instance_id": "stg",
    "instance_name": "DESKTOP-1OB3SFM",
    "payload": {
        "id": "5f59784273227343222243" // ID doanh nghiệp
    },
    "key_enabled": false
}
```

{% endtab %}
{% endtabs %}

**Mã lỗi khi tạo doanh nghiệp**

| Mã lỗi                      | Mô tả                                                                                     |
| --------------------------- | ----------------------------------------------------------------------------------------- |
| partner\_invalid            | Access token không phải của đối tác                                                       |
| tenant\_invalid             | Access token không phải của đối tác                                                       |
| body\_request\_is\_required | Thiếu request body                                                                        |
| request\_invalid            | Các dữ liệu bắt buộc không được nhập hoặc nhập không hợp lệ                               |
| email\_invalid              | Email không hợp lệ                                                                        |
| password\_invalid           | <p>Mật khẩu không hợp lệ</p><p>Mật khẩu bao gồm (In hoa, thường, số , ký tự đặc biệt)</p> |
| email\_registered           | Email này đã được đăng ký với 1 chủ doanh nghiệp trước đó                                 |
| create\_tenant\_error       | Tạo doanh nghiệp bị lỗi                                                                   |

## Danh sách doanh nghiệp

<mark style="color:green;">`POST`</mark> `[URL]/api/partner/tenant/list`

Danh sách doanh nghiệp thuộc đối tác

#### Query Parameters

| Name | Type    | Description                  |
| ---- | ------- | ---------------------------- |
| size | number  | Kích thước trang             |
| page | integer | Trang tìm kiếm, bắt đầu từ 1 |

#### Headers

| Name          | Type   | Description                   |
| ------------- | ------ | ----------------------------- |
| Authorization | string | Access token : Bearer 'token' |

#### Request Body

| Name    | Type   | Description                                              |
| ------- | ------ | -------------------------------------------------------- |
| keyword | string | <p>Từ khóa tìm kiếm<br>- Tên doanh nghiệp<br>- Email</p> |

{% tabs %}
{% tab title="200 " %}

```
```

{% endtab %}
{% endtabs %}

## Chi tiết doanh nghiệp thuộc đối tác

<mark style="color:blue;">`GET`</mark> `[URL]/api/partner/tenant/info?id=`

Thông tin chi tiết doanh nghiệp thuộc đối tác

#### Query Parameters

| Name | Type   | Description                          |
| ---- | ------ | ------------------------------------ |
| id   | string | id của doanh nghiệp (**tenant\_id**) |

#### Headers

| Name          | Type   | Description                   |
| ------------- | ------ | ----------------------------- |
| Authorization | string | Access token : Bearer 'token' |

{% tabs %}
{% tab title="200 " %}

```
{
    "status_code": 9999,
    "instance_id": "stg",
    "instance_name": "DESKTOP-1OB3SFM",
    "payload": {
        "full_name": "Omi Team",
        "email": "support@omicrm.com",
        "description": "Nâng cao trải nghiệm khách hàng, lấy sự hài lòng của khách hàng làm tiêu chí phấn đấu của doanh nghiệp",
        "enabled": true, //Đang hoạt động hoặc ngưng hoạt động
        "domain": "omiteam", // Tên miền truy cập OMI
        "domain_fusion": "omiteam", // Tên miền tổng đài
        "domain_expire": 1584606068154, // Ngày hết hạn domain
        "effective_date": 1583396482840, // Ngày kích hoạt
        "expire_date": 1614936981790, // Ngày hết hạn
        "phone": "0844441900", // SĐT chủ doanh nghiệp
        "status": "activated", // Trạng thái: Đã kích hoạt / Chưa kích hoạt
        "paid_type": "prepaid", // Hình thức thanh toán : prepaid : Trả trước, postpaid : Trả sau
        "nation": "vn", // Quốc gia
        "currency": "VND", // Tiền tệ
        "language": "vi", // Ngôn ngữ
        "balance": 3007855, // Số dư tài khoản
        "api_key": "K343KDK9-2I34K3K-3I33K3-2222" // Api key của doanh nghiệp
        "public_numbers": [
            {
                "number": "842877788056", // Số hotline
                "provider": "itel", // Nhà mạng
                "expire_date": 1602731734809, //Ngày hết hạn số
                "status": "active" // Tình trạng số
            }
        ],
        "service_package": {
            "code_name": "trial", // Mã gói
            "service_name": "Trial", // Tên gói
            "staff_num": 5, // Số lượng nhân viên
            "customer_num": 100, // Số lượng khách hàng
            "expiry_date": 1606300035002, // Ngày gói hết hạn
            "cashback" : 2092202 // Số tiền hoàn lại nếu khách hàng lên gói cao hơn
        }
    },
    "key_enabled": false
}
```

{% endtab %}
{% endtabs %}

## Nạp tiền

<mark style="color:green;">`POST`</mark> `[URL]/api/partner/tenant/update_balance`

Nạp tiền cho doanh nghiệp thông qua email

#### Headers

| Name          | Type   | Description                           |
| ------------- | ------ | ------------------------------------- |
| Authorization | string | Access token : Bearer 'partner token' |

#### Request Body

| Name        | Type   | Description                                                        |
| ----------- | ------ | ------------------------------------------------------------------ |
| email       | string | Email chủ doanh nghiệp                                             |
| amount      | number | Số tiền (lớn hơn 10,000 VNĐ)                                       |
| description | string | Nội dung  nạp tiền (lớn hơn 50 ký tự)                              |
| wallet      | string | <p>Loại ví: <br>- "SPK": ví dịch vụ<br>- "NORMAL"; "": ví cước</p> |

{% tabs %}
{% tab title="200 Nạp tiền thành công" %}

```
```

{% endtab %}
{% endtabs %}

#### THÔNG BÁO LỖI KHI NẠP TIỀN

| Mã                                             | Mô tả                        |
| ---------------------------------------------- | ---------------------------- |
| access\_denied                                 | Nạp tiền bị từ chối          |
| amount\_gte\_10.000\_vnd                       | Số tiền tối thiểu 10,000 VNĐ |
| description\_is\_required                      | Mô tả là bắt buộc            |
| description\_is\_to\_short.gte\_50\_characters | Mô tả phải lớn 50 ký tự      |


# Thông tin đối tác

Thông tin đối tác

## Thông tin đối tác

<mark style="color:blue;">`GET`</mark> `[URL]/api/partner/me`

Thông tin đối tác

#### Headers

| Name          | Type   | Description                          |
| ------------- | ------ | ------------------------------------ |
| Authorization | string | Acces token : Bearer 'partner token' |

{% tabs %}
{% tab title="200 Thông tin đối tác" %}

```
{
    "status_code": 9999,
    "instance_id": "stg",
    "instance_name": "DESKTOP-1OB3SFM",
    "payload": {
        "full_name": "Đối tác OMI",
        "email": "support@omicrm.com",
        "description": "Nâng cao trải nghiệm khách hàng, lấy sự hài lòng của khách hàng làm tiêu chí phấn đấu của doanh nghiệp",
        "enabled": true, //Đang hoạt động hoặc ngưng hoạt động
        "status": "activated", // Trạng thái: Đã kích hoạt / Chưa kích hoạt
        "paid_type": "prepaid", // Hình thức thanh toán : prepaid : Trả trước, postpaid : Trả sau
        "nation": "vn", // Quốc gia
        "currency": "VND", // Tiền tệ
        "language": "vi", // Ngôn ngữ
        "balance": 3007855, // Số dư tài khoản
    },
    "key_enabled": false
}
```

{% endtab %}
{% endtabs %}

## Thông tin đại lý

<mark style="color:blue;">`GET`</mark> `[URL]/api/partner/agency_tenant/info`

#### Path Parameters

<table><thead><tr><th width="191">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>Authorization</td><td>string</td><td>Access token: Bearer '<strong>partner</strong> token'</td></tr></tbody></table>

{% tabs %}
{% tab title="200 Thông tin đại lý" %}

```json
{
    "status_code": 9999,
    "instance_id": "stg",
    "payload": {
        "full_name": "Đối tác OMI",
        "email": "support@omicrm.com",
        "paid_type": "prepaid", // Hình thức thanh toán : prepaid : Trả trước, postpaid : Trả sau
        "nation": "vn", // Quốc gia
        "currency": "VND", // Tiền tệ
        "balance": 3007855, // Số dư ví cước
        "spk_balance": 3007855, // Số dư ví dịch vụ
    },
    "key_enabled": false
}
```

{% endtab %}
{% endtabs %}


