在接口猜你喜欢中,会根据用户的音乐使用行为和用户画像推荐更符合用户爱好的音乐。采集的行为数据越全面推荐准确度越高。
POST
行为内容采用json字符串保存,根据行为不同其参数不同。例如:播放音乐时content字段为point/duration,代表json包含point和duration这2个字段,字段具体含义如下:
HFClient client = new DefaultHFClient(url, appkey, secret);
HFBaseReportRequest request = new HFBaseReportRequest();
request.setMethod(HFRequest.METHOD_POST);
request.setAction(1009);
request.setTargetId("B75C80A41E3A");
request.setClientId("hf2y7jk19a56qetq05");
request.setToken("13cda3f10b63120093d64ebf4116eabd");
try {
HFBaseReportResponse 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=538C65B3600401575A51E379FFA931E3' -H 'X-HF-ClientId:hf2y7jk19a56qetq05' -H 'X-HF-Token:cc24749900a70c83222654b48cc57a2a' -H 'X-HF-AppId:170ae316b9b14c1b9c185988771bde16' -H 'X-HF-Action:BaseReport' -H 'X-HF-Timestamp:1595820221753' -H 'X-HF-Version:V4.1.1' -H 'X-HF-Nonce:YLJpgkqFNiIVhLBHxMlNlntHuzscVOQU'
-X POST -d 'Action=1009&TargetId=B75C80A41E3A'
{
"code": 10200,
"msg": "操作成功",
"data": null,
"taskId": "98ec0fc8f1c34c8589957a543f5d9bcc"
}