Ad Sets
GET/{version}/act_{account_id}/adsetsVia 360: GET https://partner.quantri360.com/v1/facebook/{version}/act_{account_id}/adsets
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
Danh sách nhóm quảng cáo của cả tài khoản: chiến dịch cha, trạng thái, ngân sách (khi đặt ở cấp nhóm), mục tiêu tối ưu, sự kiện tính phí, nơi chuyển đến, đối tượng nhắm (tuổi, giới tính, khu vực), lịch chạy. Dùng để rà toàn bộ nhóm đang chạy, đối chiếu nhắm mục tiêu, lấy id nhóm cho insight / bật tắt / đổi ngân sách.
- Đường dẫn có
act_<id>→ 360 tự chọn token tài khoản. Chỉ cần nhóm của MỘT chiến dịch thì dùngGET /{version}/{campaign_id}/adsets. effective_statusphải là mảng JSON (chuỗi["ACTIVE"]), không lọc được trạng thái DELETED.
Request
Endpoint
GET https://partner.quantri360.com/v1/facebook/{version}/act_{account_id}/adsets
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 | Yes | id,name,campaign_id,status,effective_status,daily_budget,lifetime_budget,optimization_goal,billing_event,bid_strategy,destination_type,targeting{age_min,age_max,genders,geo_locations},start_time,end_time | Trường cần lấy. Trường con viết tên{con1,con2} (vd targeting{age_min,geo_locations}). |
| effective_status | query | string | No | ["ACTIVE"] | Mảng JSON lọc trạng thái thực tế (như chiến dịch). |
| limit | query | int | No | 100 | Số nhóm mỗi trang (mặc định 25). |
| 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/adsets?fields=id%2Cname%2Ccampaign_id%2Cstatus%2Ceffective_status%2Cdaily_budget%2Coptimization_goal%2Cbilling_event%2Ctargeting%7Bage_min%2Cage_max%2Cgenders%2Cgeo_locations%7D%2Cstart_time&effective_status=%5B%22ACTIVE%22%5D&limit=100" \ -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/adsets",
params={
"fields": "id,name,campaign_id,status,effective_status,daily_budget,optimization_goal,billing_event,targeting{age_min,age_max,genders,geo_locations},start_time",
"effective_status": "[\"ACTIVE\"]",
"limit": 100
},
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/adsets');
for (const [k, v] of Object.entries({"fields":"id,name,campaign_id,status,effective_status,daily_budget,optimization_goal,billing_event,targeting{age_min,age_max,genders,geo_locations},start_time","effective_status":"[\"ACTIVE\"]","limit":100})) 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/adsets' . '?' . http_build_query(['fields' => 'id,name,campaign_id,status,effective_status,daily_budget,optimization_goal,billing_event,targeting{age_min,age_max,genders,geo_locations},start_time', 'effective_status' => '["ACTIVE"]', 'limit' => 100]);
$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[] | Nhóm quảng cáo, mới tạo trước. | |
| id | string | 120250637300010254 | |
| name | string | ||
| campaign_id | string | 120250025975490254 | Chiến dịch cha. |
| status / effective_status | string | ACTIVE | Như chiến dịch; nhóm ACTIVE nhưng chiến dịch PAUSED thì `effective_status` = `CAMPAIGN_PAUSED`. |
| daily_budget / lifetime_budget | string | Ngân sách cấp nhóm (đơn vị nhỏ nhất, VND = đồng); VẮNG khi chiến dịch giữ ngân sách. | |
| optimization_goal | string | POST_ENGAGEMENT | Mục tiêu tối ưu: POST_ENGAGEMENT · CONVERSATIONS · OFFSITE_CONVERSIONS · LINK_CLICKS · REACH · THRUPLAY … |
| billing_event | string | IMPRESSIONS | Sự kiện tính phí. |
| destination_type | string | ON_POST | Nơi chuyển đến: ON_POST · MESSENGER · WEBSITE … |
| targeting | object | Nhắm mục tiêu: `age_min`, `age_max`, `genders` (`1` nam · `2` nữ; vắng = tất cả), `geo_locations{countries, regions[{key,name,country}], cities, location_types}` … | |
| start_time / end_time | string | 2026-10-29T09:42:29+0700 | Theo múi giờ tài khoản. |
| created_time / updated_time | string | ||
| paging | object | `{cursors: {before, after}, next}` — `next` đã che token. |
Response sample
{
"data": [
{
"id": "120250637300010254",
"name": "Nhóm quảng cáo mẫu",
"campaign_id": "120250025975490254",
"status": "ACTIVE",
"effective_status": "ACTIVE",
"budget_remaining": "0",
"optimization_goal": "POST_ENGAGEMENT",
"billing_event": "IMPRESSIONS",
"destination_type": "ON_POST",
"targeting": {
"age_min": 26,
"age_max": 65,
"genders": [
2
],
"geo_locations": {
"regions": [
{
"key": "3983",
"name": "Hanoi",
"country": "VN"
}
],
"location_types": [
"home",
"recent"
]
}
},
"start_time": "2026-10-29T09:42:29+0700",
"created_time": "2026-10-29T09:42:29+0700",
"updated_time": "2026-10-29T09:42:46+0700"
}
],
"paging": {
"cursors": {
"before": "QVFIVEw2TFhTNWVC…",
"after": "QVFIVFFOaWk5akRR…"
},
"next": ""
}
}
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