VI | EN
Message us on Messenger
Developer resources

Danh sách chiến dịch của tài khoản — Facebook API

Campaigns · 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.

Campaigns

GET/{version}/act_{account_id}/campaignsVia 360: GET https://partner.quantri360.com/v1/facebook/{version}/act_{account_id}/campaigns
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 chiến dịch của một tài khoản quảng cáo kèm trạng thái, mục tiêu, kiểu mua, chiến lược giá thầu, ngân sách (chiến dịch dùng ngân sách cấp chiến dịch), thời gian chạy. Dùng để liệt kê chiến dịch đang chạy / tạm dừng, lấy id chiến dịch cho insight hoặc để bật tắt, đổi ngân sách.

  • Đường dẫn có act_<id> nên 360 tự chọn token của đúng tài khoản — không cần platform_shop_id.
  • Lọc effective_status: ["DELETED"] bị từ chối: Meta trả error_subcode 1815001 "Yêu cầu đối tượng đã xóa không được hỗ trợ trong điểm cuối này".
  • Chiến dịch không có daily_budget / lifetime_budget = ngân sách nằm ở từng nhóm quảng cáo (đọc ở /act_{account_id}/adsets).
  • paging.next có thể mang phiên bản Graph khác bản bạn gọi (thấy v26.0 khi gọi v25.0) — chỉ lấy cursors.after.
  • Hạn mức Marketing API tính theo tài khoản quảng cáo; gọi dồn sẽ bị Meta trả code 17 / 80004 (User request limit reached) — chờ vài phút rồi gọi lại.

Request

Endpoint

GET https://partner.quantri360.com/v1/facebook/{version}/act_{account_id}/campaigns

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.0Phiên bản Graph API.
account_idpathstringYes5924809560908319Id tài khoản quảng cáo (số, không có act_). Phải là tài khoản brand đã nối, khác → 404.
fieldsquerystringYesid,name,status,effective_status,objective,buying_type,bid_strategy,daily_budget,lifetime_budget,start_time,stop_time,created_time,updated_timeTrường cần lấy, cách nhau dấu phẩy. Không gửi fields thì 360 trả 400; Meta mặc định chỉ trả id.
effective_statusquerystringNo["ACTIVE","PAUSED"]Lọc trạng thái thực tế — PHẢI là mảng JSON (gửi ACTIVE trần → lỗi param effective_status must be an array). Giá trị: ACTIVE · PAUSED · ARCHIVED · IN_PROCESS · WITH_ISSUES …
limitqueryintNo100Số chiến dịch mỗi trang (mặc định 25). Gọi thật limit=5000 vẫn được nhận; nên giữ ≤ 500 và ít trường để tránh lỗi quá tải dữ liệu.
afterquerystringNopaging.cursors.after của trang trước.

Pagination

Lặp khi phản hồi còn paging.next: gửi lại cùng tham số, thêm after = paging.cursors.after. Hết dữ liệu thì không còn paging.next.

Request examples

curl -s "https://partner.quantri360.com/v1/facebook/v25.0/act_5924809560908319/campaigns?fields=id%2Cname%2Cstatus%2Ceffective_status%2Cobjective%2Cdaily_budget%2Clifetime_budget%2Cstart_time%2Cstop_time&effective_status=%5B%22ACTIVE%22%2C%22PAUSED%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/campaigns",
    params={
        "fields": "id,name,status,effective_status,objective,daily_budget,lifetime_budget,start_time,stop_time",
        "effective_status": "[\"ACTIVE\",\"PAUSED\"]",
        "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/campaigns');
for (const [k, v] of Object.entries({"fields":"id,name,status,effective_status,objective,daily_budget,lifetime_budget,start_time,stop_time","effective_status":"[\"ACTIVE\",\"PAUSED\"]","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/campaigns' . '?' . http_build_query(['fields' => 'id,name,status,effective_status,objective,daily_budget,lifetime_budget,start_time,stop_time', 'effective_status' => '["ACTIVE","PAUSED"]', '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[]Chiến dịch, mới tạo trước; chỉ có các trường đã yêu cầu (trường không có giá trị thì vắng hẳn).
idstring120250025975490254Id chiến dịch.
namestring
statusstringACTIVETrạng thái người dùng đặt: ACTIVE · PAUSED · ARCHIVED · DELETED.
effective_statusstringACTIVETrạng thái thực tế (xét cả tài khoản, lịch chạy, duyệt): ACTIVE · PAUSED · ARCHIVED · IN_PROCESS · WITH_ISSUES …
objectivestringOUTCOME_ENGAGEMENTMục tiêu: OUTCOME_ENGAGEMENT · OUTCOME_SALES · OUTCOME_TRAFFIC · OUTCOME_LEADS · OUTCOME_AWARENESS · OUTCOME_APP_PROMOTION.
buying_typestringAUCTION
bid_strategystringLOWEST_COST_WITHOUT_CAPChỉ có khi ngân sách đặt ở cấp chiến dịch.
daily_budget / lifetime_budgetstring96050Ngân sách cấp chiến dịch, đơn vị nhỏ nhất của tiền tệ tài khoản (VND = đồng). VẮNG khi ngân sách đặt ở nhóm quảng cáo.
budget_remainingstring0
start_time / stop_timestring2026-09-23T15:09:57+0700ISO 8601 theo múi giờ tài khoản; `stop_time` vắng = chạy liên tục.
created_time / updated_timestring
pagingobject
cursorsobject`{before, after}`.
nextstringURL trang kế — `access_token` đã được 360 che thành `***`; gọi lại qua 360 bằng `after`.

Response sample

{
  "data": [
    {
      "id": "120250025975490254",
      "name": "Chiến dịch mẫu",
      "status": "ACTIVE",
      "effective_status": "ACTIVE",
      "configured_status": "ACTIVE",
      "objective": "OUTCOME_ENGAGEMENT",
      "buying_type": "AUCTION",
      "bid_strategy": "LOWEST_COST_WITHOUT_CAP",
      "daily_budget": "96050",
      "budget_remaining": "0",
      "special_ad_categories": [],
      "start_time": "2026-09-23T15:09:57+0700",
      "created_time": "2026-09-23T15:09:56+0700",
      "updated_time": "2026-10-28T10:20:37+0700"
    },
    {
      "id": "120249269087300254",
      "name": "Chiến dịch mẫu 2",
      "status": "ACTIVE",
      "effective_status": "ACTIVE",
      "configured_status": "ACTIVE",
      "objective": "OUTCOME_ENGAGEMENT",
      "buying_type": "AUCTION",
      "budget_remaining": "0",
      "special_ad_categories": [],
      "start_time": "2026-08-11T06:57:55+0700",
      "created_time": "2026-08-11T06:57:54+0700",
      "updated_time": "2026-08-11T06:57:54+0700"
    }
  ],
  "paging": {
    "cursors": {
      "before": "QVFIVHY4ZAzFQeVRK…",
      "after": "QVFIVEtpV1ZATay1i…"
    },
    "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