VI | EN
Message us on Messenger
Developer resources

Get posts under an identity — TikTok Business API

Get posts under an identity · 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 posts under an identity

GET/identity/video/get/Via 360: GET https://partner.quantri360.com/v1/tiktok_business/identity/video/get/
Description

Use this endpoint to get all posts under an identity.

Request

Endpoint

GET https://partner.quantri360.com/v1/tiktok_business/identity/video/get/

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
identity_idquerystringYesIdentity ID.
identity_typequerystringYesIdentity type. Enum values: AUTH_CODE, TT_USER, BC_AUTH_TT. See Identities for details.
identity_authorized_bc_idquerystringNoID of the Business Center that a TikTok Account User in Business Center identity is associated with. Required when identity_type is BC_AUTH_TT.
item_typequerystringNoThe type of TikTok posts that you want to retrieve. Enum values: - VIDEO: video post. - CAROUSEL: photo post. Default value: VIDEO.
keywordquerystringNoValid only when identity_type is set to AUTH_CODE. Otherwise, an error will occur. The 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"
exclude_adsonlyquerybooleanNoWhether to exclude ads only posts from the results. Ads-only posts are those you publish from a TikTok account as ads, which remain hidden from the public on the account's profile page. Supported values: - false: To retrieve both organic and ads only posts. - true: To retrieve a maximum of 500 most recent organic posts. Default value: false.
cursorqueryintegerNoCursor for pagination.
countquerynumberNoNumber of TikTok posts you want to get. Value range: 1-20. If you specify a value greater than 20, this field will be ignored and a maximum of 20 TikTok posts associated with the identity will be returned.

Request examples

curl -s "https://partner.quantri360.com/v1/tiktok_business/identity/video/get/?identity_id=&identity_type=" \
  -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/identity/video/get/",
    params={
        "identity_id": "",
        "identity_type": ""
    },
    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/identity/video/get/');
for (const [k, v] of Object.entries({"identity_id":"","identity_type":""})) 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/identity/video/get/' . '?' . http_build_query(['identity_id' => '', 'identity_type' => '']);
$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
codenumberResponse code. For the complete list of response codes and descriptions, see Appendix - Return Codes.
messagestringResponse message. For details, see Appendix - Return Codes.
dataobjectReturned data.
cursorstringTimestamp cursor or cursor for pagination. - If `identity_type` is `TT_USER` or `BC_AUTH_TT` : - When `exclude_adsonly` is `false` in the request, `cursor` is the time value of the last item returned according to the current request. You need to use this cursor value in your subsequent request to get the next posts. - When `exclude_adsonly` is `true` in the request, `cursor` is the cursor for pagination. If `has_more` in the response is `true`, you need to use the returned `cursor` in the subsequent request to receive the next page of results. - If `identity_type` is `AUTH_CODE`, `cursor` is the cursor for pagination. If `has_more` in the response is `true`, you need to use the returned `cursor` in the subsequent request to receive the next page of results.
has_moreboolWhether more data is available.
video_listobject[]List of posts.
item_typestringThe type of TikTok post. Enum values: - `VIDEO`: video post. - `CAROUSEL`: photo post.
item_idstringTikTok post ID.
statusstringStatus of the TikTok post. Enum values: - `ITEM_STATUS_HESITATE_RECOMMEND`: visible to all. - `STATUS_ONLY_FRIEND_SEE`: visible to friends. - `ITEM_STATUS_ONLY_AUTHOR_SEE`: private.
textstringText for the TikTok post.
auth_infoobjectAuthorization Information.
ad_auth_statusstringAuthorization status.
auth_end_timestringTime when the authorization code is valid from (UTC+0), in the format of 2017-01-01 00:00:00.
auth_start_timestringTime when the authorization code is valid from (time zone: UTC+0), in the format of 2017-01-01 00:00:00.
invite_start_timestringThe time when the authorization starts (UTC+0), in the format of 2017-01-01 00:00:00.
anchor_listobjectInformation about anchors.
anchor_idstringAnchor ID.
titlestringAnchor title.
statusstringAnchor status. Enum values: `CHECK_ING`, `CHECK_FAILED`, `CHECK_SUCCESS`.
urlstringAnchor URL.
product_regionsstring[]Regions that the ad can be delivered to. This is a list of country or region codes. For example, `["DE"]`.
video_infoobjectInformation about the video post. Note: When `item_type` is `CAROUSEL`, the value of this field will be null.
bit_rateintegerBit rates, in bps.
durationfloatDuration of the video, in seconds.
sizeintegerVideo size, in bytes.
heightintegerVideo height.
widthintegerVideo width.
poster_urlstringURL to the video poster. The expiration time is included in the URL after the `x-expires` parameter, in the format of an Epoch/Unix timestamp in seconds. When it expires, you need to call this endpoint to get a new URL.
signaturestringMD5 for the video file.
urlstringVideo preview link. It is valid for an hour. When it expires, you need to call the endpoint again to get a new URL.
formatstringFormat of the video.
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_idstringImage ID.
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_idstringMusic ID.
music_urlstringThe URL of the music. Validity period: 90 days.
music_durationintegerThe duration of the music, in seconds.
request_idstringThe log id of the request, which uniquely identifies a request.

Response sample

HTTPS/1.1 200 OK
{
    "code": 0,
    "message": "OK",
    "request_id": "{{request_id}}",
    "data": {
        "cursor": "1780432720000",
        "has_more": true,
        "video_list": [
            {
                "anchor_list": null,
                "auth_info": null,
                "carousel_info": null,
                "item_id": "{{item_id}}",
                "item_type": "VIDEO",
                "status": "ITEM_STATUS_HESITATE_RECOMMEND",
                "text": "{{text}}",
                "video_info": {
                    "bit_rate": 15184988,
                    "duration": 13.8,
                    "format": "mp4",
                    "height": 1920,
                    "poster_url": "{{poster_url}}",
                    "signature": "{{signature}}",
                    "size": 26194106,
                    "url": "{{url}}",
                    "width": 1080
                }
            },
            {
                "anchor_list": null,
                "auth_info": null,
                "carousel_info": null,
                "item_id": "{{item_id}}",
                "item_type": "VIDEO",
                "status": "ITEM_STATUS_HESITATE_RECOMMEND",
                "text": "{{text}}",
                "video_info": {
                    "bit_rate": 990999,
                    "duration": 16,
                    "format": "mp4",
                    "height": 1280,
                    "poster_url": "{{poster_url}}",
                    "signature": "{{signature}}",
                    "size": 1981998,
                    "url": "{{url}}",
                    "width": 720
                }
            }
        ]
    }
}

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