[AI72]离线历史记录获取-批量

post
https://connect.zhihuiya.com/ai/sso/agent/batch-history
在体验中心中试用

该接口作为AI类API的增值功能,支持用户批量查询同一公司下多个账号的历史记录。

startTime和endTime为可选参数,不传则查询全部历史记录;page默认为1;user_accounts列表最多20个,每个账号的email和phone至少有一个不为空;返回结果按用户分组

请求参数

此 API 接口支持的参数列表

名称类型示例描述
company_id
必填
stringabc123
公司ID
end_time
integer<int64>1761580799999
结束时间戳(毫秒)
page
integer<int32>1
页码,从1开始
start_time
integer<int64>1758902400000
开始时间戳(毫秒)
user_accounts
必填
array[ { "email": "user1@example.com", "phone": "12345678900" }, { "email": "user2@example.com", "phone": "12345678901" } ]
用户账号列表,最多20个,每个账号包含email和phone
email
stringuser@example.com
用户邮箱
phone
string12345678900
用户手机号

响应结构

API 响应数据的结构说明

字段名类型示例描述
data
object-
响应数据
user_histories
array[ { "email": "user@example.com", "phone": "12345678900", "history": { "page": 1, "limit": 20, "total": 100, "history_maps": [ { "data": [ { "id": "2a7a4ddd-7f5d-4266-a96e-13a57095db79", "link": "/ai/agent-flow/2a7a4ddd-7f5d-4266-a96e-13a57095db79", "time": "13:58", "source": "AI_GENERATE", "message": "如何提高锂电池能量密度到260瓦时/千克(Wh/kg)且体积没有变大", "rawType": "ai_generate", "icon_url": "https://qa-patsnap-import-workspace.cdn.zhihuiya.com/agent/9b6135cd012c425e84edf84e6b03e366-image.jpeg", "icon_path": "agent/9b6135cd012c425e84edf84e6b03e366-image.jpeg", "created_at": "23 Oct 2025 13:58", "business_id": "2a7a4ddd-7f5d-4266-a96e-13a57095db79", "business_name": "Technical Solution Exploration" } ], "date": "2025-10-23" } ] } } ]
用户历史记录列表
email
stringuser@example.com
用户邮箱
phone
string12345678900
用户手机号
history
object{ "page": 1, "limit": 20, "total": 100, "history_maps": [ { "data": [ { "id": "2a7a4ddd-7f5d-4266-a96e-13a57095db79", "link": "/ai/agent-flow/2a7a4ddd-7f5d-4266-a96e-13a57095db79", "time": "13:58", "source": "AI_GENERATE", "message": "如何提高锂电池能量密度到260瓦时/千克(Wh/kg)且体积没有变大", "rawType": "ai_generate", "icon_url": "https://qa-patsnap-import-workspace.cdn.zhihuiya.com/agent/9b6135cd012c425e84edf84e6b03e366-image.jpeg", "icon_path": "agent/9b6135cd012c425e84edf84e6b03e366-image.jpeg", "created_at": "23 Oct 2025 13:58", "business_id": "2a7a4ddd-7f5d-4266-a96e-13a57095db79", "business_name": "Technical Solution Exploration" } ], "date": "2025-10-23" } ] }
历史记录详情
page
integer<int32>1
当前页码
limit
integer<int32>20
每页记录数
total
integer<int64>100
总记录数
history_maps
array[ { "data": [ { "id": "2a7a4ddd-7f5d-4266-a96e-13a57095db79", "link": "/ai/agent-flow/2a7a4ddd-7f5d-4266-a96e-13a57095db79", "time": "13:58", "source": "AI_GENERATE", "message": "如何提高锂电池能量密度到260瓦时/千克(Wh/kg)且体积没有变大 热管理安全阈值\n,材料成本上限\n,生产工艺兼容性 ", "rawType": "ai_generate", "icon_url": "https://qa-patsnap-import-workspace.cdn.zhihuiya.com/agent/9b6135cd012c425e84edf84e6b03e366-image.jpeg", "icon_path": "agent/9b6135cd012c425e84edf84e6b03e366-image.jpeg", "created_at": "23 Oct 2025 13:58", "business_id": "2a7a4ddd-7f5d-4266-a96e-13a57095db79", "business_name": "Technical Solution Exploration" }, { "id": "2570aeaf-7999-430b-9bef-c43fcda4d928", "link": "/ai/agent-flow/2570aeaf-7999-430b-9bef-c43fcda4d928", "time": "13:39", "source": "AI_GENERATE", "message": "如何提高锂电池能量密度到260瓦时/千克(Wh/kg)且体积没有变大 热管理安全阈值\n,材料成本上限\n,生产工艺兼容性 ", "rawType": "ai_generate", "icon_url": "https://qa-patsnap-import-workspace.cdn.zhihuiya.com/agent/9b6135cd012c425e84edf84e6b03e366-image.jpeg", "icon_path": "agent/9b6135cd012c425e84edf84e6b03e366-image.jpeg", "created_at": "23 Oct 2025 13:39", "business_id": "2570aeaf-7999-430b-9bef-c43fcda4d928", "business_name": "Technical Solution Exploration" } ], "date": "2025-10-23" } ]
按日期分组的历史记录列表
data
array[ { "id": "2a7a4ddd-7f5d-4266-a96e-13a57095db79", "link": "/ai/agent-flow/2a7a4ddd-7f5d-4266-a96e-13a57095db79", "time": "13:58", "source": "AI_GENERATE", "message": "如何提高锂电池能量密度到260瓦时/千克(Wh/kg)且体积没有变大 热管理安全阈值\n,材料成本上限\n,生产工艺兼容性 ", "rawType": "ai_generate", "icon_url": "https://qa-patsnap-import-workspace.cdn.zhihuiya.com/agent/9b6135cd012c425e84edf84e6b03e366-image.jpeg", "icon_path": "agent/9b6135cd012c425e84edf84e6b03e366-image.jpeg", "created_at": "23 Oct 2025 13:58", "business_id": "2a7a4ddd-7f5d-4266-a96e-13a57095db79", "business_name": "Technical Solution Exploration" } ]
该日期下的历史记录列表
q
stringquantum computing AND artificial intelligence
查询关键词或查询字符串
id
string2a7a4ddd-7f5d-4266-a96e-13a57095db79
历史记录ID
efq
stringAPD:[20230101 TO 20231231]
扩展字段查询
link
string/ai/agent-flow/2a7a4ddd-7f5d-4266-a96e-13a57095db79
历史记录对应的链接地址
time
string13:58
创建时间(仅时分),格式:HH:mm
count
object{ "total": 1500, "granted": 800, "application": 700 }
搜索结果统计数据(专利数等)
source
stringAI_GENERATE
历史记录来源
message
string如何提高锂电池能量密度到260瓦时/千克(Wh/kg)且体积没有变大 热管理安全阈值\n,材料成本上限\n,生产工艺兼容性
历史记录的消息或描述信息
icon_url
stringhttps://qa-patsnap-import-workspace.cdn.zhihuiya.com/agent/9b6135cd012c425e84edf84e6b03e366-image.jpeg
图标完整URL地址
raw_type
stringai_generate
历史记录类型
icon_path
stringagent/9b6135cd012c425e84edf84e6b03e366-image.jpeg
图标路径
patent_id
stringUS20240123456A1
专利ID
created_at
string23 Oct 2025 13:58
创建时间,格式:yyyy-MM-dd HH:mm 或 dd MMM yyyy HH:mm
extra_info
object{ "region": "US", "category": "technology" }
额外信息
business_id
string2a7a4ddd-7f5d-4266-a96e-13a57095db79
业务ID(如:seekId、mindId、researchId等)
business_name
stringTechnical Solution Exploration
业务名称
date
string2025-10-23
日期,格式:yyyy-MM-dd
status
必填
booleanfalse
状态
error_msg
stringThe request parameter format is incorrect!
错误信息
error_code
必填
integer0
错误代码

