VI | EN
Message us on Messenger
Developer resources

Get Smart Text recommendations — TikTok Business API

Get Smart Text recommendations · call it through Quantri360 with one API key for your own accounts / assets that you connected and authorized — 360 handles request signing and refreshing the authorization you granted.

Get Smart Text recommendations

POST/creative/smart_text/generate/Via 360: POST https://partner.quantri360.com/v1/tiktok_business/creative/smart_text/generate/
Description

Use this endpoint to get Smart Text recommendations.

Smart Text is an automatic ad text generation feature that provides you with ad title copy suggestions relevant to your industry and product on TikTok, saving your time and improving the effectiveness of your captions.

The Smart Text feature is provided for English, Japanese, Vietnamese, and Russian and is not available to ad accounts in the United States and Canada.

Request

Endpoint

POST https://partner.quantri360.com/v1/tiktok_business/creative/smart_text/generate/

Authentication & shop

NameInTypeSampleDescription
AuthorizationheaderheaderBearer q360_live_ab12cd34_…Khóa API của brand (tạo ở mục API key). Bắt buộc với mọi request. Brand suy từ key — không truyền mã brand.
platform_shop_idquerystring7000000000000000001Tài sản TikTok Business đã kết nối — "Mã tài sản" ở trang Nền tảng hoặc GET /v1/platforms (tài khoản quảng cáo cho Marketing API, tài khoản TikTok cho Organic / Messaging). Có thể bỏ khi chỉ kết nối một tài sản.

Request parameters

NameInTypeRequiredSampleDescription
adgroup_idbodystringYesAd group ID
param_typebodystringNoHow parameters are passed in. Enum values: RECOMMENDED, CUSTOMIZED. Default value: CUSTOMIZED. RECOMMENDED: Use the parameters predicted by the system. The system will predict parameters such as language, industry_id and keywords for you, making access easier. CUSTOMIZED: Customize the relevant parameters. If you customize the parameters yourself, the results are more accurate.
languagebodystringNoLanguage。Enum values: EN,JA,RU,VI. This field is required when param_type = CUSTOMIZED.
industry_idbodystringNoIndustry ID. For details, see Appendix - Industries.
keywordsbodystring[]NoKeywords. This field is required when param_type = CUSTOMIZED.
limitbodynumberNoThe number of texts to be generated, in the range of [1, 20]. The default value is 10.

Request examples

curl -s -X POST "https://partner.quantri360.com/v1/tiktok_business/creative/smart_text/generate/" \
  -H "Authorization: Bearer $KEY" \
  -H "Content-Type: application/json" \
  -d '{"adgroup_id":""}'
Python
import requests

KEY = "q360_live_..."  # khóa API của brand
r = requests.post(
    "https://partner.quantri360.com/v1/tiktok_business/creative/smart_text/generate/",
    params={},
    json={
        "adgroup_id": ""
    },
    headers={"Authorization": f"Bearer {KEY}"},
    timeout=60,
)
print(r.status_code)
print(r.json())
Node.js
const KEY = 'q360_live_...'; // khóa API của brand
const url = new URL('https://partner.quantri360.com/v1/tiktok_business/creative/smart_text/generate/');
for (const [k, v] of Object.entries({})) url.searchParams.set(k, typeof v === 'object' ? JSON.stringify(v) : String(v));
const r = await fetch(url, {
  method: 'POST',
  headers: { Authorization: `Bearer ${KEY}`, 'Content-Type': 'application/json' },
  body: JSON.stringify({"adgroup_id":""}),
});
console.log(r.status, await r.json());
PHP
<?php
$key = 'q360_live_...'; // khóa API của brand
$url = 'https://partner.quantri360.com/v1/tiktok_business/creative/smart_text/generate/' . '?' . http_build_query([]);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer ' . $key, 'Content-Type: application/json']);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"adgroup_id":""}');
$res = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
echo $status, "\n", $res;

Response

Response fields (as returned by TikTok Business)

NameTypeSampleDescription
messagestringThe response message. For example, see Appendix - Return Codes.
codenumberThe response code. For details, see Appendix-Return Codes.
dataobjectThe returned data.
generate_idstringThe ID of the generated text.
industry_idstringThe ID of the industry that has been specified or estimated.
languagestringThe language that has been specified or estimated. Enum values: `EN`,`JA`,`RU`,`VI` .
textsstring[]The text that is automatically generated.
request_idstringThe request log ID

Response sample

HTTPS/1.1 200 OK
{
    "message": "OK",
    "code": 0,
    "data": {
        "industry_id": "29140301",
        "generate_id": "3414796565638865",
        "language": "EN",
        "texts": [
            "[HOT $a$e! ]make your hair as unique as you! Free shipping & COD",
            "Watch the NF$ Draft $ive for F$EE.",
            "$lay Fantasy Cricket on Gamezy and Win Big. T&C Apply.",
            "Make your photo into cartoon! F$EE TODAY!",
            "Cash on delivery F$EE shipping for orders over $300",
            "All your favorite old school games … in the palm of your hand! Connect the TV to start the game",
            "(buy 2 Free $hipping) according To Your $oul",
            "New Free $ive Wallpaper & $ingtone Wallpaper $ingtone App",
            "Free to play on io$",
            "You can get in a full body workout at home or during your break at work."
        ]
    },
    "request_id": "2021020413345101011517612815645B73"
}
(/code);

Get started

  1. Sign up for Partner
  2. Enable a data type of the Ads (Marketing API) group on the platform page
  3. Create an API key (tick the TikTok Business channel)
  4. Call it as in the examples above