13.18
การดึงบันทึกสนทนา
/<guild_id>/api/transcripts/<ticket_id>ดึงบันทึกสนทนาทั้งหมดของทิกเก็ตที่ปิดแล้วด้วยหมายเลขทิกเก็ต ได้แก่ ข้อมูลกำกับครบถ้วน (คนที่เปิด แผง คะแนน เหตุผลที่ปิด คนที่รับดูแล และเวลาต่างๆ) ข้อความทุกข้อความเรียงตามเวลา และสถิติข้อความรายผู้ร่วมสนทนา ให้หาทิกเก็ตก่อนด้วย **การค้นในบันทึกสนทนา** หรือดึงคลังที่จัดหน้าไว้แล้วด้วย **การดึงบันทึกสนทนาเป็น HTML** ต้องมีสิทธิ์ `view_transcripts` (ปิดไว้เป็นค่าเริ่มต้น)
พารามิเตอร์การค้น
| ชื่อ | ชนิด | จำเป็น | คำอธิบาย |
|---|---|---|---|
| limit | number | ไม่บังคับ | จำนวนข้อความต่อหน้า 1-1000 (ค่าเริ่มต้น 500) |
| offset | number | ไม่บังคับ | จำนวนข้อความที่ข้ามไปเพื่อแบ่งหน้า (ค่าเริ่มต้น 0) |
เนื้อหาของ messages และ participants มาจากดัชนีบันทึกสนทนา ซึ่งถูกสร้างขึ้นระหว่างที่เซิร์ฟเวอร์มี Premium และจะไล่เก็บคลังเดิมของคุณเข้าดัชนีด้วยเมื่ออัปเกรดครั้งแรก ทิกเก็ตที่ปิดไปก่อนอัปเกรด (หรือขณะการไล่เก็บยังทำงานอยู่) จะคืนค่า indexed: false พร้อมอาเรย์ messages ว่างเปล่า สำหรับทิกเก็ตเหล่านั้นให้ใช้ การดึงบันทึกสนทนาเป็น HTML หรือค่า transcript.TranscriptUrl ส่วนทิกเก็ตที่ยาวให้ไล่ดูทีละหน้าด้วยอ็อบเจ็กต์ pagination
curl -X GET \
-H "Authorization: Bearer <API_TOKEN>" \
"https://api.ticketsx.xyz/<guild_id>/api/transcripts/<ticket_id>?limit=500"{
"transcript": {
"TicketId": 42,
"PanelId": 1,
"PanelName": "Support",
"AuthorId": "123456789",
"AuthorUsername": "jane",
"Rating": 5,
"RatingCount": 1,
"CloseReason": "Resolved",
"CreatedAt": 1732200000,
"ClosedAt": 1732210000,
"ClosedBy": "987654321",
"ClaimedIds": ["987654321"],
"TranscriptUrl": "https://tickets.example.com/<guild_id>/transcripts/42"
},
"indexed": true,
"messages": [
{ "MessageId": "111", "AuthorId": "123456789", "AuthorUsername": "jane", "IsBot": false, "Content": "My login is broken", "CreatedAt": 1732200050 },
{ "MessageId": "112", "AuthorId": "987654321", "AuthorUsername": "staff", "IsBot": false, "Content": "Looking into it now!", "CreatedAt": 1732200110 }
],
"participants": [
{ "UserId": "123456789", "Username": "jane", "IsBot": false, "MessageCount": 12, "FirstMessageAt": 1732200050, "LastMessageAt": 1732209900 }
],
"pagination": { "total": 2, "limit": 500, "offset": 0, "returned": 2 }
}