secretKey = "secr">
时间:2021-07-01 10:21:17 帮助过:20人阅读
访问这个文件 url.php?goods=14535976817 通过商品id获取对应淘宝客链接,空白,好像没获取数据
require_once('lib/taobao/TopSdk.php');
$pid = pid;
$c = new TopClient;
$c->appkey = "appkey";
$c->secretKey = "secretKey";
if(isset($_GET['goods']) && is_numeric($_GET['goods']))
{
$req = new TaobaokeItemsConvertRequest;
$req->setFields("click_url,num_iid");
$req->setPid($pid);
$req->setNumIids($_GET['goods']);
$resp = $c->execute($req);
if(isset($resp->taobaoke_items->taobaoke_item->click_url))
{
$url = $resp->taobaoke_items->taobaoke_item->click_url;
}
}
if(!empty($url))
{
?>
}