VI | EN
Message us on Messenger
Developer resources

Get info about a Spark Ad post — TikTok Business API

Get info about a Spark Ad post · 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 info about a Spark Ad post

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

Use this endpoint to get information about the Spark Ads post that you have been authorized to use as an ad. You need to pass in the authorization code from the post owner.

Request

Endpoint

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

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
auth_codequerystringYesThe authorization code for the Spark Ads post. Note: Replace "+" in your authorization code with "%2B". Otherwise, you may get an invalid authorization code error. For example, you can replace the "+" in the code "#XtjblzbEuOGK/BvHj4V/K0i71JL3Wu2fgRtOJrZSSf4SrPAedegtn+IH+UXr3f4=" and specify "#XtjblzbEuOGK/BvHj4V/K0i71JL3Wu2fgRtOJrZSSf4SrPAedegtn%2BIH%2BUXr3f4=".

Request examples

curl -s "https://partner.quantri360.com/v1/tiktok_business/tt_video/info/?auth_code=" \
  -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/info/",
    params={
        "auth_code": ""
    },
    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/info/');
for (const [k, v] of Object.entries({"auth_code":""})) 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/info/' . '?' . http_build_query(['auth_code' => '']);
$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
messagestringThe return message. For details, see Appendix - Return Codes.
codenumberThe return code. For the complete list of response codes and descriptions, see Appendix-Return Code.
dataobjectThe returned data.
auth_infoobjectInformation about the authorization.
auth_end_timestringThe time when the authorization code expires (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.
item_infoobjectInformation about the Spark Ads post.
auth_codestringThe authorization code for the Spark Ads post.
item_idstringThe ID of the Spark Ads post.
item_typestringThe type of Spark Ads post. Enum values: - `VIDEO`: video post. - `CAROUSEL`: photo post.
textstringThe description of the Spark Ads post.
statusstringThe status of the Spark Ads post. For enum values, see Enumerations-TikTok Post Item Status.
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.
stitch_original_item_idstringIf the post is a stitch from another post, the item ID of the original post.
duet_original_item_idstringIf the post is a duet from another post, the item ID of the original post.
is_multi_duet_stitchbooleanWhether this is a duet or stitch post that is created based on another duet or stitch post.
mentioned_item_idsstring[]If the post mentions another video, the item IDs of the original posts. Note: The post can only mention at most one video.
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.
user_infoobjectInformation about the TikTok account.
tiktok_namestringThe user name of the TikTok account.
identity_idstringIdentity ID.
identity_typestringIdentity Type.
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.
bit_rateintegerVideo bit rate, in bps.
durationfloatThe duration of the video, in seconds.
sizeintegerThe size of the video, in bytes.
widthintegerThe width of the video.
heightintegerThe height of the video.
video_idstringVideo ID.
file_namestringVideo name.
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.
signaturestringMD5 for the video.
request_idstringThe unique log ID for the request.

Response sample

HTTPS/1.1 200 OK
{
    "code": 0,
    "message": "OK",
    "request_id": "{{request_id}}",
    "data": {
        "auth_info": {
            "auth_start_time": "2022-07-08 07:32:45",
            "auth_end_time": "2022-08-07 07:32:44"
        },
        "video_info": {
            "file_name": "",
            "height": 1280,
            "size": 813340,
            "width": 720,
            "signature": "{{signature}}",
            "duration": 1.881,
            "preview_url": "{{preview_url}}",
            "poster_url": "{{poster_url}}",
            "bit_rate": {{bit_rate}},
            "video_id": "{{video_id}}"
        },
        "item_info": {
            "stitch_original_item_id": "0",
            "auth_code": "{{auth_code}}",
            "item_id": "{{item_id}}",
            "anchor_list": null,
            "text": "",
            "is_multi_duet_stitch": false,
            "duet_original_item_id": "0",
		    "carousel_info": null,
            "item_type": "VIDEO"
        },
        "user_info": {
            "identity_type": "AUTH_CODE",
            "tiktok_name": "{{tiktok_name}}",
            "identity_id": "{{identity_id}}"
        }
    }
}
(/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