promopult / tiktok-marketing-api
https://ads.tiktok.com API PHP-wrapper
Installs: 3 135
Dependents: 0
Suggesters: 0
Security: 0
Stars: 8
Watchers: 4
Forks: 13
Open Issues: 0
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: Not ready for production.
Convenient wrapper for TikTok Marketing API.
Installation
$ composer require promopult/tiktok-marketing-api
or
"require": {
// ...
"promopult/tiktok-marketing-api": "*"
// ...
}
Usage
See examples folder.
$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 //)