yumufeng / tbk-union-sdk
v2.0.6
2019-11-02 05:23 UTC
Requires
- php: >=7.0
- yumufeng/curl-swoole: ^1.0
README
淘宝联盟SDK
淘宝联盟SDK
PHP =>7.0
composer require yumufeng/tbk-union-sdk
如果是在swoole 扩展下使用,支持协程并发,需要在编译swoole扩展的时候开启,系统会自动判断是否采用swoole
./configure --enable-openssl
使用
<?php $config = [ 'appkey' => '', 'secretKey' => '', 'session' => '',//授权接口(sc类的接口)需要带上 'sandbox' => false, ]; $client = new \TaobaoUnionSdk\TbkFatory($config); $result = $client->tools->createTpwd([ 'text' => '【小树苗】儿童牙膏无氟可吞咽牙膏', 'url' => 'https://uland.taobao.com/coupon/edetail?e=O60EAyHyKIpt3vqbdXnGlivNjFRkusPB5djj77wlO1yRouJg2hy9lJ7clY2Hw1o40khhwrZzASf9g1RlPpGU2hmFTDIT3kLkWOGP4KauORrEQlnWllxAq7Da9SMviYqQfo0s4juXT4zk4UQqwowTnTclmaPT%2FN8Oi5zCOSkadsc%3D&af=1&pid=mm_29563340_122900348_29874650260', 'logo' => 'http://imgproxy.18cap.cn/imgextra/i3/1060894880/*o1*c*n01n8*p*b*g41lv5*jdeej6r_!!1060894880.jpg_400x400.jpg' ]); if ($result == false) { var_dump($client->getError()); } echo json_encode($result);
说明文档
支持
- 淘宝客私域参考:https://open.taobao.com/api.htm?docId=37988&docType=2&scopeId=14474
- 淘宝客API: https://open.taobao.com/api.htm?docId=24517&docType=2
License
MIT