Ticket

Quản lý ticket

Lấy danh sách ticket

POST /api/v2/ticket/search

Query Parameters

Name
Type
Description

page*

Integer

Chỉ số trang, bắt đầu bằng 1

size*

Integer

Kích thước trang, mặc định là 50

Request Body

Name
Type
Description

keyword

String

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

ranges

Array

Bộ lọc tìm kiếm theo khoảng tham chiếu. Mẫu như sau:

[{ "field" : "last_updated_date", "from" : 1722445201000, "to" : 1724016602000 } ]

sort

Object

Giá trị sort. {"field" : "last_updated_date" , "isAsc" : true}

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

Tạo ticket

POST /api/ticket/create

Request Body

Name
Type
Description

name*

String

Tên ticket

description*

String

Mô tả ticket

priority*

String

Độ ưu tiên (mặc định là medium)

assignee*

String

Email nhân viên được gán

created_by

String

Email nhân viên tạo ticket, nếu rỗng thì là Admin

ticket_category_id

String

Id chủ đề (API danh sách chủ đề)

type_uuid

String

UUID của phân loại, (Trong API danh sách chủ đề )

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

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

POST /api/ticket/update_status/:id_status

Path Parameters

Name
Type
Description

id_status

String

Id

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

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

GET /api/ticket/category/get_all

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

Tương tác ticket

POST /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

Name
Type
Description

ticket_id

string

Id của ticket

range_filter

object

Bộ lọc

"range_filter": { "from_date": 1759856400000, "to_date": 1759942799999 }

keyword

String

Từ khoá tìm kiếm

Response

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

Tạo ghi chú

POST /api/ticket/log/create

Tạo ghi chú cho ticket

Headers

Name
Value

Content-Type

application/json

Authorization

Bearer <token>

Body

Name
Type
Description

ticket_id

string

Id của ticket

message

string

Nội dung tin nhắn

Response

{
    "keyEnabled": false,
    "payload": {
        "_id": "68e82cd354672f6932d4821b",
        "tenant_id": "6209c98461c1cb163ded25f7",
        "created_by": {
            "id": "6209c98561c1cb163ded25fa",
            "name": "Trần Văn Tiến",
            "type": "USER",
            "email": "[email protected]",
            "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
}

Báo cáo tổng quan ticket

POST /api/ticket/statistics

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

Headers

Name
Value

Content-Type

application/json

Authorization

Bearer <token>

Body

Name
Type
Description

from_date

number

Từ ngày

to_date

number

Đến ngày

assignee_contact_ids

List

Id nhân viên

Response

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

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

GET /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

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

Đánh giá phiếu ghi

POST /api/ticket/evaluation/create

Đánh giá phiếu ghi

Headers

Name
Value

Content-Type

application/json

Authorization

Bearer <token>

Body

Name
Type
Description

ticket_id

String

Id ticket

values

Array Object

Mảng tiêu chí đánh giá + thang điểm

"values": [ { "criteria_id": "67170d615aeef678f673c715", "name": "Chất lượng phiếu ghi", "point": 4 // 1-5 } ]

comment

String

Ghi chú

Response

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

Last updated

Was this helpful?