yumufeng/tbk-union-sdk

v2.0.6 2019-11-02 05:23 UTC

This package is auto-updated.

Last update: 2024-12-19 14:48:20 UTC


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);

说明文档

支持

License

MIT