获取线程
GET
/api/v0/chatbots/{chatbotId}/threads/{threadId}获取聊天机器人的单个线程
请求参数
Path 参数
chatbotId
string
必需
聊天机器人的 ID
threadId
string
必需
聊天机器人线程的 ID
Header 参数
Authorization
string
必需
示例值:
Bearer <token>
示例代码
返回响应
成功(200)
请求有误(400)
没有权限(401)
禁止访问(403)
记录不存在(404)
服务器错误(500)
HTTP 状态码: 200
内容格式: JSONapplication/json
数据结构
success
boolean
必需
指示这是成功响应还是错误响应
message
string
必需
有关所执行操作的总体消息
data
object
从服务器返回的数据
thread
object
必需
示例
成功示例
{
"success": true,
"message": "Fetched the thread successfully",
"data": {
"thread": {
"threadId": "06b3b43c-5651-49a2-b618-d7f24667c1b6",
"mode": "AI",
"messages": [
{
"messageId": "365062948587045457",
"question": {
"text": "Hello, what is this?",
"timestamp": "2023-05-18T11:40:07.857030Z"
},
"answer": {
"text": "Hello! I am an AI assistant designed to provide information about the website's content. If you have any specific questions, feel free to ask and I will do my best to provide accurate answers.",
"timestamp": "2023-05-18T11:40:07.857030Z"
},
"reaction": "NEUTRAL",
"sources": [],
"messageType": "NORMAL_MESSAGE",
"systemMessageType": "CONVERSATION_ESCALATED",
"iconUrl": null,
"prompts": [],
"gptModel": "gpt-3.5-turbo"
},
{
"messageId": "365064286366597712",
"question": {
"text": "Hi",
"timestamp": "2023-05-18T12:01:23.667033Z"
},
"answer": null,
"reaction": "NEUTRAL",
"sources": [],
"messageType": "USER_MESSAGE",
"systemMessageType": "CONVERSATION_ESCALATED",
"iconUrl": null,
"prompts": [],
"gptModel": "gpt-3.5-turbo"
},
{
"messageId": "365064310572974672",
"question": null,
"answer": {
"text": "YO",
"timestamp": "2023-05-18T12:01:46.751791Z"
},
"reaction": "NEUTRAL",
"sources": [],
"messageType": "AGENT_MESSAGE",
"systemMessageType": "CONVERSATION_ESCALATED",
"iconUrl": null,
"prompts": [],
"gptModel": "gpt-3.5-turbo"
}
],
"startedAt": "2023-05-18T11:39:57.349750Z",
"updatedAt": "2023-05-18T11:39:57.349750Z",
"webhookUrl": "https://hooks.zapier.com/hooks/catch/15695697/3hqs23e",
"totalMessagesRead": 47,
"chatUserId": null,
"chatbotId": "365062873485935184",
"chatUser": null
}
}
}
最后修改时间: 8 个月前