Custom Audiences
GET/{version}/act_{account_id}/customaudiencesVia 360: GET https://partner.quantri360.com/v1/facebook/{version}/act_{account_id}/customaudiences
Coming soon. This API already runs in production through 360 and pricing is being finalised — you can read the docs and prepare your integration now.
Description
Đối tượng tùy chỉnh của tài khoản (tương tác Trang, khách truy cập web, danh sách khách hàng, đối tượng tương tự…): loại, quy mô ước tính, còn dùng được để chạy không, số ngày giữ. Dùng để rà tệp đối tượng, phát hiện tệp quá nhỏ / lỗi trước khi gắn vào nhóm quảng cáo.
- Đường dẫn có
act_<id>→ 360 tự chọn token tài khoản. descriptiontrongdelivery_status/operation_statustheo ngôn ngữ người ủy quyền — dùngcodeđể xử lý tự động.- Thời gian ở đây là unix giây, khác phần lớn API quảng cáo (ISO 8601).
Request
Endpoint
GET https://partner.quantri360.com/v1/facebook/{version}/act_{account_id}/customaudiences
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 | act_123456789 hoặc 1234567890 | Tài sản Facebook brand đã nối với 360: tài khoản quảng cáo (act_<id> hoặc <id>), Page id hoặc Pixel id — lấy ở GET /v1/platforms. Có thể bỏ khi đường dẫn đã chứa act_<id> / page id của brand. |
Request parameters
| Name | In | Type | Required | Sample | Description |
|---|---|---|---|---|---|
| version | path | string | Yes | v25.0 | |
| account_id | path | string | Yes | 5924809560908319 | Id tài khoản quảng cáo (số, không có act_). |
| fields | query | string | No | id,name,subtype,description,approximate_count_lower_bound,approximate_count_upper_bound,delivery_status,operation_status,retention_days,time_created,time_updated,data_source | Trường cần lấy. Không gửi = chỉ id. |
| filtering | query | string | No | [{"field":"subtype","operator":"EQUAL","value":"LOOKALIKE"}] | Mảng JSON bộ lọc {field, operator, value}. |
| pixel_id | query | string | No | Chỉ lấy đối tượng tạo từ pixel này. | |
| limit | query | int | No | 50 | Số đối tượng mỗi trang. |
| after | query | string | No | Con trỏ trang kế. |
Pagination
Lặp khi có paging.next: thêm after = paging.cursors.after.
Request examples
curl -s "https://partner.quantri360.com/v1/facebook/v25.0/act_5924809560908319/customaudiences?fields=id%2Cname%2Csubtype%2Capproximate_count_lower_bound%2Capproximate_count_upper_bound%2Cdelivery_status%2Coperation_status%2Cretention_days%2Ctime_created&limit=50" \ -H "Authorization: Bearer $KEY"
Python
import requests
KEY = "q360_live_..." # khóa API của brand
r = requests.get(
"https://partner.quantri360.com/v1/facebook/v25.0/act_5924809560908319/customaudiences",
params={
"fields": "id,name,subtype,approximate_count_lower_bound,approximate_count_upper_bound,delivery_status,operation_status,retention_days,time_created",
"limit": 50
},
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/facebook/v25.0/act_5924809560908319/customaudiences');
for (const [k, v] of Object.entries({"fields":"id,name,subtype,approximate_count_lower_bound,approximate_count_upper_bound,delivery_status,operation_status,retention_days,time_created","limit":50})) 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/facebook/v25.0/act_5924809560908319/customaudiences' . '?' . http_build_query(['fields' => 'id,name,subtype,approximate_count_lower_bound,approximate_count_upper_bound,delivery_status,operation_status,retention_days,time_created', 'limit' => 50]); $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 Facebook)
| Name | Type | Sample | Description |
|---|---|---|---|
| data | object[] | Đối tượng, mới tạo trước. | |
| id | string | 120250043666960623 | Id đối tượng — dùng trong `targeting.custom_audiences`. |
| name | string | ||
| subtype | string | ENGAGEMENT | Loại: `ENGAGEMENT` (tương tác) · `WEBSITE` · `CUSTOM` (danh sách khách) · `LOOKALIKE` (tương tự) · `VIDEO` … |
| approximate_count_lower_bound / approximate_count_upper_bound | int | 5600 / 6600 | Quy mô ước tính (khoảng). `-1` = chưa ước tính được (đối tượng tương tự, tệp lỗi) — KHÔNG có nghĩa là rỗng. |
| delivery_status | object | `{code, description}` — `200` dùng được; `300` quá nhỏ, không chạy được. | |
| operation_status | object | `{code, description}` — `200` bình thường; `433` tạo đối tượng tương tự thất bại; `450` lâu không dùng nên ngừng cập nhật… | |
| retention_days | int | 60 | Số ngày giữ người trong tệp (0 = không áp dụng). |
| time_created / time_updated | int | 1783398932 | Unix giây. |
| data_source | object | `{type, sub_type, creation_params}` — nguồn dữ liệu tạo tệp. | |
| paging | object | `{cursors: {before, after}, next}`. |
Response sample
{
"data": [
{
"id": "120250043666960623",
"name": "ib 60day 2 page",
"subtype": "ENGAGEMENT",
"description": "",
"approximate_count_lower_bound": 5600,
"approximate_count_upper_bound": 6600,
"delivery_status": {
"code": 200,
"description": "Đối tượng này đã được sử dụng."
},
"operation_status": {
"code": 450,
"description": "Đối tượng này không được dùng cho quảng cáo trong 30 ngày qua…"
},
"retention_days": 60,
"time_created": 1783398932,
"time_updated": 1783398932,
"data_source": {
"type": "EVENT_BASED",
"sub_type": "ENGAGEMENT_EVENTS",
"creation_params": "{\"prefill\":\"true\"}"
}
},
{
"id": "120217037932160041",
"name": "Đối tượng tương tự (VN, 2%)",
"subtype": "LOOKALIKE",
"approximate_count_lower_bound": -1,
"approximate_count_upper_bound": -1,
"delivery_status": {
"code": 300,
"description": "Quy mô đối tượng quá nhỏ nên không dùng để tạo chiến dịch được."
},
"operation_status": {
"code": 433,
"description": "Chúng tôi không thể tạo đối tượng tương tự của bạn…"
},
"retention_days": 0,
"time_created": 1741677635,
"time_updated": 1741677635,
"data_source": {
"type": "SEED_BASED",
"sub_type": "PLATFORM_USERS",
"creation_params": "[]"
}
}
],
"paging": {
"cursors": {
"before": "QVFIVGdjWDBX…",
"after": "QVFIVFZAKbFpH…"
}
}
}
Get started
- Sign up for Partner
- Enable a data type of the Quảng cáo (Marketing API) group on the platform page
- Create an API key (tick the Facebook channel)
- Call it as in the examples above