New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More

tiktok-business-api-sdk-official

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tiktok-business-api-sdk-official

Comprehensive_collection_of_client_libraries_that_enable_our_developers_to_build_software_to_integrate_with_Business_API_faster_and_in_a_more_standardized_way_

  • 1.0.5
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
126
decreased by-35.71%
Maintainers
1
Weekly downloads
 
Created

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.4

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

ClassMethodHTTP requestDescription
js_sdk.AccountApiadvertiserUpdatePOST /advertiser/update/Update an ad account Advertiser Update
js_sdk.AdApiadCreatePOST /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.AdApiadGetGET /ad/get/Get the data of regular ads and ACO ads. Ad get
js_sdk.AdApiadStatusUpdatePOST /ad/status/update/To enable, disable or delete an ad or ads Ad status update
js_sdk.AdApiadUpdatePOST /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.AdAcoApiadAcoCreatePOST /ad/aco/create/Create an ACO ad by uploading necessary ad creatives to the library. Ad Aco Create
js_sdk.AdAcoApiadAcoGetGET /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.AdAcoApiadAcoMaterialStatusUpdatePOST /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.AdAcoApiadAcoUpdatePOST /ad/aco/update/Modify ACO ad creatives. Update ACO
js_sdk.AdgroupApiadgroupCreatePOST /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.AdgroupApiadgroupGetGET /adgroup/get/Obtain detailed information of an ad group or ad groups. Adgroup get
js_sdk.AdgroupApiadgroupQuotaGET /adgroup/quota/Get the dynamic quota Adgroup Quota
js_sdk.AdgroupApiadgroupStatusUpdatePOST /adgroup/status/update/Enable, disable or delete an ad group. Adgroup status update
js_sdk.AdgroupApiadgroupUpdatePOST /adgroup/update/Obtain detailed information of an ad group or ad groups. Adgroup update
js_sdk.AudienceApidmpCustomAudienceApplyPOST /dmp/custom_audience/apply/Apply a shared custom audience Dmp Custom_audience Apply
js_sdk.AudienceApidmpCustomAudienceApplyLogGET /dmp/custom_audience/apply/log/Get the latest application log of custom audiences Dmp Custom_audience Apply Log
js_sdk.AudienceApidmpCustomAudienceCreatePOST /dmp/custom_audience/create/Create an audience by file Dmp Custom_audience Create
js_sdk.AudienceApidmpCustomAudienceDeletePOST /dmp/custom_audience/delete/Delete audiences Dmp Custom_audience Delete
js_sdk.AudienceApidmpCustomAudienceFileUploadPOST /dmp/custom_audience/file/upload/Upload a data file Dmp Custom_audience File Upload
js_sdk.AudienceApidmpCustomAudienceGetGET /dmp/custom_audience/get/Obtain the details of specified audiences Dmp Custom_audience Get
js_sdk.AudienceApidmpCustomAudienceListGET /dmp/custom_audience/list/Get all audiences Dmp Custom_audience List
js_sdk.AudienceApidmpCustomAudienceLookalikeCreatePOST /dmp/custom_audience/lookalike/create/Create a lookalike audience Dmp Custom_audience Lookalike Create
js_sdk.AudienceApidmpCustomAudienceLookalikeUpdatePOST /dmp/custom_audience/lookalike/update/Manually refresh a Lookalike Audience Dmp Custom_audience Lookalike Update
js_sdk.AudienceApidmpCustomAudienceRuleCreatePOST /dmp/custom_audience/rule/create/Create an audience by rules Dmp Custom_audience Rule Create
js_sdk.AudienceApidmpCustomAudienceSharePOST /dmp/custom_audience/share/Share custom audiences with other advertisers Dmp Custom_audience Share
js_sdk.AudienceApidmpCustomAudienceShareCancelPOST /dmp/custom_audience/share/cancel/Stop sharing custom audiences with other advertisers Dmp Custom_audience Share Cancel
js_sdk.AudienceApidmpCustomAudienceShareLogGET /dmp/custom_audience/share/log/Get the sharing log of a custom audience Dmp Custom_audience Share Log
js_sdk.AudienceApidmpCustomAudienceUpdatePOST /dmp/custom_audience/update/Update the details of an audience Dmp Custom_audience Update
js_sdk.AudienceApidmpSavedAudienceCreatePOST /dmp/saved_audience/create/Create a Saved Audience Dmp Saved_audience Create
js_sdk.AudienceApidmpSavedAudienceDeletePOST /dmp/saved_audience/delete/Delete Saved Audiences Dmp Saved_audience Delete
js_sdk.AudienceApidmpSavedAudienceListGET /dmp/saved_audience/list/Get the details of Saved Audiences Dmp Saved_audience List
js_sdk.AuthenticationApioauth2AccessTokenPOST /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.AuthenticationApioauth2AdvertiserGetGET /oauth2/advertiser/get/Get a list of advertisers that have granted you permission to manage their accounts. Authentication Oauth2 Advertiser Get
js_sdk.BCApiadvertiserBalanceGetGET /advertiser/balance/get/Get ad account balance and budget. BC Advertiser Balance Get
js_sdk.BCApiadvertiserTransactionGetGET /advertiser/transaction/get/Get transaction records of an ad account. BC Advertiser Transaction Get
js_sdk.BCApibcAccountTransactionGetGET /bc/account/transaction/get/Get the transaction records of a BC or ad accounts. BC Account Transaction Get
js_sdk.BCApibcAdvertiserCreatePOST /bc/advertiser/create/Create an ad account BC advertiser create
js_sdk.BCApibcAssetAdminDeletePOST /bc/asset/admin/delete/Delete assets. BC Asset Admin Delete
js_sdk.BCApibcAssetAdminGetGET /bc/asset/admin/get/Get assets of a Business Center as admins. BC Asset Admin Get
js_sdk.BCApibcAssetAssignPOST /bc/asset/assign/Assign assets to a user. BC Asset Assign
js_sdk.BCApibcAssetGetGET /bc/asset/get/Get assets of a Business Center. BC Asset Get
js_sdk.BCApibcAssetGroupCreatePOST /bc/asset_group/create/Create an Asset Group in your Business Center. BC Asset Group Create
js_sdk.BCApibcAssetGroupDeletePOST /bc/asset_group/delete/Remove members' access to an Asset Group. BC Asset Group Delete
js_sdk.BCApibcAssetGroupGetGET /bc/asset_group/get/Get the assets or members of an Asset Group in a Business Center. BC Asset Group Get
js_sdk.BCApibcAssetGroupListGET /bc/asset_group/list/Get all Asset Groups in your Business Center. BC Asset Group List
js_sdk.BCApibcAssetGroupUpdatePOST /bc/asset_group/update/Update assets, members or the name of an Asset Group. BC Asset Group Update
js_sdk.BCApibcAssetMemberGetGET /bc/asset/member/get/Get members by assets. BC Asset Member Get
js_sdk.BCApibcAssetPartnerGetGET /bc/asset/partner/get/Get partners by assets. BC Asset Partner Get
js_sdk.BCApibcAssetUnassignPOST /bc/asset/unassign/Revoke the access to an asset from a user. BC Asset Unassign
js_sdk.BCApibcBalanceGetGET /bc/balance/get/Get the balance of a Business Center. BC Balance Get
js_sdk.BCApibcBillingGroupCreatePOST /bc/billing_group/create/Create a billing group in a Business Center. BC Billing Group Create
js_sdk.BCApibcBillingGroupGetGET /bc/billing_group/get/Get all billing groups in a Business Center. BC Billing Group Get
js_sdk.BCApibcBillingGroupUpdatePOST /bc/billing_group/update/Update settings of a billing group. BC Billing Group Update
js_sdk.BCApibcGetGET /bc/get/Get Business Centers that you have access to. BC Get
js_sdk.BCApibcImageUploadPOST /bc/image/upload/Upload certificate images for an ad account. BC Image Upload
js_sdk.BCApibcMemberDeletePOST /bc/member/delete/Delete member. BC Member Delete
js_sdk.BCApibcMemberGetGET /bc/member/get/Get BC members. BC Member Get
js_sdk.BCApibcMemberInvitePOST /bc/member/invite/Invite members to BC. BC Member Invite
js_sdk.BCApibcMemberUpdatePOST /bc/member/update/Update member information. BC Member Update
js_sdk.BCApibcPartnerAddPOST /bc/partner/add/Add partner to Business Center. BC Partner Add
js_sdk.BCApibcPartnerAssetDeletePOST /bc/partner/asset/delete/Cancel asset sharing. BC Partner Asset Delete
js_sdk.BCApibcPartnerAssetGetGET /bc/partner/asset/get/Get partner assets. BC Partner Asset Get
js_sdk.BCApibcPartnerDeletePOST /bc/partner/delete/Delete partner. BC Partner Delete
js_sdk.BCApibcPartnerGetGET /bc/partner/get/Get partners. BC Partner Get
js_sdk.BCApibcPixelLinkGetGET /bc/pixel/link/get/Use this endpoint to get a list of ad accounts that have been linked to the request pixel. BC Pixel Link Get
js_sdk.BCApibcPixelLinkUpdatePOST /bc/pixel/link/update/Use this endpoint to link and unlink pixel to advertiser accounts. BC Pixel Link Update
js_sdk.BCApibcPixelTransferPOST /bc/pixel/transfer/Transfer Pixel from Advertiser to BC. BC Pixel Transfer
js_sdk.BCApibcTransactionGetGET /bc/transaction/get/Get translaction records of a Business Center. BC Transaction Get
js_sdk.BCApibcTransferPOST /bc/transfer/Process payments (recharge money to or deduct money from an ad account in a Business Center. BC Transfer
js_sdk.CampaignCreationApicampaignCreatePOST /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.CampaignCreationApicampaignGetGET /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.CampaignCreationApicampaignStatusUpdatePOST /campaign/status/update/Enable, disable or delete a campaign. Campaign status update
js_sdk.CampaignCreationApicampaignUpdatePOST /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.CatalogApicatalogAvailableCountryGetGET /catalog/available_country/get/Get the countries and regions that ads for a catalog can be delivered to. Catalog Available Country Get
js_sdk.CatalogApicatalogCapitalizePOST /catalog/capitalize/Migrate catalogs under your ad account to your Business Center. Catalog Capitalize
js_sdk.CatalogApicatalogCreatePOST /catalog/create/Create a catalog by specifying information such as name, targeted locations, and currency. Catalog Create
js_sdk.CatalogApicatalogDeletePOST /catalog/delete/Delete a catalog. Catalog Delete
js_sdk.CatalogApicatalogEventsourceBindPOST /catalog/eventsource/bind/Bind app or website event sources to a catalog in a Business Center. Catalog Eventsource Bind
js_sdk.CatalogApicatalogEventsourceBindGetGET /catalog/eventsource_bind/get/Get event source binding information. Catalog Eventsource Bind Get
js_sdk.CatalogApicatalogEventsourceUnbindPOST /catalog/eventsource/unbind/Unbind event sources from a catalog. Catalog Eventsource Unbind
js_sdk.CatalogApicatalogFeedDeletePOST /catalog/feed/delete/Delete a feed. Catalog Feed Delete
js_sdk.CatalogApicatalogFeedGetGET /catalog/feed/get/Get all feeds or a particular feed. Catalog Feed Get
js_sdk.CatalogApicatalogGetGET /catalog/get/Get all catalogs or a particular catalog. Catalog Get
js_sdk.CatalogApicatalogLexiconGetGET /catalog/lexicon/get/Get the lexicon for your catalog for use in ad texts. Catalog Lexicon Get
js_sdk.CatalogApicatalogLocationCurrencyGetGET /catalog/location_currency/get/Get supported locations and corresponding currencies for Catalog API. Catalog Location Currency Get
js_sdk.CatalogApicatalogOverviewGET /catalog/overview/Get the number of products in different audit statuses in a catalog. Catalog Overview
js_sdk.CatalogApicatalogProductDeletePOST /catalog/product/delete/Delete products in bulk. Catalog Product Delete
js_sdk.CatalogApicatalogProductFilePOST /catalog/product/file/Upload products via file URL. Catalog Product File
js_sdk.CatalogApicatalogSetProductGetGET /catalog/set/product/get/Get products in a product set. Catalog Set Product Get
js_sdk.CatalogApicatalogUpdatePOST /catalog/update/Use this endpoint to update the name of a catalog. The catalog must be under a Business Center. Catalog Update
js_sdk.CreativeAssetApicreativePortfolioCreatePOST /creative/portfolio/create/Create a portfolio Portfolio create
js_sdk.EventCallbackApipixelBatchPOST /pixel/batch/Pixel Track server-to-server batch api
js_sdk.EventCallbackApipixelTrackPOST /pixel/track/Pixel Track server-to-server api
js_sdk.FileApiadImageUploadPOST /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.FileApiadVideoInfoGET /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.FileApiadVideoSearchGET /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.FileApiadVideoUploadPOST /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.FileApifileImageAdInfoGET /file/image/ad/info/Get image information. File Image Info
js_sdk.IdentityApiidentityCreatePOST /identity/create/Create a customized user identity. Identity Create
js_sdk.IdentityApiidentityGetGET /identity/get/Get a list of identities under an ad account. You can filter results by identity type. Identity Get
js_sdk.IdentityApiidentityVideoInfoGET /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.MeasurementApiappListGET /app/list/Get the app list App list
js_sdk.MeasurementApiappOptimizationEventGET /app/optimization_event/Get App Events App events
js_sdk.RecommendToolApitoolTargetingCategoryRecommendPOST /tool/targeting_category/recommend/Get recommended interest and action categories Tool targeting category
js_sdk.ReportingApireportIntegratedGetGET /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.ToolApisearchRegionGET /search/region/Get available locations by advertiser ID Search Region
js_sdk.ToolApitoolActionCategoryGET /tool/action_category/Get action categories Tool action
js_sdk.ToolApitoolBidRecommendPOST /tool/bid/recommend/Get a suggested bid Tool Bid Recommend
js_sdk.ToolApitoolBrandSafetyPartnerAuthorizeStatusGET /tool/brand_safety/partner/authorize/status/Get the authorization status of a Brand Safety partner Tool Brand_safety Partner Authorize Status
js_sdk.ToolApitoolCarrierGET /tool/carrier/Get carriers Tool carrier
js_sdk.ToolApitoolContextualTagGetGET /tool/contextual_tag/get/Get available contextual tags Tool Contextual_tag Get
js_sdk.ToolApitoolContextualTagInfoGET /tool/contextual_tag/info/Get details of contextual tags Tool Contextual_tag Info
js_sdk.ToolApitoolDeviceModelGET /tool/device_model/Get device models Tool device model
js_sdk.ToolApitoolHashtagGetGET /tool/hashtag/get/Get targeting hashtags by ID Tool Hashtag Get
js_sdk.ToolApitoolHashtagRecommendGET /tool/hashtag/recommend/Search for targeting hashtags Tool Hashtag Recommend
js_sdk.ToolApitoolInterestCategoryGET /tool/interest_category/Get interest categories Tool Interest category
js_sdk.ToolApitoolInterestKeywordGetGET /tool/interest_keyword/get/Get additional interest categories by ID Tool Interest_keyword Get
js_sdk.ToolApitoolInterestKeywordRecommendGET /tool/interest_keyword/recommend/Get interest keywords Tool kyword recommend
js_sdk.ToolApitoolLanguageGET /tool/language/Get languages Tool Language
js_sdk.ToolApitoolOpenUrlGET /tool/open_url/Get a TikTok in-app link Tool Open_url
js_sdk.ToolApitoolOsVersionGET /tool/os_version/Get OS versions Tool Os_version
js_sdk.ToolApitoolPhoneRegionCodeGET /tool/phone_region_code/Get region calling codes and region codes for phone numbers Tool Phone_region_code
js_sdk.ToolApitoolRegionGET /tool/region/Get available locations Tool Region
js_sdk.ToolApitoolTargetingInfoPOST /tool/targeting/info/Obtain details about location targeting tags by ID Tool Targeting Info
js_sdk.ToolApitoolTargetingListGET /tool/targeting/list/Get internet service providers Tool Targeting List
js_sdk.ToolApitoolTargetingSearchPOST /tool/targeting/search/Search for location targeting tags Tool Targeting Search
js_sdk.ToolApitoolTimezoneGET /tool/timezone/Get time zones Tool Timezone
js_sdk.ToolApitoolUrlValidateGET /tool/url_validate/Get the verification results of a URL Tool Url_validate
js_sdk.ToolApitoolVboStatusGET /tool/vbo_status/Check Value-Based Optimization eligibility Tool Vbo_status

Documentation for Models

Documentation for Authorization

All endpoints do not require authorization.

FAQs

Package last updated on 15 Feb 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts