# 4. API get ticket

1\. List of tickets or details of a ticket via id on Ant CRM

URL: <https://apiring.antbuddy.com/tickets>

Method: GET

Content-Type: application/json

| **Parameters**  | **Type** | **Required** | **Explain**                                                                                                                         |
| --------------- | -------- | ------------ | ----------------------------------------------------------------------------------------------------------------------------------- |
| TicketId        | string   |              | Id of ticket                                                                                                                        |
| page            | number   |              | Page number, maximum 20 Orders per page                                                                                             |
| limit           | number   |              | Number of records per page                                                                                                          |
| typeTime        | string   |              | If the parameter `typeTime` is passed as `updatedAt`, then the updated date will be used; otherwise, the created date will be used. |
| startDate       | string   |              | For example:2024-03-13T06:24:20.673Z                                                                                                |
| endDate         | string   |              | For example:2024-03-19T06:24:20.673Z                                                                                                |
| isTicketDeleted | Boolean  |              | If `isTicketDeleted` is true, retrieve all tickets, including deleted tickets.                                                      |

Results returned: HTTP Response Code: 200

Response:

\[{

SLA: "",

TicketId: 17464,

assignedTo: "<thong.nguyen@antbuddy.com>",

group: “”,

category: “”,

resolutionTypeOb: “”,

contact: {},

cusFields: \[]

deal: {},

files: \[]

priority: "Medium"

status: "Assigned"

summary: "\<p>test\</p>"

title: "\[Phone] Thông test",

createdAt: “”, // Thời gian tạo ticket

updatedAt: “” // Thời gian cập nhật ticket

}]

2. Add tickets

URL: <https://apiring.antbuddy.com/tickets>

Method: POST

Content-Type: application/json

