TikTok Business API SDK

repository·main·Indexed 42 days ago

https://github.com/tiktok/tiktok-business-api-sdk

Standardized client libraries for Java, Python, and JavaScript to integrate with the TikTok API for Business. Supports campaign management, reporting, authentication via OAuth2, and moderation through the CommentsApi. Includes comprehensive model classes for Ads, Campaigns, Ad Groups, Audiences, Catalogs, and Pixels, as well as Business Center (BC) operations via the BCApi.

Tokens
393K
Snippets
852
Records
1.1K
Agent score
51%

What's inside TikTok Business API SDK

  1. Overview of the TikTok Business API SDK

    main

    The TikTok Business API SDK is a suite of client libraries designed to help developers and partners integrate with the TikTok API for Business using a standardized approach. The SDK is being released in phases and currently provides interfaces for several key functional areas, including:

    • Authentication
    • Campaign Creation
    • Reporting
    • Business Center

    It supports multiple programming languages to streamline the integration process and enhance developer productivity.

  2. Overview of MeasurementApi methods

    main

    The MeasurementApi class in the JavaScript SDK provides methods to manage offline event sets and TikTok Pixels. All URIs are relative to https://business-api.tiktok.com.

    Offline Event Management

    • offlineCreate: Create a new Offline Event set.
    • offlineDelete: Delete an Offline Event set.
    • offlineGet: Get Offline Event sets.
    • offlineUpdate: Update an Offline Event set.

    Pixel Management

    • pixelCreate: Create a Pixel.
    • pixelEventCreate: Define events using industry or custom templates.
    • pixelEventDelete: Delete Pixel events.
    • pixelEventStats: View event data statistics over a period.
    • pixelEventUpdate: Update a Pixel event's name and conversion value.
    • pixelList: Obtain a list of Pixel information.
    • pixelUpdate: Update a Pixel.
  3. Overview of js_sdk.ToolApi methods

    main

    The ToolApi class provides access to various utility endpoints for the TikTok Business API. All URIs are relative to https://business-api.tiktok.com. Available methods include:

    MethodHTTP RequestDescription
    searchRegionGET /open_api/v1.3/search/region/Get available locations by advertiser ID
    toolActionCategoryGET /open_api/v1.3/tool/action_category/Get action categories
    toolBidRecommendPOST /open_api/v1.3/tool/bid/recommend/Get a suggested bid
    toolBrandSafetyPartnerAuthorizeStatusGET /open_api/v1.3/tool/brand_safety/partner/authorize/status/Get Brand Safety partner authorization status
    toolCarrierGET /open_api/v1.3/tool/carrier/Get carriers
    toolContextualTagGetGET /open_api/v1.3/tool/contextual_tag/get/Get available contextual tags
    toolContextualTagInfoGET /open_api/v1.3/tool/contextual_tag/info/Get details of contextual tags
    toolDeviceModelGET /open_api/v1.3/tool/device_model/Get device models
    toolDiagnosisSearchHealthGET /open_api/v1.3/tool/diagnosis/search/health/Get Search Ads Campaign Health diagnoses
    toolHashtagGetGET /open_api/v1.3/tool/hashtag/get/Get targeting hashtags by ID
    toolHashtagRecommendGET /open_api/v1.3/tool/hashtag/recommend/Search for targeting hashtags
    toolInterestCategoryGET /open_api/v1.3/tool/interest_category/Get interest categories
    toolInterestKeywordGetGET /open_api/v1.3/tool/interest_keyword/get/Get additional interest categories by ID
    toolInterestKeywordRecommendGET /open_api/v1.3/tool/interest_keyword/recommend/Get interest keywords
    toolLanguageGET /open_api/v1.3/tool/language/Get languages
    toolOpenUrlGET /open_api/v1.3/tool/open_url/Get a TikTok in-app link
    toolOsVersionGET /open_api/v1.3/tool/os_version/Get OS versions
    toolPhoneRegionCodeGET /open_api/v1.3/tool/phone_region_code/Get region calling codes and region codes for phone numbers
    toolRegionGET /open_api/v1.3/tool/region/Get available locations
    toolTargetingInfoPOST /open_api/v1.3/tool/targeting/info/Obtain details about location targeting tags by ID
    toolTargetingListGET /open_api/v1.3/tool/targeting/list/Get internet service providers
    toolTargetingSearchPOST /open_api/v1.3/tool/targeting/search/Search for location targeting tags
    toolTimezoneGET /open_api/v1.3/tool/timezone/Get time zones
    toolUrlValidateGET /open_api/v1.3/tool/url_validate/Get the verification results of a URL
    toolVboStatusGET /open_api/v1.3/tool/vbo_status/Check Value-Based Optimization eligibility
  4. Overview of js_sdk.AudienceApi

    main

    The AudienceApi class in the js_sdk provides methods to manage and interact with TikTok Business audiences, including custom audiences, saved audiences, and audience insights.

    Key capabilities include:

    • Audience Insights: Analyzing overlap between different audiences.
    • Custom Audience Management: Creating, updating, deleting, and sharing custom audiences via files, rules, or lookalikes.
    • Audience Application: Applying shared custom audiences and retrieving application logs.
    • Saved Audiences: Managing saved audience segments.

    All URIs are relative to https://business-api.tiktok.com.

  5. Overview of AdApi methods

    main

    The AdApi class in the Java SDK provides methods for managing ads and Smart Plus ads. All URIs are relative to https://business-api.tiktok.com.

    Standard Ad Management

    • adCreate: Create a new ad.
    • adGet: Retrieve ads.
    • adStatusUpdate: Update the status of an ad.
    • adUpdate: Update ad details.

    Smart Plus Ad Management

    • smartPlusAdAppeal: Submit an ad appeal.
    • smartPlusAdCreate: Create a new Smart Plus ad.
    • smartPlusAdGet: Retrieve Smart Plus ad details.
    • smartPlusAdMaterialStatusUpdate: Update ad material status.
    • smartPlusAdReviewInfo: Get ad review information.
    • smartPlusAdStatusUpdate: Update Smart Plus ad status.
    • smartPlusAdUpdate: Update a Smart Plus ad.
    • smartPlusMaterialReviewInfo: Get material review information.
  6. Explore TikTok Business API SDK JavaScript Models

    main

    The JavaScript SDK provides a comprehensive set of models (data structures) to interact with the TikTok Business API. These models represent the request bodies and response structures for various API endpoints, including campaigns, ad groups, ads, assets, advertisers, and pixels.

    Key categories of models include:

    • Ad & Campaign Management: AdCreateBody, CampaignCreateBody, AdgroupCreateBody, AdAcoBody.
    • Creative & Assets: CreativeportfoliocreatePortfolioContent, AssetGroupCreateBody, MaterialStatusUpdateBody.
    • Audience & Targeting: CustomAudienceCreateBody, LookalikeCreateBody, TargetingInfoBody.
    • Business Center (BC) & Advertiser: BcadvertisercreateCustomerInfo, AdvertiserCreateBody, BillingGroupCreateBody.
    • Pixel & Events: PixelCreateBody, PixeleventcreatePixelEvents, EventCreateBody.
    • SmartPlus Features: SmartPlusAdCreateBody, SmartPlusCampaignCreateBody.

    Detailed documentation for each specific model can be found in the docs/ directory of the js_sdk package.