Skip to main content

TikTok Business API SDK

Project description

TikTok Business API SDK - Python

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

This Python package is automatically generated by the Swagger Codegen project:

  • API version: 0.1.1

Requirements.

Python 2.7 and 3.4+

Installation & Usage

Please refer to the "Integration with Python SDK" section in the README.md under the root folder.

Getting Started

Please follow the installation procedure and then run the following:

from __future__ import print_function
import time
import business_api_client
from business_api_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = business_api_client.AccountApi(business_api_client.ApiClient(configuration))
access_token = 'access_token_example' # str | Authorized access token. For details, see [Authentication](https://ads.tiktok.com/marketing_api/docs?id=1738373164380162).
body = business_api_client.AdvertiserUpdateBody() # AdvertiserUpdateBody | Advertiser update body parameters (optional)

try:
    # Update an ad account [Advertiser Update](https://ads.tiktok.com/marketing_api/docs?id=1739939050770434)
    api_response = api_instance.advertiser_update(access_token, body=body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountApi->advertiser_update: %s\n" % e)

Documentation for API Endpoints

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

Class Method HTTP request Description
AccountApi advertiser_update POST /open_api/v1.3/advertiser/update/ Update an ad account Advertiser Update
AdApi ad_create 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 ad_get GET /open_api/v1.3/ad/get/ Get the data of regular ads and ACO ads. Ad get
AdApi ad_status_update POST /open_api/v1.3/ad/status/update/ To enable, disable or delete an ad or ads Ad status update
AdApi ad_update 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 ad_aco_create POST /open_api/v1.3/ad/aco/create/ Create an ACO ad by uploading necessary ad creatives to the library. Ad Aco Create
AdAcoApi ad_aco_get 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 ad_aco_material_status_update 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 ad_aco_update POST /open_api/v1.3/ad/aco/update/ Modify ACO ad creatives. Update ACO
AdgroupApi adgroup_create 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 adgroup_get GET /open_api/v1.3/adgroup/get/ Obtain detailed information of an ad group or ad groups. Adgroup get
AdgroupApi adgroup_status_update POST /open_api/v1.3/adgroup/status/update/ Enable, disable or delete an ad group. Adgroup status update
AdgroupApi adgroup_update POST /open_api/v1.3/adgroup/update/ Obtain detailed information of an ad group or ad groups. Adgroup update
AudienceApi dmp_custom_audience_list GET /open_api/v1.3/dmp/custom_audience/list/ Get all audiences DMP cusom audience list
AuthenticationApi oauth2_access_token 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 oauth2_advertiser_get GET /open_api/v1.3/oauth2/advertiser/get/ Obtain a list of advertiser accounts that authorized an app. Advertiser Get
BCApi bc_advertiser_create POST /open_api/v1.3/bc/advertiser/create/ Create an ad account BC advertiser create
BCApi bc_asset_get GET /open_api/v1.3/bc/asset/get/ Get assets BC asset get
BCApi bc_get GET /open_api/v1.3/bc/get/ Get Business Centers BC get
BCApi bc_image_upload POST /open_api/v1.3/bc/image/upload/ Upload a business certificate BC image upload
BcPaymentApi advertiser_balance_get 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 advertiser_transaction_get 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 bc_balance_get GET /open_api/v1.3/bc/balance/get/ Obtain the balance of a Business Center. Balance get
BcPaymentApi bc_transaction_get GET /open_api/v1.3/bc/transaction/get/ Get the transaction records of your Business Centers. Transaction get
BcPaymentApi bc_transfer POST /open_api/v1.3/bc/transfer/ Recharge money to or deduct money from an ad account in a Business Center. BC transfer
CampaignCreationApi campaign_create 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 campaign_get 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 campaign_status_update POST /open_api/v1.3/campaign/status/update/ Enable, disable or delete a campaign. Campaign status update
CampaignCreationApi campaign_update 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 creative_portfolio_create POST /open_api/v1.3/creative/portfolio/create/ Create a portfolio Portfolio create
EventCallbackApi pixel_batch POST /open_api/v1.3/pixel/batch/ Pixel Track server-to-server batch api
EventCallbackApi pixel_track POST /open_api/v1.3/pixel/track/ Pixel Track server-to-server api
FileApi ad_image_info 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 ad_image_upload 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 ad_video_info 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 ad_video_search 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 ad_video_upload 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 identity_create POST /open_api/v1.3/identity/create/ Create a customized user identity. Identity Create
IdentityApi identity_get 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 identity_video_info 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 app_list GET /open_api/v1.3/app/list/ Get the app list App list
MeasurementApi app_optimization_event GET /open_api/v1.3/app/optimization_event/ Get App Events App events
RecommendToolApi tool_targeting_category_recommend POST /open_api/v1.3/tool/targeting_category/recommend/ Get recommended interest and action categories Tool targeting category
ReportingApi report_integrated_get 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 tool_action_category GET /open_api/v1.3/tool/action_category/ Get action categories Tool action
ToolApi tool_carrier GET /open_api/v1.3/tool/carrier/ Get carriers Tool carrier
ToolApi tool_device_model GET /open_api/v1.3/tool/device_model/ Get device models Tool device model
ToolApi tool_interest_category GET /open_api/v1.3/tool/interest_category/ Get interest categories Tool Interest category
ToolApi tool_interest_keyword_recommend GET /open_api/v1.3/tool/interest_keyword/recommend/ Get interest keywords Tool kyword recommend
ToolApi tool_language GET /open_api/v1.3/tool/language/ Get languages Tool Language
ToolApi tool_region GET /open_api/v1.3/tool/region/ Get available locations Tool Region

Documentation For Models

Documentation For Authorization

All endpoints do not require authorization.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tiktok_business_api_sdk_official-1.0.1.tar.gz (158.6 kB view hashes)

Uploaded Source

Built Distribution

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page