成功响应示例

成功调用 API 的响应示例

JSON
{
  "data": {
    "user_histories": [
      {
        "email": "user@example.com",
        "phone": 12345678900,
        "history": {
          "page": 1,
          "limit": 20,
          "total": 100,
          "history_maps": [
            {
              "data": [
                {
                  "q": "quantum computing AND artificial intelligence",
                  "id": "2a7a4ddd-7f5d-4266-a96e-13a57095db79",
                  "efq": "APD:[20230101 TO 20231231]",
                  "link": "/ai/agent-flow/2a7a4ddd-7f5d-4266-a96e-13a57095db79",
                  "time": "13:58",
                  "count": {
                    "total": 1500,
                    "granted": 800,
                    "application": 700
                  },
                  "source": "AI_GENERATE",
                  "message": "如何提高锂电池能量密度到260瓦时/千克(Wh/kg)且体积没有变大 热管理安全阈值\\n,材料成本上限\\n,生产工艺兼容性",
                  "icon_url": "https://qa-patsnap-import-workspace.cdn.zhihuiya.com/agent/9b6135cd012c425e84edf84e6b03e366-image.jpeg",
                  "raw_type": "ai_generate",
                  "icon_path": "agent/9b6135cd012c425e84edf84e6b03e366-image.jpeg",
                  "patent_id": "US20240123456A1",
                  "created_at": "23 Oct 2025 13:58",
                  "extra_info": {
                    "region": "US",
                    "category": "technology"
                  },
                  "business_id": "2a7a4ddd-7f5d-4266-a96e-13a57095db79",
                  "business_name": "Technical Solution Exploration"
                }
              ],
              "date": "2025-10-23"
            }
          ]
        }
      }
    ]
  },
  "status": true,
  "error_code": 0
}

错误码

此接口可能返回的错误码列表

业务错误码

错误码描述
68300004请求参数异常!
68300005查询Api失败!
68300006解析基本存取错误!
68300007存在错误的请求!
68300008服务中断异常,请稍后再试!
68300010文件不符合上传规范!

平台错误码

错误码描述
67200000API整体限流错误!
67200001API整体限流错误!
67200002当前调用速率过快,超过当前配置限制QPS!
67200003申请token的key和secret传参不正确或者客户端已被禁用!
67200004请求的接口无权限请联系我们的支持人员!
67200005账户余额/调用次数不足!
67200006客户端超过开通有效期!
67200007当前调用超过当天配置使用额度!
67200008请检查query参数中必填的apikey是否传输!
67200009apikey与所传的bearerToken不匹配,请检查是否使用在有效期内的token!
67200012请求不合法!
67200100当前服务器状态正忙,请求响应超时!
67200101当前请求的Api不存在请检查请求Path!

HTTP 状态码

状态码描述
0请求成功
201Created
401Unauthorized
403Forbidden
404Not Found

性能指标

此接口的预期性能特征

正常响应时间

5000 ms

最大响应时间

10000 ms