Skip to content

lanrenbulan/tiktok-open-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TikTok Open API SDK

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

TikTok

https://partner.tiktokshop.com

About

TikTok Open API SDK

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages