promopult / tiktok-marketing-api
https://ads.tiktok.com API PHP包装器
v2.0.0
2023-06-21 07:47 UTC
Requires
- php: ^7.4|^8.0
- ext-json: *
- guzzlehttp/psr7: ^1.8.4|^2.4.0
- psr/http-client: ~1.0.1
- psr/http-message: ~1.0.1
Requires (Dev)
- guzzlehttp/guzzle: ~7.4.5
- phpunit/phpunit: ~9.3.8|~8.5.15
- squizlabs/php_codesniffer: ^3.6
- vimeo/psalm: ^4.15
README
/!\ WIP:尚未准备好用于生产。
为TikTok营销API提供便捷的包装器。
安装
$ composer require promopult/tiktok-marketing-api
或
"require": {
// ...
"promopult/tiktok-marketing-api": "*"
// ...
}
使用
查看示例文件夹。
$credentials = \Promopult\TikTokMarketingApi\Credentials::fromAccessToken( getenv('__ACCESS_TOKEN__') ); // Any PSR-18 HTTP-client $httpClient = new \GuzzleHttp\Client(); $client = new \Promopult\TikTokMarketingApi\Client( $credentials, $httpClient ); $response = $client->user->info(); print_r($response); //Array //( // [message] => OK // [code] => 0 // [data] => Array // ( // [create_time] => 1614175583 // [display_name] => my_user // [id] => xxx // [email] => xxx // ) // // [request_id] => xxx //)