获取搜索历史记录
GET
HifiveClient client = new DefaultHifiveClient(url, appkey, secret);
HFSearchHistoryRequest request = new HFSearchHistoryRequest ();
request.setMethod(HifiveRequest.METHOD_GET);
request.setClientId("hf2y7jk19a56qetq05");
request.setTimestamp(System.currentTimeMillis());
request.setPage(1);
request.setPageSize(20);
request.setVersion("V4.2.0");
request.setAccessToken("eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzZWNyZXRLZXkiOiJlM2RlOGRlMzY2ODM0YmYwODYiLCJpc3MiOiJoaWZpdmUiLCJleHAiOjE2MjUzODIwMjgsImlhdCI6MTYyMDg4OTIyOH0.sl23Uu0qKjoftlFR2pY-Ei0UfINQoZ8XG6DGfO-hKrY");
try {
HFSearchRecordPostResponse response = client.execute(request);
System.out.println(JSON.toJSON(response));
} catch (ApiException e) {
e.printStackTrace();
}
curl -G https://gateway-open.haifanwu.com -H 'Authorization:HF3-HMAC-SHA1 Signature=DB7641BBB5511421A6E1582BB6C695E1' -H 'X-HF-ClientId:hf2y7jk19a56qetq05' -H 'X-HF-Token:cc24749900a70c83222654b48cc57a2a' -H 'X-HF-AppId:170ae316b9b14c1b9c185988771bde16' -H 'X-HF-Action:SearchHistory' -H 'X-HF-Timestamp:1595820221753' -H 'X-HF-Version:V4.2.0' -H 'X-HF-Nonce:YLJpgkqFNiIVhLBHxMlNlntHuzscVOQU'
-X GET -d 'Page=1&PageSize=10'
{
"code": 200,
"msg": "操作成功",
"data": {
"totalPage": 1,
"records": [{
"searchId": 2,
"keyword": "Follow",
"createTime": "2020-12-08 15:37:22"
}],
"meta": {
"totalCount": 1,
"currentPage": 1
}
},
"success": True,
}