在http://open.taobao.com开放平台下载相应的最新的sdk,如你懂得php,就下载php的sdk,然后解压把top目录添加到自己的项目中。
新建一个index.php
- <?php
- include("top/TopClient.php");
- include("top/request/ItemGetRequest.php");
- $appKey = '自己的appKey'; //<SPAN style="COLOR: #000000">自己申请成为开发者,必须要经过实名认证</SPAN>
- $appSecret = '自己的appSecret';
- 沙箱默认的appkey:test ,appSecrect:test
- //实例化TopClient类
- $c = new TopClient();
- $c->appkey = $appKey;
- $c->secretKey = $appSecret;
- //实例化商品的Request类
- $req = new ItemGetRequest;
- $req->setFields("detail_url,num_iid,title,nick,type,cid,seller_cids,props,input_pids,input_str,desc");
- $req->setNumIid(1452115837);
- $resp = $c->execute($req);
- print_r($resp);
- ?>
<?php
include("top/TopClient.php");
include("top/request/ItemGetRequest.php");
$appKey = '自己的appKey'; //自己申请成为开发者,必须要经过实名认证
$appSecret = '自己的appSecret';
沙箱默认的appkey:test ,appSecrect:test
//实例化TopClient类
$c = new TopClient();
$c->appkey = $appKey;
$c->secretKey = $appSecret;
//实例化商品的Request类
$req = new ItemGetRequest;
$req->setFields("detail_url,num_iid,title,nick,type,cid,seller_cids,props,input_pids,input_str,desc");
$req->setNumIid(1452115837);
$resp = $c->execute($req);
print_r($resp);
?>