Post Attachments
GET/{version}/{post_id}/attachmentsVia 360: GET https://partner.quantri360.com/v1/facebook/{version}/{post_id}/attachments
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
Phần đính kèm của bài viết: ảnh, album nhiều ảnh, video, link — loại, link xem, ảnh xem trước, id đối tượng đích. Dùng lấy ảnh / video của bài để hiển thị hoặc nối với sản phẩm.
- Không có phân trang ở cấp này; album dài dùng
subattachments.limit(N). - Link ảnh / video trong
mediahết hạn sau một thời gian.
Request
Endpoint
GET https://partner.quantri360.com/v1/facebook/{version}/{post_id}/attachments
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 | |
| post_id | path | string | Yes | 303881193849929_1128982042970549 | Id bài <page_id>_<post_id>. |
| fields | query | string | No | type,media_type,url,title,description,media,target,subattachments | Trường cần lấy. Không gửi = đủ trường mặc định. Album nhiều ảnh: subattachments.limit(N). |
Request examples
curl -s "https://partner.quantri360.com/v1/facebook/v25.0/303881193849929_1128982042970549/attachments?fields=type%2Cmedia_type%2Curl%2Cdescription%2Cmedia%2Ctarget" \ -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/303881193849929_1128982042970549/attachments",
params={
"fields": "type,media_type,url,description,media,target"
},
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/303881193849929_1128982042970549/attachments');
for (const [k, v] of Object.entries({"fields":"type,media_type,url,description,media,target"})) 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/303881193849929_1128982042970549/attachments' . '?' . http_build_query(['fields' => 'type,media_type,url,description,media,target']); $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ử. | |
| type | string | photo | `photo` · `album` · `video_inline` · `share` (link) · `native_templates` … |
| media_type | string | photo | `photo` · `video` · `link` · `album`. |
| url | string | Link xem trên Facebook. | |
| title / description | string | Tiêu đề / mô tả (description thường = nội dung bài). | |
| media | object | `{image: {src, width, height}}`; video thêm `source` (link tệp video, có hạn). | |
| target | object | `{id, url}` — id ảnh / video đích (dùng cho /comments, /video_insights). | |
| subattachments | object | Album: `{data: [ {type, media, target, url}, … ]}`. |
Response sample
{
"data": [
{
"type": "photo",
"media_type": "photo",
"url": "https://www.facebook.com/photo.php?fbid=1128981969637223&set=a.258026…&type=3",
"description": "NATURE INSPIRES | HÉ LỘ CẢM HỨNG MÙA ĐÔNG…",
"media": {
"image": {
"height": 898,
"src": "https://scontent.fsgn24-2.fna.fbcdn.net/v/t39.30808-6/…",
"width": 720
}
},
"target": {
"id": "1128981969637223",
"url": "https://www.facebook.com/photo.php?fbid=1128981969637223&set=a.258026…&type=3"
}
}
]
}
Get started
- Sign up for Partner
- Enable a data type of the Trang & Messenger group on the platform page
- Create an API key (tick the Facebook channel)
- Call it as in the examples above