发信息
POST
/api/v0/chatbots/{chatbotId}/message向特定线程发送消息或启动新线程
请求参数
Path 参数
chatbotId
string
必需
聊天机器人的 ID
Header 参数
Authorization
string
必需
示例值:
Bearer <token>
Content-Type
string
必需
示例值:
application/json
Body 参数application/json
message
string
包含消息的实际文本
from
string
必需
示例
{
"message": "What can you do ?",
"from": "USER"
}
示例代码
返回响应
成功(200)
请求有误(400)
没有权限(401)
禁止访问(403)
记录不存在(404)
服务器错误(500)
HTTP 状态码: 200
内容格式: JSONapplication/json
数据结构
success
boolean
必需
指示这是成功响应还是错误响应
message
string
必需
有关所执行操作的总体消息
data
object
从服务器返回的数据
message
object
消息对象
示例
成功示例
{
"success": true,
"message": "Sent the message successfully",
"data": {
"message": {
"id": "376290410396385873",
"question": {
"text": "This is user!!",
"timestamp": "2023-08-03T11:43:52.037718Z"
},
"answer": {
"text": "This is agent!!",
"timestamp": "2023-08-03T11:19:19.041469Z"
},
"sources": [],
"gptModel": "gpt-3.5-turbo",
"reaction": "NEUTRAL",
"threadId": "06b3b43c-5651-49a2-b618-d7f24667c1b6",
"messageType": "AGENT_MESSAGE",
"iconUrl": "https://avatars.githubusercontent.com/u/17903466?s=48&v=4",
"agentName": "Test Agent",
"prompts": [
{
"id": "17e23880-386e-492f-960c-4394baec2977",
"title": "Prompt 1",
"description": "This is the prompt1 description"
},
{
"id": "ab0ba301-90c9-4ef2-8ca8-fa579a104386",
"title": "Prompt 2",
"description": "This is the prompt2 description"
}
],
"smartPrompts": [
"First smart prompt",
"Second smart prompt",
"Third smart prompt"
],
"chatbotId": "365062873485935184"
}
}
}
最后修改时间: 8 个月前