PHP code example of rx-coder / toutiao-marketing-sdk
1. Go to this page and download the library: Download rx-coder/toutiao-marketing-sdk library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
rx-coder / toutiao-marketing-sdk example snippets
// 获取token, refresh_token
$auth = new ToutiaoSdk\ToutiaoAuth(APPID, SECRET);
print_r($auth->getAccessToken(AUTH_CODE));
// 刷新token
print_r($auth->refreshToken(REFRESH_TOKEN));
// 调用示例
$client = new ToutiaoSdk\TouTiaoClient(TOKEN);
$req = $client::AdvertisingDelivery()->campaignGet()->setAdvertiserId(ADVERTISER_ID)->send();
var_dump($req->getBody());