音乐使用数据上报至HIFIVE,可用于数据核对。
POST
HFClient client = new DefaultHFClient(url, appkey, secret);
HFUGCReportListenRequest request = new HFUGCReportListenRequest();
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 {
HFUGCReportListenResponse 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=14E47D07E660262A2C4934429847C91F' -H 'X-HF-ClientId:hf2y7jk19a56qetq05' -H 'X-HF-AppId:170ae316b9b14c1b9c185988771bde16' -H 'X-HF-Action:UGCReportListen' -H 'X-HF-Timestamp:1595867681732' -H 'X-HF-Version:V4.2.0' -H 'X-HF-Nonce:A1cq9jpI3WY30trM5Ku5JiwCgMwuPuqz'
-X POST - d 'MusicId=B7B810AABADF&AudioFormat=mp3&AudioRate=320&Timestamp=1595827681732'
{
"code": 10200,
"msg": "操作成功",
"data": "",
"taskId": "26e462476bb242fdb1de3b16a992cb67"
}