|
注册
首页
联系我们

AI能力 [AI72]离线历史记录获取

[AI72]离线历史记录获取公开V1
该接口作为AI类API的增值功能,支持用户集成历史记录到本地系统。
注意:startTime和endTime为可选参数,不传则查询全部历史记录;page默认为1;email和phone必须有一个不为空

基本信息

接口地址: /ai/sso/agent/history

请求方式: post

返回格式: application/json

登录后即可调试接口,点击 登录/注册

接口说明文档下载

请求参数

body
AgentHistoryRequest
ParameterTypeRequiredDescriptionSample
company_idstringtrue
公司ID
abc123
emailstringtrue
用户邮箱
user@example.com
end_timeintegerfalse
结束时间戳(毫秒)
1761580799999
pageintegerfalse
页码,从1开始
1
phonestringtrue
用户手机号
12345678900
start_timeintegerfalse
开始时间戳(毫秒)
1758902400000

请求示例

  • Curl
  • NodeJs
  • Python
  • Java
curl -X POST "https://connect.zhihuiya.com/ai/sso/agent/history?apikey="
-H "Content-Type:application/json"
-H "authorization:Bearer {token}"
-d '{"page":1,"email":"user@example.com","phone":"12345678900","end_time":1761580799999,"company_id":"abc123","start_time":1758902400000}'
const axios = require('axios');
const options = {
    url: "https://connect.zhihuiya.com/ai/sso/agent/history",
    method: "POST",
    headers: {
        'Content-Type': 'application/json',
        'authorization': 'Bearer {token}',
    },
    params: {
        'apikey': '',
    },
    data: {
        "page": 1,
        "email": "user@example.com",
        "phone": "12345678900",
        "end_time": 1761580799999,
        "company_id": "abc123",
        "start_time": 1758902400000
    }
};
axios(options).then(res => {
    console.log(res.data)
}).catch(err => {
    console.log(err)
})
import requests
url = "https://connect.zhihuiya.com/ai/sso/agent/history"

params = {
    "apikey": ""
}

payload = {
    "page": 1,
    "email": "user@example.com",
    "phone": "12345678900",
    "end_time": 1761580799999,
    "company_id": "abc123",
    "start_time": 1758902400000
}

headers = {
    "Content-Type": "application/json",
    "authorization": "Bearer {token}"
}

response = requests.request("POST", url, params=params, json=payload, headers=headers)

print(response.text)
public static void main(String[] args) {
    String host = "https://connect.zhihuiya.com";
    String path = "/ai/sso/agent/history";

    Map headers = new HashMap();
    headers.put("Content-Type", "application/json");
    headers.put("authorization", "Bearer {token}");

    Map querys = new HashMap();
    querys.put("apikey", "");
    JSONObject dataBody = (JSONObject)JSON.parse("{\"page\":1,\"email\":\"user@example.com\",\"phone\":\"12345678900\",\"end_time\":1761580799999,\"company_id\":\"abc123\",\"start_time\":1758902400000}");

    try {
        /**
        * Important Tips:
        * Please Download HttpUtils From
        * https://github.com/aliyun/api-gateway-demo-sign-java/blob/master/src/main/java/com/aliyun/api/gateway/demo/util/HttpUtils.java
        *
        * Please refer to the corresponding dependence:
        * https://github.com/aliyun/api-gateway-demo-sign-java/blob/master/pom.xml
        */
        HttpResponse response = HttpUtils.doPost(host, path, null, headers, querys, dataBody.toJSONString());
        System.out.println(EntityUtils.toString(response.getEntity()));
    } catch (Exception e) {
        e.printStackTrace();
    }
}
复制

返回参数

CommonResponse
ParameterTypeRequiredDescriptionSample
data
objectfalse
响应数据
no sample
status
booleantrue
状态
false
error_msg
stringfalse
错误信息
The request parameter format is incorrect!
error_code
integertrue
错误代码
0
HistoryRecordsResponseDTO
ParameterTypeRequiredDescriptionSample
page
integerfalse
当前页码
1
limit
integerfalse
每页记录数
20
total
integerfalse
总记录数
100
history_maps
arrayfalse
按日期分组的历史记录列表
[ { "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" } ]
DailyRecordsDTO
ParameterTypeRequiredDescriptionSample
data
arrayfalse
该日期下的历史记录列表
[ { "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" } ]
date
stringfalse
日期,格式:yyyy-MM-dd
2025-10-23
HistoryRecordsDTO
ParameterTypeRequiredDescriptionSample
q
stringfalse
查询关键词或查询字符串
quantum computing AND artificial intelligence
id
stringfalse
历史记录ID
2a7a4ddd-7f5d-4266-a96e-13a57095db79
efq
stringfalse
扩展字段查询
APD:[20230101 TO 20231231]
link
stringfalse
历史记录对应的链接地址
/ai/agent-flow/2a7a4ddd-7f5d-4266-a96e-13a57095db79
time
stringfalse
创建时间(仅时分),格式:HH:mm
13:58
count
objectfalse
搜索结果统计数据(专利数等)
{ "total": 1500, "granted": 800, "application": 700 }
source
stringfalse
历史记录来源
AI_GENERATE
message
stringfalse
历史记录的消息或描述信息
如何提高锂电池能量密度到260瓦时/千克(Wh/kg)且体积没有变大 热管理安全阈值\n,材料成本上限\n,生产工艺兼容性
icon_url
stringfalse
图标完整URL地址
https://qa-patsnap-import-workspace.cdn.zhihuiya.com/agent/9b6135cd012c425e84edf84e6b03e366-image.jpeg
raw_type
stringfalse
历史记录类型
ai_generate
icon_path
stringfalse
图标路径
agent/9b6135cd012c425e84edf84e6b03e366-image.jpeg
patent_id
stringfalse
专利ID
US20240123456A1
created_at
stringfalse
创建时间,格式:yyyy-MM-dd HH:mm 或 dd MMM yyyy HH:mm
23 Oct 2025 13:58
extra_info
objectfalse
额外信息
{ "region": "US", "category": "technology" }
business_id
stringfalse
业务ID(如:seekId、mindId、researchId等)
2a7a4ddd-7f5d-4266-a96e-13a57095db79
business_name
stringfalse
业务名称
Technical Solution Exploration

返回状态码

error_codeDescription
0请求成功
201Created
401Unauthorized
403Forbidden
404Not Found
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!

返回示例

  • json
{
    "data": {
        "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
}
复制
[AI72]离线历史记录获取-批量