CustomGPT
  1. 对话
CustomGPT
  • 快速入门
  • 错误处理
  • 术语
  • 项目
    • 列出所有项目
      GET
    • 创建一个新项目
      POST
    • 展示某个项目
      GET
    • 更新某个项目
      GET
    • 删除某个项目
      DELETE
    • 获取某个项目的统计数据
      GET
  • 页数
    • 列出属于某个项目的所有页面
      GET
    • 删除属于某个项目的某个页面
      DELETE
    • 重新索引属于某个项目的某个页面
      POST
    • 预览引文中的文件
      GET
  • 页面元数据
    • 获取特定页面的元数据
      GET
    • 更新特定页面的元数据
      PUT
  • 项目设置
    • 获取项目设置
      GET
    • 更新项目设置
      POST
  • 项目插件
    • 显示某个项目插件
      GET
    • 创建一个插件
      POST
    • 更新一个插件
      PUT
  • 对话
    • 列出项目的所有对话
      GET
    • 创建一个新对话
      POST
    • 更新一个对话
      PUT
    • 删除对话
      DELETE
    • 检索对话中已发送的消息
      GET
    • 向对话发送消息
      POST
  • 引文
    • 获取 Open Graph 数据以供引用
  • 来源
    • 列出某个项目的来源
    • 创建一个新的项目源
    • 更新项目源设置
    • 删除项目源
  • 用户
    • 显示用户的个人资料
    • 更新用户的个人资料
  1. 对话

检索对话中已发送的消息

开发环境
http://dev-cn.your-api-server.com
开发环境
http://dev-cn.your-api-server.com
GET
api/v1/projects/{projectId}/conversations/{sessionId}/messages
检索由其唯一的projectId和sessionId标识的项目对话中发送的所有消息。此端点允许您检索在特定对话中交换的消息的集合。消息包含对话过程中共享的内容、时间戳和其他相关信息。通过提供projectId和sessionId,您可以访问与项目上下文中的特定对话关联的所有消息。
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request GET 'http://dev-cn.your-api-server.comapi/v1/projects//conversations//messages?page=1&order=desc' \
--header 'authorization;'
响应示例响应示例
200 - 成功示例
{
  "status": "success",
  "data": {
    "conversation": {
      "created_at": "2023-04-30 16:43:53",
      "updated_at": "2023-04-30 16:43:53",
      "deleted_at": "2023-04-30 16:43:53",
      "id": 1,
      "name": "Conversation 1",
      "project_id": 1,
      "created_by": 1,
      "session_id": "f1b9aaf0-5e4e-11eb-ae93-0242ac130002"
    },
    "messages": {
      "current_page": 1,
      "data": [
        {
          "id": 1,
          "user_id": 1,
          "user_query": "What is the meaning of life?",
          "openai_response": "The meaning of life is to be happy.",
          "created_at": "2021-01-01 00:00:00",
          "updated_at": "2021-01-01 00:00:00",
          "conversation_id": 1,
          "citations": [
            1,
            2,
            3
          ],
          "metadata": {
            "user_ip": "127.0.0.1",
            "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko)",
            "external_id": "ext_id_1234567890",
            "request_source": "web"
          }
        }
      ],
      "first_page_url": "https://app.customgpt.ai/api/v1/users?page=1",
      "from": 1,
      "last_page": 1,
      "last_page_url": "https://app.customgpt.ai/api/v1/users?page=1",
      "next_page_url": "https://app.customgpt.ai/api/v1/users?page=1",
      "path": "https://app.customgpt.ai/api/v1/users?page=1",
      "per_page": 10,
      "prev_page_url": "https://app.customgpt.ai/api/v1/users?page=1",
      "to": 1,
      "total": 1
    }
  }
}

请求参数

Path 参数
projectId
string 
必需
要获取消息的项目 ID
sessionId
string 
必需
要获取消息的会话的会话 ID
Query 参数
page
string 
返回的页码
可选
示例值:
1
order
string 
可选
对结果进行排序的顺序
示例值:
desc
Header 参数
authorization
string 
必需
Bearer Your_API_KEY

返回响应

🟢200成功
application/json
Body
status
string 
必需
data
object 
必需
conversation
object 
必需
messages
object 
必需
🟠400请求有误
🟠401没有权限
🟠404记录不存在
🔴500服务器错误
修改于 2024-02-22 05:47:25
上一页
删除对话
下一页
向对话发送消息
Built with