1 Unstar Star 0 Fork 0

封尘 / taobaoapiPHPApache-2.0

Create your Gitee Account
Explore and code with more than 5 million developers,Free private repositories !:)
Sign up
淘宝开放平台api类库,更为简单的使用方式 spread retract

Clone or download
Cancel
Notice: Creating folder will generate an empty file .keep, because not support in Git
Loading...
README.md

淘宝开放平台API类库

php封装的淘宝api类库,简单好用,配合文档食用,不用再去记函数名以及参数

安装

直接下载源码或者使用 composer 安装

{
    "require": {
        "lovefc/taobaoapi": "0.0.1"
    }		
}

食用方法


$config = array(
    'client_id' => 'xx', //client_id
	'client_secret' => 'xxxx', //client_secret
	'backurl' => 'xxxxxx', //回调地址
	'data_type' => 'json', // 返回数据格式
	'taobao_token_file' => __DIR__ .'/taobao_token.txt'
);

// 必须要授权后使用
$taobao = new Taobao\Api($config);

$datas = array(
    // session的值如果提示要传,就要传,它本质上就是你授权获取的token
    'session' => $taobao->access_token,
    'simplify'=>'true',
    'fields' => 'tid,orders,receiver_name,receiver_state,receiver_address,receiver_mobile,receiver_phone,shop_pick,buyer_nick,receiver_town,o2o_shop_name'
);

// 这里使用的函数就是淘宝的api接口名
// 参考 https://open.taobao.com/api.htm?docId=46&docType=2
// 注意把api接口名中的点号换成下划线即可,传参请参考文档
$data = $taobao->taobao_trades_sold_get($datas);

$data = json_decode($data, true);

print_r($data);

交流讨论

QQ群号:474310505

avatar

Comments ( 0 )

Sign in for post a comment

PHP
1
https://gitee.com/lovefc/taobaoapi.git
git@gitee.com:lovefc/taobaoapi.git
lovefc
taobaoapi
taobaoapi
master

Search