Skip to content

Latest commit

 

History

History
244 lines (208 loc) · 22.9 KB

README.md

File metadata and controls

244 lines (208 loc) · 22.9 KB

TikTok Business API SDK - Java

  • API version: 0.1.1 Beta (in Beta Test)

Comprehensive collection of client libraries that enable our developers to build software to integrate with Business API faster and in a more standardized way.

Automatically generated by the Swagger Codegen

Requirements

Building the API client library requires:

  1. Java 1.7+
  2. Maven/Gradle

Installation

To install the API client library to your local Maven repository, simply execute:

mvn clean install

To deploy it to a remote Maven repository instead, configure the settings of the repository and execute:

mvn clean deploy

Refer to the OSSRH Guide for more information.

Maven users

Add this dependency to your project's POM:

<dependency>
  <groupId>io.swagger</groupId>
  <artifactId>business_api_client</artifactId>
  <version>1.0.0</version>
  <scope>compile</scope>
</dependency>

Gradle users

Add this dependency to your project's build file:

compile "io.swagger:business_api_client:1.0.0"

Others

At first generate the JAR by executing:

mvn clean package

Then manually install the following JARs:

  • target/business_api_client-1.0.0.jar
  • target/lib/*.jar

Getting Started

Please follow the installation instruction and execute the following Java code:

import business_api.*;
import business_api.auth.*;
import business_api_client.*;
import io.swagger.client.api.AccountApi;

import java.io.File;
import java.util.*;

public class AccountApiExample {

    public static void main(String[] args) {
        
        AccountApi apiInstance = new AccountApi();
        String accessToken = "accessToken_example"; // String | Authorized access token. For details, see [Authentication](https://ads.tiktok.com/marketing_api/docs?id=1738373164380162).
        AdvertiserUpdateBody body = new AdvertiserUpdateBody(); // AdvertiserUpdateBody | Advertiser update body parameters
        try {
            Response result = apiInstance.advertiserUpdate(accessToken, body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountApi#advertiserUpdate");
            e.printStackTrace();
        }
    }
}

Documentation for API Endpoints

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

Class Method HTTP request Description
AccountApi advertiserUpdate POST /open_api/v1.3/advertiser/update/ Update an ad account Advertiser Update
AdApi adCreate POST /open_api/v1.3/ad/create/ Upload your ad creatives (pictures, videos, texts, call-to-action) and create an ad. For different placements, the creative formats and requirements are different. Upload your ad creatives according to the placement requirements. Each ad group can have up to 20 ads. See here to learn about how to create ads. Ad create
AdApi adGet GET /open_api/v1.3/ad/get/ Get the data of regular ads and ACO ads. Ad get
AdApi adStatusUpdate POST /open_api/v1.3/ad/status/update/ To enable, disable or delete an ad or ads Ad status update
AdApi adUpdate POST /open_api/v1.3/ad/update/ Modify your custom ad creatives such as call-to-action, ad name, text image and video material. To update ACO ads, use the /ad/aco/update/ endpoint. Ad update
AdAcoApi adAcoCreate POST /open_api/v1.3/ad/aco/create/ Create an ACO ad by uploading necessary ad creatives to the library. Ad Aco Create
AdAcoApi adAcoGet GET /open_api/v1.3/ad/aco/get/ Get creative materials for an ACO ad, including call-to-actions, texts, ad names, images, or video materials. Ad Aco Get
AdAcoApi adAcoMaterialStatusUpdate POST /open_api/v1.3/ad/aco/material_status/update/ Update the status of creative materials for an ACO ad, including ad texts, images, and video materials Update materials
AdAcoApi adAcoUpdate POST /open_api/v1.3/ad/aco/update/ Modify ACO ad creatives. Update ACO
AdgroupApi adgroupCreate POST /open_api/v1.3/adgroup/create/ Create an ad group. At the ad group level, you can configure placement, audience settings (see Ad Targeting), budget, schedules, as well as bidding and optimization options for ads. To learn about the procedure and the essential data fields to create an ad group, see Create an Ad Group. Ad Update
AdgroupApi adgroupGet GET /open_api/v1.3/adgroup/get/ Obtain detailed information of an ad group or ad groups. Adgroup get
AdgroupApi adgroupStatusUpdate POST /open_api/v1.3/adgroup/status/update/ Enable, disable or delete an ad group. Adgroup status update
AdgroupApi adgroupUpdate POST /open_api/v1.3/adgroup/update/ Obtain detailed information of an ad group or ad groups. Adgroup update
AudienceApi dmpCustomAudienceList GET /open_api/v1.3/dmp/custom_audience/list/ Get all audiences DMP cusom audience list
AuthenticationApi oauth2AccessToken POST /open_api/v1.3/oauth2/access_token/ Get access_token and refresh_token by auth_code. The creator access token is valid for 24 hours and the refresh token is valid for one year. Within one year you will need to refresh the access token with the refresh token on a daily basis. After one year you will need to ask the creator to reauthorize. Oauth2 Access Token
AuthenticationApi oauth2AdvertiserGet GET /open_api/v1.3/oauth2/advertiser/get/ Obtain a list of advertiser accounts that authorized an app. Advertiser Get
BcApi bcAdvertiserCreate POST /open_api/v1.3/bc/advertiser/create/ Create an ad account BC advertiser create
BcApi bcAssetGet GET /open_api/v1.3/bc/asset/get/ Get assets BC asset get
BcApi bcGet GET /open_api/v1.3/bc/get/ Get Business Centers BC get
BcApi bcImageUpload POST /open_api/v1.3/bc/image/upload/ Upload a business certificate BC image upload
BcPaymentApi advertiserBalanceGet GET /open_api/v1.3/advertiser/balance/get/ Obtain the balance of ad accounts in the Business Center. This function only returns the ad accounts that the Business Center has administrator permissions over. Advertiser balance get
BcPaymentApi advertiserTransactionGet GET /open_api/v1.3/advertiser/transaction/get/ Get the transaction records of ad accounts in the Business Center. This function only returns the transaction records of ad accounts that the Business Center has administrator rights over. Advertiser transaction Get
BcPaymentApi bcBalanceGet GET /open_api/v1.3/bc/balance/get/ Obtain the balance of a Business Center. Balance get
BcPaymentApi bcTransactionGet GET /open_api/v1.3/bc/transaction/get/ Get the transaction records of your Business Centers. Transaction get
BcPaymentApi bcTransfer POST /open_api/v1.3/bc/transfer/ Recharge money to or deduct money from an ad account in a Business Center. BC transfer
CampaignCreationApi campaignCreate POST /open_api/v1.3/campaign/create/ To create a campaign. To advertise on TikTok Ads, you need to create a campaign and set the Advertising objectives and budget. A regular campaign can contain one or more ad groups. Campaign Create
CampaignCreationApi campaignGet GET /open_api/v1.3/campaign/get/ Get all campaigns for an ad account. Optionally, you can use filters in your request to return only certain campaigns. Campaign get
CampaignCreationApi campaignStatusUpdate POST /open_api/v1.3/campaign/status/update/ Enable, disable or delete a campaign. Campaign status update
CampaignCreationApi campaignUpdate POST /open_api/v1.3/campaign/update/ To modify a campaign after it has been created. Information like campaign name, budget, and budget type can be updated. Campaign Update
CreativeAssetApi creativePortfolioCreate POST /open_api/v1.3/creative/portfolio/create/ Create a portfolio Portfolio create
EventCallbackApi pixelBatch POST /open_api/v1.3/pixel/batch/ Pixel Track server-to-server batch api
EventCallbackApi pixelTrack POST /open_api/v1.3/pixel/track/ Pixel Track server-to-server api
FileApi adImageInfo GET /open_api/v1.3/file/image/ad/info/ The function is used to obtain the information of images from the Asset Library. File image info
FileApi adImageUpload POST /open_api/v1.3/file/image/ad/upload/ The function is used to to upload pictures to the Asset Library and use the obtained image ID for creating ads. File image Upload
FileApi adVideoInfo GET /open_api/v1.3/file/video/ad/info/ The function is used to get the information about a list of videos File Video Ad Info from the Asset Library.
FileApi adVideoSearch GET /open_api/v1.3/file/video/ad/search/ The function is used to to search for video creatives in the Asset Library of an ad account. [File Video Search](to search for video creatives in the Asset Library of an ad account.) Library.
FileApi adVideoUpload POST /open_api/v1.3/file/video/ad/upload/ The function is used to upload a video to the Asset Library and use the obtained video ID for creating ads. File Video Upload
IdentityApi identityCreate POST /open_api/v1.3/identity/create/ Create a customized user identity. Identity Create
IdentityApi identityGet GET /open_api/v1.3/identity/get/ Get a list of identities under an ad account. You can filter results by identity type. Identity Get
IdentityApi identityVideoInfo GET /open_api/v1.3/identity/video/info/ Get the information about a TikTok post that you own, if your identity is AUTH_CODE, TT_USER or BC_AUTH_TT. Identity Video Info
MeasurementApi appList GET /open_api/v1.3/app/list/ Get the app list App list
MeasurementApi appOptimizationEvent GET /open_api/v1.3/app/optimization_event/ Get App Events App events
RecommendToolApi toolTargetingCategoryRecommend POST /open_api/v1.3/tool/targeting_category/recommend/ Get recommended interest and action categories Tool targeting category
ReportingApi reportIntegratedGet GET /open_api/v1.3/report/integrated/get/ Create a synchronous report task. This endpoint can currently return the reporting data of up to 10,000 advertisements. If your number of advertisements exceeds 10,000, please use campaign_ids / adgroup_ids / ad_ids as a filter to obtain the reporting data of all advertisements in batches. Additionally, with CHUNK mode on, up to 20,000 advertisements can be returned. If you use campaign_ids / adgroup_ids / ad_ids as a filter, you can pass in up to 100 IDs at a time. Reporting Get
ToolApi toolActionCategory GET /open_api/v1.3/tool/action_category/ Get action categories Tool action
ToolApi toolCarrier GET /open_api/v1.3/tool/carrier/ Get carriers Tool carrier
ToolApi toolDeviceModel GET /open_api/v1.3/tool/device_model/ Get device models Tool device model
ToolApi toolInterestCategory GET /open_api/v1.3/tool/interest_category/ Get interest categories Tool Interest category
ToolApi toolInterestKeywordRecommend GET /open_api/v1.3/tool/interest_keyword/recommend/ Get interest keywords Tool kyword recommend
ToolApi toolLanguage GET /open_api/v1.3/tool/language/ Get languages Tool Language
ToolApi toolRegion GET /open_api/v1.3/tool/region/ Get available locations Tool Region

Documentation for Models