npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

tiktok-business-api-sdk-official

v1.0.1

Published

Comprehensive_collection_of_client_libraries_that_enable_our_developers_to_build_software_to_integrate_with_Business_API_faster_and_in_a_more_standardized_way_

Downloads

432

Readme

TikTok Business API SDK - Javascript

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 SDK is automatically generated by the Swagger Codegen project:

  • API version: 0.1.1 Beta (in Beta Test)

Installation

Download the TikTok Business API SDK

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

Install js-sdk dependencies

 cd your_path/tiktok-business-api-sdk/js_sdk
 npm install

In your project, run the following command

 npm install your_path/tiktok-business-api-sdk/js_sdk --save

In your project, add the following code in package.json to set js_sdk as module

 {
  ...
    "type": "module",
  ...
 }

Getting Started

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

var js_sdk = require('business_api_client');

var api = new js_sdk.AccountApi()
var Access_Token = "Access_Token_example"; // {String} Authorized access token. For details, see [Authentication](https://ads.tiktok.com/marketing_api/docs?id=1738373164380162).
var opts = { 
  'body': new js_sdk.AdvertiserUpdateBody() // {AdvertiserUpdateBody} Advertiser update body parameters
};
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.advertiserUpdate(Access_Token, opts, callback);

Documentation for API Endpoints

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

Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- js_sdk.AccountApi | advertiserUpdate | POST /open_api/v1.3/advertiser/update/ | Update an ad account Advertiser Update js_sdk.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 js_sdk.AdApi | adGet | GET /open_api/v1.3/ad/get/ | Get the data of regular ads and ACO ads. Ad get js_sdk.AdApi | adStatusUpdate | POST /open_api/v1.3/ad/status/update/ | To enable, disable or delete an ad or ads Ad status update js_sdk.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 js_sdk.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 js_sdk.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 js_sdk.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 js_sdk.AdAcoApi | adAcoUpdate | POST /open_api/v1.3/ad/aco/update/ | Modify ACO ad creatives. Update ACO js_sdk.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 js_sdk.AdgroupApi | adgroupGet | GET /open_api/v1.3/adgroup/get/ | Obtain detailed information of an ad group or ad groups. Adgroup get js_sdk.AdgroupApi | adgroupStatusUpdate | POST /open_api/v1.3/adgroup/status/update/ | Enable, disable or delete an ad group. Adgroup status update js_sdk.AdgroupApi | adgroupUpdate | POST /open_api/v1.3/adgroup/update/ | Obtain detailed information of an ad group or ad groups. Adgroup update js_sdk.AudienceApi | dmpCustomAudienceList | GET /open_api/v1.3/dmp/custom_audience/list/ | Get all audiences DMP cusom audience list js_sdk.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 js_sdk.AuthenticationApi | oauth2AdvertiserGet | GET /open_api/v1.3/oauth2/advertiser/get/ | Obtain a list of advertiser accounts that authorized an app. Advertiser Get js_sdk.BCApi | bcAdvertiserCreate | POST /open_api/v1.3/bc/advertiser/create/ | Create an ad account BC advertiser create js_sdk.BCApi | bcAssetGet | GET /open_api/v1.3/bc/asset/get/ | Get assets BC asset get js_sdk.BCApi | bcGet | GET /open_api/v1.3/bc/get/ | Get Business Centers BC get js_sdk.BCApi | bcImageUpload | POST /open_api/v1.3/bc/image/upload/ | Upload a business certificate BC image upload js_sdk.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 js_sdk.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 js_sdk.BcPaymentApi | bcBalanceGet | GET /open_api/v1.3/bc/balance/get/ | Obtain the balance of a Business Center. Balance get js_sdk.BcPaymentApi | bcTransactionGet | GET /open_api/v1.3/bc/transaction/get/ | Get the transaction records of your Business Centers. Transaction get js_sdk.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 js_sdk.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 js_sdk.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 js_sdk.CampaignCreationApi | campaignStatusUpdate | POST /open_api/v1.3/campaign/status/update/ | Enable, disable or delete a campaign. Campaign status update js_sdk.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 js_sdk.CreativeAssetApi | creativePortfolioCreate | POST /open_api/v1.3/creative/portfolio/create/ | Create a portfolio Portfolio create js_sdk.EventCallbackApi | pixelBatch | POST /open_api/v1.3/pixel/batch/ | Pixel Track server-to-server batch api js_sdk.EventCallbackApi | pixelTrack | POST /open_api/v1.3/pixel/track/ | Pixel Track server-to-server api js_sdk.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 js_sdk.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 js_sdk.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. js_sdk.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. js_sdk.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 js_sdk.IdentityApi | identityCreate | POST /open_api/v1.3/identity/create/ | Create a customized user identity. Identity Create js_sdk.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 js_sdk.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 js_sdk.MeasurementApi | appList | GET /open_api/v1.3/app/list/ | Get the app list App list js_sdk.MeasurementApi | appOptimizationEvent | GET /open_api/v1.3/app/optimization_event/ | Get App Events App events js_sdk.RecommendToolApi | toolTargetingCategoryRecommend | POST /open_api/v1.3/tool/targeting_category/recommend/ | Get recommended interest and action categories Tool targeting category js_sdk.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 js_sdk.ToolApi | toolActionCategory | GET /open_api/v1.3/tool/action_category/ | Get action categories Tool action js_sdk.ToolApi | toolCarrier | GET /open_api/v1.3/tool/carrier/ | Get carriers Tool carrier js_sdk.ToolApi | toolDeviceModel | GET /open_api/v1.3/tool/device_model/ | Get device models Tool device model js_sdk.ToolApi | toolInterestCategory | GET /open_api/v1.3/tool/interest_category/ | Get interest categories Tool Interest category js_sdk.ToolApi | toolInterestKeywordRecommend | GET /open_api/v1.3/tool/interest_keyword/recommend/ | Get interest keywords Tool kyword recommend js_sdk.ToolApi | toolLanguage | GET /open_api/v1.3/tool/language/ | Get languages Tool Language js_sdk.ToolApi | toolRegion | GET /open_api/v1.3/tool/region/ | Get available locations Tool Region

Documentation for Models

Documentation for Authorization

All endpoints do not require authorization.