资源介绍
拼多多授权 实例Demo
public String ddk_link(String pid,String GoodsId){
String type="pdd.ddk.goods.promotion.url.generate";
String url="http://gw-api.pinduoduo.com/api/router?";
//参数
String timestam=(new Date().getTime()/1000)+"";
String sign="";
TreeMap map=new TreeMap();
//商品
map.put("goods_id_list","["+GoodsId+"]");
map.put("type",type);
map.put("p_id",pid);
map.put("generate_short_url","true");
map.put("data_type","JSON");
map.put("timestamp",timestam);
sign = MD5_Sign.sign(map);
//type 值
url+="type="+type;
// 返回值类型
url+="&data_type=JSON";
//ClienmtID
url+="&client_id="+client_id;
//商品ID
url+="&goods_id_list=["+GoodsId+"]";
//推广位ID
url+="&p_id="+pid;
// 是否生成短链接,true-是,false-否
url+="&generate_short_url=true";
url+="×tamp="+timestam;
url+="&sign="+sign;
return loadJSON(url);
}