在接口行为采集、猜你喜欢和单笔付费场景等接口中使用。(7200秒无操作则token自动失效,token不参与签名计算)
POST
HFClient client = new DefaultHFClient(url, appkey, secret);
HFBaseLoginRequest request = new HFBaseLoginRequest();
request.setMethod(HFRequest.METHOD_POST);
request.setClientId("hf2y7jk19a56qetq05");
request.setNickname("zealot");
request.setGender(GenderEnum.MAN.ordinal());
request.setBirthday(1594639058);
request.setLocation("30.779164,103.94547");
request.setEducation(EducationEnum.MIDDLE_SCHOOLE.ordinal());
request.setProfession(8);
request.setIsOrganization(true);
request.setFavoriteSinger("周杰伦");
request.setFavoriteGenre("1");
try {
HFBaseLoginResponse 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=5BE5EA6751C407BF549360D89375C69C' -H 'X-HF-ClientId:hf2y7jk19a56qetq05' -H 'X-HF-AppId:170ae316b9b14c1b9c185988771bde16' -H 'X-HF-Action:BaseLogin' -H 'X-HF-Timestamp:1595819673865' -H 'X-HF-Version:V4.1.1' -H 'X-HF-Nonce:VxIbXUgOWqoYCBTGpAQHtcTrPslzZlFw'
-X POST -d 'Birthday=202012121&Education=2&FavoriteGenre=6&FavoriteSinger=周杰伦,刘德华&Gender=1&IsOrganization=false&Location=乐山&Nickname=谎言&Profession=8'
{
"code": 10200,
"msg": "操作成功",
"data": {
"token": "cc24749900a70c83222654b48cc57a2a"
},
"taskId": "e3a53e1e2b484ea997f85052fca876e7"
}