音乐播放数据上报至HIFIVE,可用于数据核对
POST
HFClient client = new DefaultHFClient(url, appkey, secret);
HFKReportListenRequest request = new HFKReportListenRequest();
request.setMethod(HFRequest.METHOD_POST);
request.setClientId("hf2y7jk19a56qetq05");
request.setMusicId("B7B810AABADF");
request.setTimestamp(System.currentTimeMillis());
request.setDuration(10 L);
request.setAudioFormat(AudioFormatEnum.MP3_128.format);
request.setAudioRate(AudioFormatEnum.MP3_128.rate);
try {
HFKReportListenResponse 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=F1BE84C0AAD6FF8456C57E981D21D97C' -H 'X-HF-ClientId:hf2y7jk19a56qetq05' -H 'X-HF-AppId:170ae316b9b14c1b9c185988771bde16' -H 'X-HF-Action:KReportListen' -H 'X-HF-Timestamp:1595867681732' -H 'X-HF-Version:V4.1.1' -H 'X-HF-Nonce:A1cq9jpI3WY30trM5Ku5JiwCgMwuPuqz'
-X POST - d 'MusicId=B7B810AABADF&AudioFormat=mp3&AudioRate=320&Timestamp=1595827681732'
{
"code": 10200,
"msg": "操作成功",
"data": "",
"taskId": "3b16e9fc46726e412476b1deb242fdb"
}