ดูรายละเอียดข้อความในการสนทนา
ดูรายละเอียดข้อความในการสนทนา
ดึงรายละเอียดข้อความทั้งหมดภายในบทสนทนาโดยใช้ conversation_id ผลลัพธ์จะมีทั้ง message_id, คำถามของผู้ใช้, ประเภทข้อความ, เนื้อหาข้อความ, เวลาส่งข้อความ และข้อมูลอื่น ๆ
วิธีการร้องขอ
GET
Endpoint
https://api-${endpoint}.gptbots.ai/v2/messages
การยืนยันตัวตน
โปรดดูวิธีการยืนยันตัวตนที่ API Overview
การร้องขอ
ตัวอย่างการร้องขอ
curl -X GET 'https://api-${endpoint}.gptbots.ai/v2/messages?conversation_id=xxxxxx&page=1&page_size=100' \
-H 'Authorization: Bearer ${API Key}'
curl -X GET 'https://api-${endpoint}.gptbots.ai/v2/messages?conversation_id=xxxxxx&page=1&page_size=100' \
-H 'Authorization: Bearer ${API Key}'
บล็อกโค้ดนี้ในหน้าต่างลอย
Request Headers
| ฟิลด์ | ประเภท | คำอธิบาย |
|---|---|---|
| Authorization | Bearer ${API Key} | ใช้ Authorization: Bearer ${API Key} สำหรับยืนยันตัวตน รับ API Key ได้จากหน้า API Key |
พารามิเตอร์การร้องขอ
| ฟิลด์ | ประเภท | จำเป็นต้องกรอก | คำอธิบาย |
|---|---|---|---|
| conversation_id | string | ใช่ | รหัสระบุบทสนทนา |
| page | int | ใช่ | หมายเลขหน้าที่ต้องการร้องขอ |
| page_size | int | ใช่ | จำนวนรายการต่อหน้า สูงสุด 100 |
การตอบกลับ
ตัวอย่างการตอบกลับ
{
"total": 2,
"conversation_content": [
{
"message_id": "645dd86906931c4a9e0ffb1f",
"parent_message_id": "545dd86906931c4a9e0ffb1f",
"create_time": 1683871849906,
"feedback": "POSITIVE",
"role": "user",
"content": [
{
"branch_content": [
{
"type": "text",
"text": "ฉันได้อัปโหลดไฟล์รูปภาพ 2 ไฟล์ กรุณา OCR และส่งกลับเป็น json 2 รายการ"
},
{
"type": "image",
"image": [
{
"url": "https://gptbots.ai/example.png",
"format": "jpeg",
"name": "TAXI1",
"size": 1024
},
{
"url": "https://gptbots.ai/example.png",
"format": "png",
"name": "TAXI2",
"size": 1024
}
]
},
{
"type": "audio",
"audio": [
{
"url": "https://gptbots.ai/example.mp3",
"format": "mp3",
"name": "example1 audio",
"size": 1024
}
]
},
{
"type": "document",
"document": [
{
"url": "https://gptbots.ai/example.pdf",
"format": "pdf",
"name": "example pdf",
"size": 1024
}
]
}
]
}
]
},
{
"message_id": "745dd86906931c4a9e0ffb1f",
"parent_message_id": "645dd86906931c4a9e0ffb1f",
"create_time": 1683871849906,
"feedback": "POSITIVE",
"role": "assistant",
"content": [
{
"from_component_branch": "1",
"branch_content": [
{
"type": "text",
"text": "สวัสดี มีอะไรให้ช่วยเหลือไหม?"
},
{
"type": "audio",
"audio": [
{
"url": "http://gptbots.ai/example.mp3",
"transcript": "ข้อความที่ถอดเสียงจากไฟล์เสียง"
}
]
}
]
},
{
"from_component_branch": "2",
"branch_content": [
{
"type": "document",
"document": [
{
"url": "https://gptbots.ai/example.pdf",
"format": "pdf",
"name": "example pdf"
}
]
},
{
"type": "image",
"image": [
{
"url": "https://gptbots.ai/example.png",
"format": "png",
"name": "TAXI2"
}
]
}
]
}
]
}
]
}
{
"total": 2,
"conversation_content": [
{
"message_id": "645dd86906931c4a9e0ffb1f",
"parent_message_id": "545dd86906931c4a9e0ffb1f",
"create_time": 1683871849906,
"feedback": "POSITIVE",
"role": "user",
"content": [
{
"branch_content": [
{
"type": "text",
"text": "ฉันได้อัปโหลดไฟล์รูปภาพ 2 ไฟล์ กรุณา OCR และส่งกลับเป็น json 2 รายการ"
},
{
"type": "image",
"image": [
{
"url": "https://gptbots.ai/example.png",
"format": "jpeg",
"name": "TAXI1",
"size": 1024
},
{
"url": "https://gptbots.ai/example.png",
"format": "png",
"name": "TAXI2",
"size": 1024
}
]
},
{
"type": "audio",
"audio": [
{
"url": "https://gptbots.ai/example.mp3",
"format": "mp3",
"name": "example1 audio",
"size": 1024
}
]
},
{
"type": "document",
"document": [
{
"url": "https://gptbots.ai/example.pdf",
"format": "pdf",
"name": "example pdf",
"size": 1024
}
]
}
]
}
]
},
{
"message_id": "745dd86906931c4a9e0ffb1f",
"parent_message_id": "645dd86906931c4a9e0ffb1f",
"create_time": 1683871849906,
"feedback": "POSITIVE",
"role": "assistant",
"content": [
{
"from_component_branch": "1",
"branch_content": [
{
"type": "text",
"text": "สวัสดี มีอะไรให้ช่วยเหลือไหม?"
},
{
"type": "audio",
"audio": [
{
"url": "http://gptbots.ai/example.mp3",
"transcript": "ข้อความที่ถอดเสียงจากไฟล์เสียง"
}
]
}
]
},
{
"from_component_branch": "2",
"branch_content": [
{
"type": "document",
"document": [
{
"url": "https://gptbots.ai/example.pdf",
"format": "pdf",
"name": "example pdf"
}
]
},
{
"type": "image",
"image": [
{
"url": "https://gptbots.ai/example.png",
"format": "png",
"name": "TAXI2"
}
]
}
]
}
]
}
]
}
บล็อกโค้ดนี้ในหน้าต่างลอย
การตอบกลับสำเร็จ
| ฟิลด์ | ประเภท | คำอธิบาย |
|---|---|---|
| total | string | จำนวนข้อความทั้งหมดในบทสนทนา |
| conversation_content | JSON Array | รายละเอียดข้อความ |
| message_id | string | รหัสเฉพาะของแต่ละข้อความ |
| parent_message_id | string | รหัสข้อความต้นทาง |
| create_time | long | เวลาที่สร้างข้อความ |
| feedback | string | ข้อเสนอแนะจากผู้ใช้ มีค่า: POSITIVE, NEGATIVE หากไม่มีข้อเสนอแนะจะเว้นว่าง |
| role | string | บทบาทข้อความ: user หรือ assistant |
| content | JSON Array | เนื้อหาข้อความ |
| from_component_branch | string | รหัสสาขา component ของแหล่งข้อความ (ว่างสำหรับข้อความผู้ใช้และ Agent ทั่วไป) |
| branch_content | JSON Array | เนื้อหาสาขาของข้อความ |
| type | string | ประเภทเนื้อหาข้อความ: text, image, audio, document, video, file |
| text | string | ข้อความแบบข้อความ |
| image | JSON Array | ข้อความแบบรูปภาพ |
| audio | JSON Array | ข้อความแบบเสียง |
| document | JSON Array | ข้อความแบบเอกสาร |
| video | JSON Array | ข้อความแบบวิดีโอ |
| file | JSON Array | ข้อความแบบไฟล์ |
การตอบกลับผิดพลาด
| ฟิลด์ | ประเภท | คำอธิบาย |
|---|---|---|
| code | int | รหัสข้อผิดพลาด |
| message | string | รายละเอียดข้อผิดพลาด |
รหัสข้อผิดพลาด
| รหัส | ข้อความ |
|---|---|
| 40000 | พารามิเตอร์ไม่ถูกต้อง |
| 40005 | พารามิเตอร์แบ่งหน้ามากกว่าจำนวนจริง |
| 40127 | การยืนยันตัวตนนักพัฒนาไม่สำเร็จ |
| 40356 | ไม่พบบทสนทนา |
| 20059 | Agent ถูกลบแล้ว |
