VI | EN
Message us on Messenger
Developer resources

Get Spark Ad posts — TikTok Business API

Get Spark Ad posts · 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 Spark Ad posts

GET/tt_video/list/Via 360: GET https://partner.quantri360.com/v1/tiktok_business/tt_video/list/
Description

Use this endpoint to get a list of Spark Ads posts that have been authorized to an ad account.

Request

Endpoint

GET https://partner.quantri360.com/v1/tiktok_business/tt_video/list/

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
item_typesquerystring[]NoThe types of Spark Ads posts to filter. Enum values: - VIDEO: video post. - CAROUSEL: photo post. Default value: ["VIDEO", "CAROUSEL"].
keywordquerystringNoThe text or TikTok post ID as a keyword to search TikTok posts by. - If you want to search for TikTok posts based on text, provide a text string with a maximum length of 500 characters. This search type supports searching in multiple languages and fuzzy matches. Example: "summer". - If you want to search for TikTok posts based on item_id, provide a numeric string with a minimum length of 19 characters. This search type supports exact matches. Example: "1234567891234567891"
pagequerynumberNoThe current page number. The default value is 1. The value must be ≥ 1.
page_sizequerynumberNoThe page size. The default value: 20. The value must be in the range of 1-50.

Request examples

curl -s "https://partner.quantri360.com/v1/tiktok_business/tt_video/list/" \
  -H "Authorization: Bearer $KEY"
Python
import requests

KEY = "q360_live_..."  # khóa API của brand
r = requests.get(
    "https://partner.quantri360.com/v1/tiktok_business/tt_video/list/",
    params={},
    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/tt_video/list/');
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: 'GET',
  headers: { Authorization: `Bearer ${KEY}` },
});
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/tt_video/list/' . '?' . http_build_query([]);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer ' . $key]);
$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
messagestringResponse message. For details, see Appendix - Return Codes.
codenumberResponse code. For the complete list of response codes and descriptions, see Appendix - Return Codes.
dataobjectThe returned data.
listobject[]Information about the list of Spark Ads posts.
item_infoobjectInformation about the Spark Ads post.
auth_codestringThe authorization code for the Spark Ads post.
item_idstringThe ID of the Spark Ads post.
textstringThe description of the Spark Ads post.
statusstringItem status. For enum values, see Enumerations-TikTok Post Item Status.
item_typestringThe type of Spark Ads post. Enum values: - `VIDEO`: video post. - `CAROUSEL`: photo post.
carousel_infoobjectInformation about the photo post. Note: When `item_type` is `VIDEO`, the value of this field will be null.
image_infoobject[]Information about the images used in the photo post. The images are returned in the same order as they are shown in the photo post.
image_urlstringThe URL of the image. Validity period: 90 days.
image_heightintegerThe height of the image, measured in pixels.
image_widthintegerThe width of the image, measured in pixels.
music_infoobjectInformation about the music used in the photo post. Note: If the photo post is directly published in the TikTok App without music, the value of this field will be null.
music_urlstringThe URL of the music. Validity period: 90 days.
music_durationintegerThe duration of the music, in seconds.
anchor_listobject[]Information about anchors in the post (video).
idstringAnchor ID.
titlestringAnchor title.
statusstringAnchor status. Enum values: `CHECK_ING` (anchor review in progress), `CHECK_FAILED` (anchor review failed), `CHECK_SUCCESS` (anchor review successful).
product_regionsstring[]Regions where the ad can be deployed.
urlstringItem URL.
spu_idstringReturned only when the post contains a product anchor link The SPU ID of the product that the post is associated with.
spu_namestringReturned only when the post contains a product anchor link The name of the product that the post is associated with.
store_idstringReturned only when the post contains a product anchor link The ID of the TikTok Shop that the product belongs to.
video_infoobjectInformation about the video post. Note: - When `item_type` is `CAROUSEL`, the values for the parameters within the `video_info` object will be null. - When `item_type` is `VIDEO` and status is not `HESITATE_RECOMMEND`, `ONLY_AUTHOR_SEE`, or `ONLY_FRIEND_SEE`, there will be no data for parameters within the `video_info` object and the values for these parameters might be null, `0`, or `""` (empty string).
bit_rateintegerVideo bit rate, in bps.
durationfloatThe duration of the video, in seconds.
sizeintegerThe size of the video, in bytes.
heightintegerThe height of the video.
widthintegerThe width of the video.
poster_urlstringThe URL to the video poster. It is valid for an hour. When it expires, you need to call the endpoint again to get a new URL.
preview_urlstringThe preview URL for the video. It is valid for an hour. When it expires, you need to call the endpoint again to get a new URL. Note: Returns empty string `""` if the authorization expires or if the TikTok Post Item Status (value of `status` under `item_info`) is not `HESITATE_RECOMMEND` (Made public). For the enum values of TikTok Post Item Status, see Enumerations-TikTok Post Item Status.
signaturestringMD5 for the video file.
user_infoobjectInformation about the TikTok account.
tiktok_namestringThe user name of the TikTok account.
identity_idstringIdentity ID.
identity_typestringIdentity Type.
auth_infoobjectInformation about the authorization.
invite_start_timestringThe time when the authorization starts (UTC+0), in the format of 2017-01-01 00:00:00.
auth_start_timestringThe time when the authorization code becomes valid (UTC+0), in the format of 2017-01-01 00:00:00.
ad_auth_statusstringThe authorization status. For allowed values, see Enumeration-TikTok Post Authorization Status.
auth_end_timestringThe time when the authorization code expires (UTC+0), in the format of 2017-01-01 00:00:00.
page_infoobjectThe information about pagination.
pagenumberThe current page number.
page_sizenumberThe size of the page.
total_numbernumberThe total number of results.
total_pagenumberThe total number of pages.
request_idstringThe unique log ID of the request.

Response sample

HTTPS/1.1 200 OK
{
    "code": 0,
    "message": "OK",
    "request_id": "xxx",
    "data": {
        "page_info": {
            "total_page": 15,
            "total_number": 300,
            "page": 1,
            "page_size": 20
        },
        "list": [
            {
                "user_info": {
                    "tiktok_name": "{{tiktok_name}}",
                    "identity_id": "{{identity_id}}",
                    "identity_type": "AUTH_CODE"
                },
                "item_info": {
                    "anchor_list": [
                        {
                            "id": "{{id}}",
                            "status": "CHECK_FAILED",
                            "product_regions": [
                                "ID"
                            ],
                            "url": "",
                            "title": "{{title}}"
                        }
                    ],
                    "text": "{{text}}",
                    "status": "HESITATE_RECOMMEND",
                    "auth_code": "{{auth_code}",
                    "item_id": "{{item_id}}",
					"item_type": "VIDEO",
					"carousel_info": null
                },
                "auth_info": {
                    "auth_start_time": "2021-05-23 11:26:45",
                    "ad_auth_status": "AUTHORIZED",
                    "invite_start_time": "2021-05-23 11:28:02",
                    "auth_end_time": "2022-07-22 11:26:45"
                },
                "video_info": {
                    "duration": 8.081,
                    "preview_url": "{{preview_url}}",
                    "bit_rate": {{bit_rate}},
                    "height": {{height}},
                    "width": {{width}},
                    "signature": "{{signature}}",
                    "size": 2379969,
                    "poster_url": "{{poster_url}}"
                }
            },
            ...
           ]
}
(/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