| **Parameters**   | **Type** | **Required** | **Explain**                                                                                                                                                                                                                                                        |
| ---------------- | -------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| title            | string   | AND          | Ticket name                                                                                                                                                                                                                                                        |
| ticketIdApiRing  | string   |              | Ticket code                                                                                                                                                                                                                                                        |
| summary          | string   |              | Summary/Summary                                                                                                                                                                                                                                                    |
| priority         | string   |              | Priority. Default: Medium                                                                                                                                                                                                                                          |
| SLA              | string   | AND          | Sla                                                                                                                                                                                                                                                                |
| contact          | object Y | Y            | <p>{</p><p>“id”: “661ca720f70843211b05712a” //</p><p>Customer id code If yes, it is not required.</p><p>“emails”: \[{type: “Work”, value:</p><p>“<xyz@example.com>”}], “name”: “thong”, // required</p><p>“phones”: \[{type: “Work”, value: “023232”}]</p><p>}</p> |
| deal             | object   |              |                                                                                                                                                                                                                                                                    |
| group            | string   |              |                                                                                                                                                                                                                                                                    |
| category         | string   |              |                                                                                                                                                                                                                                                                    |
| status           | string   |              |                                                                                                                                                                                                                                                                    |
| resolutionTypeOb | string   |              |                                                                                                                                                                                                                                                                    |
| files            | array    |              |                                                                                                                                                                                                                                                                    |
| cusFields        | array    |              | <p>AntCRM custom fields.</p><p>\[</p><p>{ name: "Shipping</p><p>unit",</p><p>value: “Fast delivery”</p><p>}</p><p>]</p>                                                                                                                                            |

Results returned:

HTTP Response Code: 200

Response:

{

"success": 1,

"TicketId”: 9457 (ticket id on antcrm) }

3. Edit tickets

URL: <https://apiring.antbuddy.com/tickets>

Method: PUT

Content-Type: application/json

| **Parameters**   | **Type** | **Required** | **Explain**                                                                                                             |
| ---------------- | -------- | ------------ | ----------------------------------------------------------------------------------------------------------------------- |
| TicketId         | string   | AND          |                                                                                                                         |
| title            | string   |              | Ticket name                                                                                                             |
| summary          | string   |              | Summary/Summary                                                                                                         |
| priority         | string   |              | Priority                                                                                                                |
| SLA              | string   |              |                                                                                                                         |
| deal             | object   |              |                                                                                                                         |
| category         | string   |              |                                                                                                                         |
| status           | string   |              |                                                                                                                         |
| resolutionTypeOb | string   |              |                                                                                                                         |
| filed            | array    |              |                                                                                                                         |
| cusFields        | array    |              | <p>AntCRM custom fields.</p><p>\[</p><p>{ name: "Shipping</p><p>unit",</p><p>value: “Fast delivery”</p><p>}</p><p>]</p> |

Results returned:

HTTP Response Code: 200

Response:

{

"success": 1,

"number”: 9457 (id of order on antcrm) }

4. Delete tickets

URL: <https://apiring.antbuddy.com/tickets>

Method: DELETE

Content-Type: application/json

| **Parameters** | **Type** | **Required** | **Explain**         |
| -------------- | -------- | ------------ | ------------------- |
| TicketId       | string   | AND          | ticket id on antcrm |

Results returned: HTTP Response Code: 200

Response:

{

"success": 1

}

### **1. Thông tin chung của Ticket**

| Field                                   | Mô tả                                |
| --------------------------------------- | ------------------------------------ |
| id                                      | ID nội bộ của ticket                 |
| ticketId                                | Mã ticket hiển thị (dễ đọc cho user) |
| title                                   | Tiêu đề ticket                       |
| summary                                 | Nội dung chi tiết (HTML)             |
| status                                  | Trạng thái (vd: Closed)              |
| priority                                | Độ ưu tiên (Low / Medium / High)     |
| tags                                    | Danh sách tag gắn vào ticket         |
| category / subCategory / subSubCategory | Danh mục ticket                      |
| group                                   | Nhóm xử lý (vd: CS & QA)             |
| assignedTo                              | Người đang được giao xử lý           |
| createdBy                               | Người tạo ticket                     |
| closedBy                                | Người đóng ticket                    |
| cusFields                               | Danh sách trường tùy chỉnh           |

### **2. Thời gian & SLA**

| Field                     | Mô tả                            |
| ------------------------- | -------------------------------- |
| createdAt / createdAtDate | Thời điểm tạo ticket (timestamp) |
| updatedAt                 | Thời điểm cập nhật gần nhất      |
| assignedAt                | Thời điểm assign                 |
| resolvedAt                | Thời điểm xử lý xong             |
| closedAt / closedAtDate   | Thời điểm đóng ticket            |
| lastDateCare              | Lần chăm sóc cuối                |
| idleTimeAt                | Thời điểm bắt đầu idle           |

#### **SLA**

| Field               | Mô tả                           |
| ------------------- | ------------------------------- |
| SLA                 | ID cấu hình SLA                 |
| SLAAt               | Deadline SLA                    |
| SLAIn               | Thời gian SLA                   |
| SLAStatus           | Trạng thái SLA (Success / Fail) |
| SLAResolutionActual | Thời gian thực tế resolve       |
| firstResponseActual | Thời gian phản hồi đầu tiên     |

### **3. Trạng thái & Xử lý**

| Field                     | Mô tả                   |
| ------------------------- | ----------------------- |
| isOpen                    | Ticket còn mở hay không |
| isClose                   | Ticket đã đóng          |
| isWait                    | Đang chờ xử lý          |
| isAutomation              | Ticket tạo tự động      |
| reraisedTimes             | Số lần reopen           |
| holdingTime               | Thời gian giữ ticket    |
| deferredIn / deferredDate | Thông tin hoãn xử lý    |

### **4. Thông tin khách hàng (Contact)**

| Field            | Mô tả                       |
| ---------------- | --------------------------- |
| contact          | Object thông tin khách hàng |
| name             | Tên công ty / khách hàng    |
| customerId       | ID khách hàng               |
| contactType      | Loại (customer, lead…)      |
| phones / emails  | Danh sách liên hệ           |
| addresses        | Địa chỉ                     |
| responsibleStaff | Nhân viên phụ trách         |
| createdBy        | Người tạo contact           |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.antbuddy.com/huong-dan-tich-hop-api-team-technical-api-integration-guide-technical-team/antcrm/4.-api-get-ticket.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
