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
| 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 |
|---|---|---|---|---|---|
| auth_code | query | string | Yes | The 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)
| Name | Type | Sample | Description |
|---|---|---|---|
| message | string | The return message. For details, see Appendix - Return Codes. | |
| code | number | The return code. For the complete list of response codes and descriptions, see Appendix-Return Code. | |
| data | object | The returned data. | |
| auth_info | object | Information about the authorization. | |
| auth_end_time | string | The time when the authorization code expires (UTC+0), in the format of 2017-01-01 00:00:00. | |
| auth_start_time | string | The time when the authorization code becomes valid (UTC+0), in the format of 2017-01-01 00:00:00. | |
| item_info | object | Information about the Spark Ads post. | |
| auth_code | string | The authorization code for the Spark Ads post. | |
| item_id | string | The ID of the Spark Ads post. | |
| item_type | string | The type of Spark Ads post. Enum values: - `VIDEO`: video post. - `CAROUSEL`: photo post. | |
| text | string | The description of the Spark Ads post. | |
| status | string | The status of the Spark Ads post. For enum values, see Enumerations-TikTok Post Item Status. | |
| carousel_info | object | Information about the photo post. Note: When `item_type` is `VIDEO`, the value of this field will be null. | |
| image_info | object[] | 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_url | string | The URL of the image. Validity period: 90 days. | |
| image_height | integer | The height of the image, measured in pixels. | |
| image_width | integer | The width of the image, measured in pixels. | |
| music_info | object | Information 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_url | string | The URL of the music. Validity period: 90 days. | |
| music_duration | integer | The duration of the music, in seconds. | |
| stitch_original_item_id | string | If the post is a stitch from another post, the item ID of the original post. | |
| duet_original_item_id | string | If the post is a duet from another post, the item ID of the original post. | |
| is_multi_duet_stitch | boolean | Whether this is a duet or stitch post that is created based on another duet or stitch post. | |
| mentioned_item_ids | string[] | If the post mentions another video, the item IDs of the original posts. Note: The post can only mention at most one video. | |
| anchor_list | object [] | Information about anchors in the post (video). | |
| id | string | Anchor ID. | |
| title | string | Anchor title. | |
| status | string | Anchor status. Enum values: `CHECK_ING` (anchor review in progress), `CHECK_FAILED` (anchor review failed), `CHECK_SUCCESS` (anchor review successful). | |
| product_regions | string[] | Regions where the ad can be deployed. | |
| url | string | Item URL. | |
| spu_id | string | Returned only when the post contains a product anchor link The SPU ID of the product that the post is associated with. | |
| spu_name | string | Returned only when the post contains a product anchor link The name of the product that the post is associated with. | |
| store_id | string | Returned only when the post contains a product anchor link The ID of the TikTok Shop that the product belongs to. | |
| user_info | object | Information about the TikTok account. | |
| tiktok_name | string | The user name of the TikTok account. | |
| identity_id | string | Identity ID. | |
| identity_type | string | Identity Type. | |
| video_info | object | Information about the video post. Note: When `item_type` is `CAROUSEL`, the values for the parameters within the `video_info` object will be null. | |
| bit_rate | integer | Video bit rate, in bps. | |
| duration | float | The duration of the video, in seconds. | |
| size | integer | The size of the video, in bytes. | |
| width | integer | The width of the video. | |
| height | integer | The height of the video. | |
| video_id | string | Video ID. | |
| file_name | string | Video name. | |
| poster_url | string | The 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_url | string | The 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. | |
| signature | string | MD5 for the video. | |
| request_id | string | The 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
- 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