VI | EN
Message us on Messenger
Developer resources

Publish a photo by URL — Facebook API

Create Page Photo · 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.

Create Page Photo

POST/{version}/{page_id}/photosVia 360: POST https://partner.quantri360.com/v1/facebook/{version}/{page_id}/photos
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.
Write endpoint — changes data on Facebook. The key must be created with "Allow write API calls" ticked, otherwise you get 403 write_not_allowed. Every call is logged.
Description

Đăng một ảnh lên Trang bằng URL ảnh công khai (Facebook tự tải về), kèm chú thích; hoặc tải ảnh lên ở trạng thái chưa đăng để ghép vào bài nhiều ảnh. ENDPOINT GHI.

  • Là API GHI — thay đổi dữ liệu thật trên Facebook (ảnh hiện công khai trên Trang khi published = true); key cần quyền ghi, mỗi lần gọi được 360 ghi nhật ký.
  • Chưa hỗ trợ tải tệp ảnh trực tiếp (multipart) qua 360 — chỉ nhận url.
  • URL ảnh phải truy cập công khai (Facebook tự tải về); tải không được thì Meta trả lỗi và không tạo ảnh.

Request

Endpoint

POST https://partner.quantri360.com/v1/facebook/{version}/{page_id}/photos

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.0
page_idpathstringYes109900000000001Id Trang đã nối.
urlbodystringYesexample.com/images/bst-thu-dong.jpgURL ảnh công khai đầy đủ (có http/https; JPG / PNG …) — Facebook phải tải được.
captionbodystringNoBST Thu Đông 2026Chú thích ảnh (thành nội dung bài).
publishedbodyboolNotruefalse = chỉ tải lên, chưa đăng — lấy id ghép vào attached_media của POST /{page_id}/feed.
scheduled_publish_timebodyintNoHẹn giờ (unix giây) — đi kèm published=false.

Request examples

curl -s -X POST "https://partner.quantri360.com/v1/facebook/v25.0/109900000000001/photos" \
  -H "Authorization: Bearer $KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com/images/bst-thu-dong.jpg","caption":"BST Thu Đông 2026"}'
Python
import requests

KEY = "q360_live_..."  # khóa API của brand
r = requests.post(
    "https://partner.quantri360.com/v1/facebook/v25.0/109900000000001/photos",
    params={},
    json={
        "url": "https://example.com/images/bst-thu-dong.jpg",
        "caption": "BST Thu Đông 2026"
    },
    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/109900000000001/photos');
for (const [k, v] of Object.entries({})) url.searchParams.set(k, typeof v === 'object' ? JSON.stringify(v) : String(v));
const r = await fetch(url, {
  method: 'POST',
  headers: { Authorization: `Bearer ${KEY}`, 'Content-Type': 'application/json' },
  body: JSON.stringify({"url":"https://example.com/images/bst-thu-dong.jpg","caption":"BST Thu Đông 2026"}),
});
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/109900000000001/photos' . '?' . http_build_query([]);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer ' . $key, 'Content-Type: application/json']);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"url":"https://example.com/images/bst-thu-dong.jpg","caption":"BST Thu Đông 2026"}');
$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
idstring1131000000000001Id ảnh.
post_idstring109900000000001_1131000000000002Id bài chứa ảnh — chỉ có khi đăng ngay.

Response sample

{
  "id": "1131000000000001",
  "post_id": "109900000000001_1131000000000002"
}

Get started

  1. Sign up for Partner
  2. Enable a data type of the Trang & Messenger group on the platform page
  3. Create an API key (tick the Facebook channel)
  4. Call it as in the examples above