doubler / tiktok-open-api
TikTok Open API SDK
v0.0.1
2023-12-28 10:04 UTC
Requires
- ext-json: *
- doubler/open-api-sdk: ^1.0.4
README
Install
composer require doubler/tiktok-open-api
Basic
use Doubler\OpenApiSdk\Client;
use Doubler\TiktokOpenApi\Context;
use Doubler\TiktokOpenApi\Authorization\GetTokenRequestBuilder;
$client = new Client();
$context = new Context([
'service_id' => '',
'app_key' => '',
'app_secret' => '',
// default locale
'locale' => 'en-US',
'access_token' => '',
'refresh_token' => '',
'shop_cipher' => '',
]);
// get authorization uri.
echo $context->getAuthorizationUri();
// build request
$builder = new GetTokenRequestBuilder($context);
$builder->setAuthCode('authCode');
$request = $builder->getRequest();
// send request and get response.
$response = $client->send($request);
More
See ./examples
Rename common.php.local
to common.php
.
php examples/GetCategories.php