Heim >Backend-Entwicklung >PHP-Tutorial >通过商品ID获取api淘宝客链接不成功,空白
访问这个文件 url.php?goods=14535976817 通过商品id获取对应淘宝客链接,空白,好像没获取数据<?phprequire_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)){?><script type="text/javascript">location.href='<?php echo $url;?>';</script><?php}
ItemsConvert api已经切换成组件调用模式 具体的查官方的api文档.
按照官方代码样例都Missing method