VI | EN
Message us on Messenger
Developer resources

Get audience details — TikTok Business API

Get audience details · 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 audience details

GET/dmp/custom_audience/get/Via 360: GET https://partner.quantri360.com/v1/tiktok_business/dmp/custom_audience/get/
Description

Use this endpoint to obtain the details of specified audiences, such as current status and modification record. Details for both owned and shared audiences will be returned. You can use is_creator to check whether this advertiser is the owner of this audience.

> Note

A maximum of 100 audiences can be queried per request.

Request

Endpoint

GET https://partner.quantri360.com/v1/tiktok_business/dmp/custom_audience/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
custom_audience_idsquerystring[]YesA list of Audience IDs. Length range is [1, 100] .
history_sizequerynumberNoThe size of the history data which the user requests.

Request examples

curl -s "https://partner.quantri360.com/v1/tiktok_business/dmp/custom_audience/get/?custom_audience_ids=%5B%5D" \
  -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/dmp/custom_audience/get/",
    params={
        "custom_audience_ids": []
    },
    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/dmp/custom_audience/get/');
for (const [k, v] of Object.entries({"custom_audience_ids":[]})) 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/dmp/custom_audience/get/' . '?' . http_build_query(['custom_audience_ids' => '[]']);
$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.
listobject[]A list of audience details.
audience_detailsobjectAudience data.
audience_idstringAudience ID.
msgstringInformation about audience status.
audience_sub_typestringAudience sub type, indicating the type of ads that the audience can be used. Enum values: `NORMAL`: Normal audience. It can be used in non-R&F ads. `REACH_FREQUENCY`: Audience for Reach & Frequency. It can only be used in R&F ads.
error_msgstringError information when creating or modifying an audience.
is_validbooleanAudience availability. An audience becomes available after it has been processed. An audience becomes invalid after it is expired.
is_expiringbooleanWhether an audience is expiring. When an audience is expiring, it will expire in less than 60 days.
expired_timestringTime when the audience expires, in the format of "YYYY-MM-DD HH:MM:SS".
namestringAudience name.
rulestringIf this audience is an engagement audience, app activity audience or website traffic audience, this is the creation rule for it.
is_auto_refreshbooleanIf this audience is an engagement audience / app activity audience or website traffic audience, this indicates whether the audience refreshes daily.
sharedbooleanWhether this audience is shared with others. Enum values: `True`, `False`.
is_creatorbooleanWhether this advertiser is the owner of the audience. Enum values: `true`, `false`. You can use `shared` and `is_creator` to check audience ownership and shared status. The rules are as follows: 1. `shared` = `true` and `is_creator` = `true`: The advertiser is the owner and the audience is shared to others. 2. `shared` = `true` and `is_creator` = `false`: The advertiser is NOT the owner and the audience is shared by others. 3. `shared` = `false` and `is_creator` = `true`: The advertiser is the owner and the audience has not been shared to others.
owner_idstringAdvertiser ID of the audience creator. - If `is_creator`=`true`, `owner_id` will be `advertiser_id` that you specified in the request. - If `is_creator`=`false`, `owner_id` will be the ID of the advertiser that created the audience.
create_timestringTime when the audience was created, in the format of "YYYY-MM-DD HH:MM:SS".
typestringAudience type. Enum values: - `Customer File Audience` (Customer File Audience). - `Engagement Audience` (Engagement Audience). - `App Activity Audience` (App Activity Audience). - `Website Audience` (Website Traffic Audience). - `Lookalike Audience` (Lookalike Audience). - `Lead Generation `(Lead Generation Audience) - `Rule Business Account` (Business Account Audience) - `Rule ad shop` (Shop Activity Audience) - `Partner` (Partner Audience) - `Challenge` (Challenge Audience) - `Preferred Population` (Premium Audience)Note: Currently, Partner Audience, Challenge Audience and Premium Audience cannot be created through the API.
cover_numnumberTikTok coverage, or number of matched users on TikTok.
calculate_typestringEncryption type. For enum values, see Enumeration - Encryption Type.
lookalike_specobject[]Lookalike audience-specific information. Returned only when the audience is a lookalike audience.
source_audience_idstringSource (seed) audience ID.
include_sourcebooleanWhether to include the source audience in the new lookalike audience.
mobile_osstringDevice operating systems. Enum values support `ALL` for both `ANDROID` and `IOS`. See Enumeration-Audience Management-Lookalike System for details.
placementsstringThe apps where you want to deliver your ads. Enum values: `TikTok`, `TopBuzz & BuzzVideo`, `Pangle`. See Enumeration - Audience Management-Lookalike Placement for details.
location_idsstring[]IDs of the locations that you want to target. For enum values, see Enumeration-Lookalike Locations.
audience_sizestringSize of lookalike audience. Enum values: `NARROW`, `BALANCED` and `BROAD`.
audience_historyobject[]List of audience modification history.
actionstringModification made. To learn about the meaning of the values, see "Mapping between `action` value and operation via /dmp/custom_audience/update/" section below.
action_detailstringModification result.
editorstringOperator used. If modification was made through the TikTok API for Business, the value is "open_api".
msgstringIf the operation is partial success, the information will be shown here.
opt_timestringThe operation time. Formats such as:2019-04-14 06:52:56.
request_idstringThe log id of a request, which uniquely identifies the request.

Response sample

HTTPS/1.1 200 OK
{
    "code": 0,
    "message": "OK",
    "request_id": "123",
    "data": {
        "list": [
            {
                "audience_history": [
                    {
                        "msg": null,
                        "action_detail": "6489086",
                        "editor": "open_api",
                        "opt_time": "2022-05-26 14:12:12",
                        "action": "create"
                    }
                ],
                "audience_details": {
                    "audience_id": "123",
                    "is_expiring": false,
                    "is_auto_refresh": false,
                    "is_creator": true,
                    "expired_time": "2023-09-07 18:34:20",
                    "is_valid": true,
                    "shared": true,
                    "create_time": "2022-05-26 14:12:12",
                    "msg": null,
                    "error_msg": null,
                    "type": "Lookalike Audience",
                    "audience_sub_type": "NORMAL",
                    "calculate_type": null,
                    "cover_num": 6489086,
                    "name": "CUSTOM_AUDIENCE_NAME",
                    "rule": "{\"inclusions\": null, \"exclusions\": null}",
					"owner_id": "{{owner_id}}",
                     "lookalike_spec": null
                }
            }
        ]
    }
}
(/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