Skip to content

promopult/tiktok-marketing-api

Repository files navigation

TikTok Marketing API PHP client library

/!\ WIP: Not ready for production.

Convenient wrapper for TikTok Marketing API.

Build Status Scrutinizer Code Quality Code Coverage

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