Owned Pages
GET/{version}/{business_id}/owned_pagesGọi qua 360: GET https://partner.quantri360.com/v1/facebook/{version}/{business_id}/owned_pages
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
Trang Facebook do doanh nghiệp sở hữu.
Request
Địa chỉ
GET https://partner.quantri360.com/v1/facebook/{version}/{business_id}/owned_pages
Xác thực & gian hàng
| Tên | Vị trí | Kiểu | Mẫu | Mô tả |
|---|---|---|---|---|
| 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. |
Tham số request
| Tên | Vị trí | Kiểu | Bắt buộc | Mẫu | Mô tả |
|---|---|---|---|---|---|
| version | path | string | Có | v25.0 | |
| business_id | path | string | Có | 189900000000001 | Id doanh nghiệp. |
| platform_shop_id | query | string | Có | act_549900000000001 | Tài khoản QC hoặc Trang đã nối thuộc doanh nghiệp này. |
| fields | query | string | Không | id,name,category,link,fan_count,verification_status | Trường của Trang (mặc định id, name). |
| summary | query | string | Không | total_count | Thêm summary.total_count = tổng số Trang. |
| limit | query | int | Không | 25 | |
| after | query | string | Không | paging.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/189900000000001/owned_pages?platform_shop_id=act_549900000000001&fields=id%2Cname%2Ccategory%2Cfan_count&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/189900000000001/owned_pages",
params={
"platform_shop_id": "act_549900000000001",
"fields": "id,name,category,fan_count",
"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/189900000000001/owned_pages');
for (const [k, v] of Object.entries({"platform_shop_id":"act_549900000000001","fields":"id,name,category,fan_count","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/189900000000001/owned_pages' . '?' . http_build_query(['platform_shop_id' => 'act_549900000000001', 'fields' => 'id,name,category,fan_count', '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ên | Kiểu | Mẫu | Mô tả |
|---|---|---|---|
| data | object[] | Trang. | |
| id | string | 559900000000001 | |
| name | string | Cửa hàng mẫu | |
| category | string | Cửa hàng quần áo | Danh mục Trang. |
| link | string | ||
| fan_count | int | 2500 | Số người thích Trang. |
| verification_status | string | not_verified | |
| paging | object | Chỉ có khi còn trang. | |
| summary | object | `{total_count}` khi gửi `summary=total_count`. |
Bắt đầu dùng
- Đăng ký tài khoản Partner
- Mở loại dữ liệu thuộc nhóm Doanh nghiệp (Business Manager) ở trang nền tảng
- Tạo API key (tick kênh Facebook)
- Gọi theo ví dụ ở trên