音乐使用数据上报至HIFIVE,可用于数据核对。
POST
HFClient client = new DefaultHFClient(url, appkey, secret);
HFTrafficReportListenRequest request = new HFTrafficReportListenRequest();
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 {
HFTrafficReportListenResponse 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=0E942E73864A95EABD3996071A71FBE2' -H 'X-HF-ClientId:hf2y7jk19a56qetq05' -H 'X-HF-AppId:170ae316b9b14c1b9c185988771bde16' -H 'X-HF-Action:TrafficReportListen' -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": "5be462476b1926a9cb67bb242fdb1de3"
}