Lấy chi tiết bài viết
GET/v2.0/article/getdetailGọi qua 360: GET https://partner.quantri360.com/v1/zalo/v2.0/article/getdetail
Mô tả API
Lấy chi tiết nội dung dạng bài viết, gồm lượt xem, chia sẻ, thích và bình luận.
- Cùng endpoint còn dùng cho: Lấy chi tiết nội dung dạng video — khác ở cấu trúc body (xem tài liệu Zalo từng loại).
Request
Địa chỉ
GET https://partner.quantri360.com/v1/zalo/v2.0/article/getdetail
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 | 1173478676788457425 | OA_ID của Zalo OA brand đã nối (GET /v1/platforms). Mỗi brand một OA — có thể bỏ. |
| data | query | string (JSON) | {"offset":0,"count":10} | Nhiều API GET của Zalo nhận tham số gói trong data là chuỗi JSON — gửi nguyên như tài liệu Zalo. |
Tham số request
| Tên | Vị trí | Kiểu | Bắt buộc | Mẫu | Mô tả |
|---|---|---|---|---|---|
| id | query | String | Có | Id của bài viết muốn lấy thông tin chi tiết |
Ví dụ request
curl -s "https://partner.quantri360.com/v1/zalo/v2.0/article/getdetail?id=" \ -H "Authorization: Bearer $KEY"
Python
import requests
KEY = "q360_live_..." # khóa API của brand
r = requests.get(
"https://partner.quantri360.com/v1/zalo/v2.0/article/getdetail",
params={
"id": ""
},
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/zalo/v2.0/article/getdetail');
for (const [k, v] of Object.entries({"id":""})) 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/zalo/v2.0/article/getdetail' . '?' . http_build_query(['id' => '']); $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 Zalo OA)
| Tên | Kiểu | Mẫu | Mô tả |
|---|---|---|---|
| error | int | 0 = thành công; khác 0 xem `message` (Zalo trả HTTP 200 kèm mã lỗi). | |
| message | string | Thông điệp của Zalo. | |
| data | object | ||
| id | string | 39c07ccbe78e0ed0579f | |
| type | string | normal | |
| title | string | Title | |
| author | string | ||
| cover | object | ||
| cover_type | string | photo | |
| photo_url | string | https://zalo-article-photo.zadn.vn/7ad578505104b85ae115#286621339 | |
| status | string | show | |
| description | string | Aaaaa | |
| status | string | show | |
| body | object[] | ||
| type | string | text | |
| content | string | Content | |
| related_medias | any[] | ||
| comment | string | show | |
| cite | object | ||
| url | string | ||
| lablel | string |
Mẫu phản hồi
{
"error": 0,
"message": "Success",
"data": {
"id": "39c07ccbe78e0ed0579f",
"type": "normal",
"title": "Title",
"author": "",
"cover": {
"cover_type": "photo",
"photo_url": "https://zalo-article-photo.zadn.vn/7ad578505104b85ae115#286621339",
"status": "show"
},
"description": "Aaaaa",
"status": "show",
"body": [
{
"type": "text",
"content": "Content"
}
],
"related_medias": [],
"comment": "show",
"cite": {
"url": "",
"lablel": ""
}
}
}
Bắt đầu dùng
- Đăng ký tài khoản Partner
- Mở loại dữ liệu thuộc nhóm Nội dung (bài viết) ở trang nền tảng
- Tạo API key (tick kênh Zalo OA)
- Gọi theo ví dụ ở trên