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
| Name | In | Type | Sample | Description |
|---|---|---|---|---|
| Authorization | header | header | Bearer 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_id | query | string | 7000000000000000001 | Tà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
| Name | In | Type | Required | Sample | Description |
|---|---|---|---|---|---|
| adgroup_id | body | string | Yes | Ad group ID | |
| param_type | body | string | No | How 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. | |
| language | body | string | No | Language。Enum values: EN,JA,RU,VI. This field is required when param_type = CUSTOMIZED. | |
| industry_id | body | string | No | Industry ID. For details, see Appendix - Industries. | |
| keywords | body | string[] | No | Keywords. This field is required when param_type = CUSTOMIZED. | |
| limit | body | number | No | The 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)
| Name | Type | Sample | Description |
|---|---|---|---|
| message | string | The response message. For example, see Appendix - Return Codes. | |
| code | number | The response code. For details, see Appendix-Return Codes. | |
| data | object | The returned data. | |
| generate_id | string | The ID of the generated text. | |
| industry_id | string | The ID of the industry that has been specified or estimated. | |
| language | string | The language that has been specified or estimated. Enum values: `EN`,`JA`,`RU`,`VI` . | |
| texts | string[] | The text that is automatically generated. | |
| request_id | string | The 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
- Sign up for Partner
- Enable a data type of the Ads (Marketing API) group on the platform page
- Create an API key (tick the TikTok Business channel)
- Call it as in the examples above