Ad Previews
GET/{version}/{ad_id}/previewsVia 360: GET https://partner.quantri360.com/v1/facebook/{version}/{ad_id}/previews
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
Xem trước một quảng cáo ở một vị trí hiển thị (bảng tin Facebook di động / máy tính, Instagram, Reels…): trả đoạn HTML <iframe> để nhúng vào trang của bạn. Dùng để duyệt nội dung quảng cáo trong báo cáo, gửi khách / quản lý xem trước mà không cần vào Trình quản lý quảng cáo.
- Gọi bằng token tài khoản quảng cáo: gửi
platform_shop_id=act_<id>khi brand có nhiều tài sản Facebook. - Thiếu
ad_format→ Meta trả(#100) For field 'previews': The parameter ad_format is required; giá trị lạ →ad_format must be one of the following values: …(liệt kê mọi vị trí hợp lệ). - Phản hồi là HTML để nhúng (
&đã được mã hóa sẵn) — chèn nguyênbodyvào trang; link iframe mang mã riêng của lần gọi, không dựng tay.
Request
Endpoint
GET https://partner.quantri360.com/v1/facebook/{version}/{ad_id}/previews
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 | |
| ad_id | path | string | Yes | 120250637300020254 | Id quảng cáo. |
| platform_shop_id | query | string | No | act_5924809560908319 | Tài khoản quảng cáo chứa quảng cáo, dạng act_<id>. BẮT BUỘC khi brand nối nhiều tài sản Facebook. |
| ad_format | query | string | Yes | MOBILE_FEED_STANDARD | Vị trí xem trước: MOBILE_FEED_STANDARD (bảng tin di động) · DESKTOP_FEED_STANDARD (bảng tin máy tính) · INSTAGRAM_STANDARD · FACEBOOK_REELS_MOBILE … Giá trị sai → Meta trả lỗi kèm danh sách đầy đủ. |
Request examples
curl -s "https://partner.quantri360.com/v1/facebook/v25.0/120250637300020254/previews?platform_shop_id=act_5924809560908319&ad_format=MOBILE_FEED_STANDARD" \ -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/120250637300020254/previews",
params={
"platform_shop_id": "act_5924809560908319",
"ad_format": "MOBILE_FEED_STANDARD"
},
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/120250637300020254/previews');
for (const [k, v] of Object.entries({"platform_shop_id":"act_5924809560908319","ad_format":"MOBILE_FEED_STANDARD"})) 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/120250637300020254/previews' . '?' . http_build_query(['platform_shop_id' => 'act_5924809560908319', 'ad_format' => 'MOBILE_FEED_STANDARD']); $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[] | Thường 1 phần tử. | |
| body | string | <iframe src="…/ads/api/preview_iframe.php?d=…&t=…" width="335" height="450" …></iframe> | HTML iframe xem trước; kích thước theo vị trí (gọi thật: di động 335×450, máy tính 540×690, Instagram 320×525). |
Response sample
{
"data": [
{
"body": "<iframe src=\"https://business.facebook.com/ads/api/preview_iframe.php?d=AQLJP9pLHi-3dwz8…&t=AQJ7H6fhxAzlH9a8NVg\" width=\"335\" height=\"450\" scrolling=\"yes\" style=\"border: none;\" allow=\"autoplay\"></iframe>"
}
]
}
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