VI | EN
Nhắn Messenger
Dành cho developer

Thử nghiệm A/B và đo hiệu quả (lift) của doanh nghiệp — API Facebook

Ad Studies · gọi qua Quantri360 bằng một API key cho chính tài khoản / tài sản bạn đã kết nối và ủy quyền — 360 lo việc ký request và làm mới phiên đăng nhập bạn đã cấp.

Ad Studies

GET/{version}/{business_id}/ad_studiesGọi qua 360: GET https://partner.quantri360.com/v1/facebook/{version}/{business_id}/ad_studies
Sắp mở. API này đã chạy thật qua 360 và đang được chốt giá — bạn có thể đọc tài liệu và chuẩn bị tích hợp trước.
Mô tả API

Thử nghiệm A/B (split test) và nghiên cứu đo hiệu quả (lift) của doanh nghiệp: tên, loại, thời gian, các nhóm thử và tỉ lệ chia.

  • Chỉ trả cấu hình thử nghiệm — kết quả (nhóm thắng, chỉ số) lấy qua báo cáo hiệu quả của chiến dịch / nhóm QC trong từng nhóm thử.
  • Chưa có thử nghiệm → {"data": []}.

Request

Địa chỉ

GET https://partner.quantri360.com/v1/facebook/{version}/{business_id}/ad_studies

Xác thực & gian hàng

TênVị tríKiểuMẫuMô tả
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.

Tham số request

TênVị tríKiểuBắt buộcMẫuMô tả
versionpathstringCóv25.0
business_idpathstringCó183780650684749Id doanh nghiệp.
platform_shop_idquerystringCóact_543733994517908Tài khoản QC hoặc Trang đã nối thuộc doanh nghiệp này.
fieldsquerystringKhôngid,name,type,description,start_time,end_time,created_time,updated_time,cells{id,name,treatment_percentage}Trường cần lấy (mặc định id, name, start_time, end_time).
limitqueryintKhông25
afterquerystringKhôngpaging.cursors.after của trang trước.

Phân trang

Lặp khi có paging.next: thêm after = paging.cursors.after.

Ví dụ request

curl -s "https://partner.quantri360.com/v1/facebook/v25.0/183780650684749/ad_studies?platform_shop_id=act_543733994517908&fields=id%2Cname%2Ctype%2Cstart_time%2Cend_time%2Ccells%7Bid%2Cname%2Ctreatment_percentage%7D&limit=25" \
  -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/183780650684749/ad_studies",
    params={
        "platform_shop_id": "act_543733994517908",
        "fields": "id,name,type,start_time,end_time,cells{id,name,treatment_percentage}",
        "limit": 25
    },
    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/183780650684749/ad_studies');
for (const [k, v] of Object.entries({"platform_shop_id":"act_543733994517908","fields":"id,name,type,start_time,end_time,cells{id,name,treatment_percentage}","limit":25})) 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/183780650684749/ad_studies' . '?' . http_build_query(['platform_shop_id' => 'act_543733994517908', 'fields' => 'id,name,type,start_time,end_time,cells{id,name,treatment_percentage}', 'limit' => 25]);
$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

Tham số phản hồi (nguyên của Facebook)

TênKiểuMẫuMô tả
dataobject[]Thử nghiệm.
idstring1859337651606632Id thử nghiệm.
namestringThử nghiệm đối tượng
typestringSPLIT_TEST_V2`SPLIT_TEST` / `SPLIT_TEST_V2` (A/B) · `LIFT` · `GEO_LIFT` …
descriptionstring
start_timestring2025-10-21T17:00:00+0000ISO 8601, UTC.
end_timestring2025-10-23T19:00:43+0000
created_timestring
updated_timestring
cellsobject`{data: [{id, name, treatment_percentage}]}` — các nhóm thử (Version A/B…) và % ngân sách / đối tượng chia cho mỗi nhóm.
pagingobjectChỉ có khi còn trang.

Bắt đầu dùng

  1. Đăng ký tài khoản Partner
  2. Mở loại dữ liệu thuộc nhóm Doanh nghiệp (Business Manager) ở trang nền tảng
  3. Tạo API key (tick kênh Facebook)
  4. Gọi theo ví dụ ở trên