APIKEY获取

高佣api调用的教程


方法:post
请求链接:http://v2.api.haodanku.com/ratesurl
调用须知:调用前请前往放单后台授权,授权地址:http://publish.haodanku.com/tbauth/index.html
请求说明:请求方式是POST的方式,也支持无优惠券宝贝请求,请求高佣前请授权先,并确保传的pid归属于授权的淘宝号下,同时适度缓存已转换过的高佣链接,避免重复请求!同时,高佣转链的商品是支持好单库和其他联盟商品,但调用接口的用户需优先调用好单库商品!

请求参数

参数类型求参数值是否必须说明
apikeystring你的apikey放单后台获取的Apikey值(*必要
itemidinteger529048526383宝贝ID(*必要
pidstringmm_0000_0000_000推广位ID(*必要 需是授权淘宝号下的推广位,如果请求的时候携带了渠道id请求,则该pid需是渠道管理下面的渠道专属推广位
relation_idstring566455渠道ID
tb_namestring点滴优惠授权后的淘宝名称(*必要,多授权淘宝号时用于区分哪个淘宝账户的
activityidstring7d6e6619ff754e1e94ea140e2a82240f阿里妈妈推广券ID (选填)
mestring1营销计划(选填)
access_tokenstring565566xxxxxx授权之后的淘宝授权token(选填)
get_taowordint0是否返回淘口令(0.否;1.是)(默认0)(选填)
titlestringxxxxxxx商品标题(用于返回淘口令*get_taoword等于1时为必填参数*,需超过8个字符)
logostringhttps://img.alicdn.com/xxxxxxxx.jpg商品主图链接地址(选填,可为空)
PHP请求示例:
$request_url = 'http://v2.api.haodanku.com/ratesurl';
$request_data['apikey'] = '你的apikey';
$request_data['itemid'] = '529048526383';
$request_data['pid'] = 'mm_0000_0000_000';
$request_data['activityid'] = '7d6e6619ff754e1e94ea140e2a82240f';
$request_data['tb_name'] = '点滴优惠';
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL,$request_url);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_TIMEOUT,10);
curl_setopt($ch,CURLOPT_POST,1);
curl_setopt($ch,CURLOPT_POSTFIELDS,$request_data);
$res = curl_exec($ch);
curl_close($ch);
var_dump($res);
JAVA请求示例:
String result=null;
String urlString="http://v2.api.haodanku.com/ratesurl";
InputStream is=null;
String param=null;
StringBuilder sbParams=new StringBuilder();
sbParams.append("apikey");
sbParams.append("=");
sbParams.append("你的apikey");
sbParams.append("&");
sbParams.append("itemid");
sbParams.append("=");
sbParams.append("529048526383");
sbParams.append("&");
sbParams.append("pid");
sbParams.append("=");
sbParams.append("mm_0000_0000_000");
sbParams.append("&");
sbParams.append("activityid");
sbParams.append("=");
sbParams.append("7d6e6619ff754e1e94ea140e2a82240f");
sbParams.append("&");
try {
URL url=new URL(urlString);
HttpURLConnection urlConnection= (HttpURLConnection) url.openConnection();
//post请求需要设置DoOutput为true
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
//设置参数
param=sbParams.toString();
urlConnection.getOutputStream().write(param.getBytes());
urlConnection.getOutputStream().flush();
urlConnection.setConnectTimeout(5*1000);
urlConnection.setReadTimeout(5*1000);
//连接服务器
urlConnection.connect();
StringBuilder stringBuilder=new StringBuilder();
if(urlConnection.getResponseCode()==HttpURLConnection.HTTP_OK){
is=urlConnection.getInputStream();
int len=0;
byte[] buffer=new byte[1024];
while ((len=is.read(buffer))!=-1) {
stringBuilder.append(new String(buffer,0,len));
}
result= stringBuilder.toString();
}
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}finally {
if(is!=null){
try {
is.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
System.out.println(result);

返回参数

参数类型参数值说明
codeinteger1状态码:1成功;0失败
msgstringSUCCESS具体提示语
coupon_click_urlstringhttps://uland.taobao.com/coupon/edetail?e=7fQNiK3D5jIGQASttHIRqbcy5z0QyNr42bMFOuQG7EgOyUSRHJ
Z90h84zp%2BDboXyEohiU9%2F
JmB0NImyXWvUD779fwBwwUiqlbCZVHaAgFiNIR7InptNW9kBsXx8cnY%2FD8%2BL9TMUJ0U%2BY6yLLt5ZCZQ%3D%3D
&traceId=0bb7517915222455896152684e&pid=mm_0000_0000_0000&src=fklm_hltk&from=tool&sight=fklm
高佣优惠券链接
max_commission_ratestring20佣金比例
couponmoneystring40优惠券金额,若没有优惠券则返回0
couponstarttimestring1523289600优惠券开始时间,若没有则返回空
couponendtimestring1523462399优惠券结束时间,若没有则返回空
couponexplainstring满89.0元可用优惠券使用条件,若没有则返回空
couponnumstring10000优惠券总量,若没有则返回空
couponsurplusstring8310优惠券剩余量,若没有则返回空
couponreceivestring1690优惠券领取量,若没有则返回空
item_urlstringhttp://s.click.taobao.com/t?e=m%3D2%26s%3D045cpkujpHRw4vFB6t2Z2ueEDrYVVa64K7Vc7tFgwiHLWlSKdGSYDldMN%2Foy6lKE8sviUM61dt04meEzW2axMX3J%2F35WPWCYfBm5hhYg0vVctuTBhoUmJlzD4g%2BlBXfoPPC9MS0G%2F3TNEPXytV9ALq8XLr9cF0l0AOJ7n9hIYuSUmgZvWjGCm%2FRVj1yieHrVodQTkT3IQPLnB5qWG8rGaQ%3D%3D&union_lens=lensId:0b0930de_0dd1_166282394c2_2ee7单品链接,没有券的情况可以直接进入淘宝购买页
taowordstring¥a*0S*Lh*y64¥淘口令,若没有则返回空
titlestring1690商品标题title参数,若没有则返回空
ysyl_click_urlstringhttps://uland.taobao.com/coupon/edetail?e=24f%2FkEwDLksNfLV8niU3RwXoB%2BDaBK5LQS0Flu%2FfbSp4QsdWMikAalrisGmre1Id0BFAqRODu10dZhUPtSmIK2TPWQbsD%2B84rwGSVh%2BekNkqfsmYJtq5pMtqzs54LcYsDoY04eXaha8tAR%2FcuihLiqOTwgNC5W%2BRVFKltX8qRnmsnYxbFtXWjeZwktg%2B18aVaNDPcpk0O%2BvBgzGDWMg%2BJ004mW%2BqsTaHonv6QcvcARY%3D&&app_pvid=59590_11.29.168.153_461_1571674775361&ptl=floorId:25869;app_pvid:59590_11.29.168.153_461_1571674775361;tpp_pvid:100_11.9.3.89_106395_8931571674775365404预售有礼-推广链接
ysyl_tlj_facestring3.68预售有礼-预估淘礼金(元)
ysyl_tlj_send_timestring2019-11-10 18:00:00预售有礼-淘礼金发放时间
ysyl_tlj_use_start_timestring2019-11-11 01:00:00预售有礼-淘礼金使用开始时间
ysyl_tlj_use_end_timestring2019-11-11 23:59:59预售有礼-淘礼金使用结束时间
Json返回示例:
{
"code": 1,
"msg":"SUCCESS",
"data": [{
"coupon_click_url": "https://uland.taobao.com/coupon/edetail?e=
onyRGc6wY1cGQASttHIRqWqRmv%2BqjhQ5evgn4PHiXSoOyUSRHJZ90h84zp%2BDboXyEohiU9%2F
JmB0NImyXWvUD779fwBwwUiqlbCZVHaAgFiNIR7InptNW9kBsXx8cnY%2FDhL9C6kpStkdUWm0sh9Taqg%3D%3D
&traceId=0be4113315223178633837851e&pid=mm_0000_0000_0000
&src=fklm_hltk&from=tool&sight=fklm",
"max_commission_rate": "20",
"couponmoney": "40.0",
"couponstarttime": "1523289600",
"couponendtime": "1523462399",
"couponexplain": "满89.0元可用",
"couponnum": "10000",
"couponsurplus": "8310",
"couponreceive": 1690,
"item_url": "http://s.click.taobao.com/t?e=m%3D2%26s%3D045cpkujpHRw4vFB6t2Z2ueEDrYVVa64K7Vc7tFgwiHLWlSKdGSYDldMN%2Foy6lKE8sviUM61dt04meEzW2axMX3J%2F35WPWCYfBm5hhYg0vVctuTBhoUmJlzD4g%2BlBXfoPPC9MS0G%2F3TNEPXytV9ALq8XLr9cF0l0AOJ7n9hIYuSUmgZvWjGCm%2FRVj1yieHrVodQTkT3IQPLnB5qWG8rGaQ%3D%3D&union_lens=lensId:0b0930de_0dd1_166282394c2_2ee7"
}]}