VI | EN
Message us on Messenger
Developer resources

Danh sách nhóm quảng cáo của tài khoản — Facebook API

Ad Sets · 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.

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ùng GET /{version}/{campaign_id}/adsets.
  • effective_status phả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

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_idquerystringact_123456789 hoặc 1234567890Tà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

NameInTypeRequiredSampleDescription
versionpathstringYesv25.0
account_idpathstringYes5924809560908319Id tài khoản quảng cáo (số, không có act_).
fieldsquerystringYesid,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_timeTrường cần lấy. Trường con viết tên{con1,con2} (vd targeting{age_min,geo_locations}).
effective_statusquerystringNo["ACTIVE"]Mảng JSON lọc trạng thái thực tế (như chiến dịch).
limitqueryintNo100Số nhóm mỗi trang (mặc định 25).
afterquerystringNoCon 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)

NameTypeSampleDescription
dataobject[]Nhóm quảng cáo, mới tạo trước.
idstring120250637300010254
namestring
campaign_idstring120250025975490254Chiến dịch cha.
status / effective_statusstringACTIVENhư chiến dịch; nhóm ACTIVE nhưng chiến dịch PAUSED thì `effective_status` = `CAMPAIGN_PAUSED`.
daily_budget / lifetime_budgetstringNgâ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_goalstringPOST_ENGAGEMENTMục tiêu tối ưu: POST_ENGAGEMENT · CONVERSATIONS · OFFSITE_CONVERSIONS · LINK_CLICKS · REACH · THRUPLAY …
billing_eventstringIMPRESSIONSSự kiện tính phí.
destination_typestringON_POSTNơi chuyển đến: ON_POST · MESSENGER · WEBSITE …
targetingobjectNhắ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_timestring2026-10-29T09:42:29+0700Theo múi giờ tài khoản.
created_time / updated_timestring
pagingobject`{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

  1. Sign up for Partner
  2. Enable a data type of the Quảng cáo (Marketing API) group on the platform page
  3. Create an API key (tick the Facebook channel)
  4. Call it as in the examples above