Zalo — Bài viết
Tạo bài viết (Create article) — zalo.create_article
Create an OA article. Zalo processes it asynchronously and returns a token; pass it to verify_article to get the article ID.
| Tác động | Rủi ro | Cần duyệt | Idempotent | Scopes |
|---|---|---|---|---|
| WRITE | medium | có | không | — |
Input
| Field | Nhãn | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
type | Loại bài viết | any | có | Article type. One of: normal. |
title | Tiêu đề | string | có | Article title. |
author | Tác giả | string | có | Author name. |
cover | Ảnh bìa | object | có | Cover photo: cover_type 'photo', photo_url, status show/hide. |
cover.cover_type | any | có | One of: photo. | |
cover.photo_url | string | có | ||
cover.status | any | không | One of: show, hide. | |
description | Mô tả | string | có | Short summary shown in the feed. |
body | Nội dung | array of object | có | Ordered content blocks. |
body[].type | any | có | One of: text, image. | |
body[].content | string | không | Text of a text block. | |
body[].url | string | không | Image URL of an image block. | |
status | Trạng thái | any | không | Article visibility. One of: show, hide. |
comment | Bình luận | any | không | Whether comments are shown. One of: show, hide. |
Field thêm: bỏ qua.
Output
| Field | Nhãn | Kiểu | Mô tả |
|---|---|---|---|
data | Kết quả | object | Result of the request. |
data.token | string | Token of the asynchronous job. Pass it to verify_article to get the article ID. |
Kiểm tra bài viết (Verify article) — zalo.verify_article
Get the article ID of a created article from its token. Error -214 means it is still processing.
| Tác động | Rủi ro | Cần duyệt | Idempotent | Scopes |
|---|---|---|---|---|
| NONE | low | không | có | — |
Input
| Field | Nhãn | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
token | Mã token | string | có | Token from create_article. |
Field thêm: bỏ qua.
Output
| Field | Nhãn | Kiểu | Mô tả |
|---|---|---|---|
data | Kết quả | object | The created or updated article. |
data.id | string | ID of the article. |
Cập nhật bài viết (Update article) — zalo.update_article
Update an OA article. Zalo returns a token to verify, as for create_article.
| Tác động | Rủi ro | Cần duyệt | Idempotent | Scopes |
|---|---|---|---|---|
| WRITE | medium | có | không | — |
Input
| Field | Nhãn | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
id | Mã bài viết | string | có | Article ID. |
type | Loại bài viết | any | có | Article type. One of: normal. |
title | Tiêu đề | string | có | Article title. |
author | Tác giả | string | có | Author name. |
cover | Ảnh bìa | object | có | Cover photo: cover_type 'photo', photo_url, status show/hide. |
cover.cover_type | any | có | One of: photo. | |
cover.photo_url | string | có | ||
cover.status | any | không | One of: show, hide. | |
description | Mô tả | string | có | Short summary shown in the feed. |
body | Nội dung | array of object | có | Ordered content blocks. |
body[].type | any | có | One of: text, image. | |
body[].content | string | không | Text of a text block. | |
body[].url | string | không | Image URL of an image block. | |
status | Trạng thái | any | không | Article visibility. One of: show, hide. |
comment | Bình luận | any | không | Whether comments are shown. One of: show, hide. |
Field thêm: bỏ qua.
Output
| Field | Nhãn | Kiểu | Mô tả |
|---|---|---|---|
data | Kết quả | object | Result of the request. |
data.token | string | Token of the asynchronous job. Pass it to verify_article to get the article ID. |
Danh sách bài viết (List articles) — zalo.list_articles
List OA articles, newest first.
| Tác động | Rủi ro | Cần duyệt | Idempotent | Scopes |
|---|---|---|---|---|
| NONE | low | không | có | — |
Input
| Field | Nhãn | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
offset | Vị trí bắt đầu | integer | có | Min 0. |
limit | Số lượng | integer | có | Min 1. Max 100. |
type | Loại bài viết | any | có | One of: normal, video. |
Field thêm: bỏ qua.
Output
| Field | Nhãn | Kiểu | Mô tả |
|---|---|---|---|
data | Kết quả | object | A page of articles. |
data.medias | array of object | Articles on this page. Fields of video items are not documented. | |
data.medias[].id | string | ID of the article. | |
data.medias[].type | string | normal or video. | |
data.medias[].title | string | Title. | |
data.medias[].status | string | show or hide. | |
data.medias[].total_view | integer | Number of views. | |
data.medias[].total_share | integer | Number of shares. | |
data.medias[].create_date | integer | Creation time, Unix timestamp in milliseconds. | |
data.medias[].update_date | integer | Last update time, Unix timestamp in milliseconds. | |
data.medias[].thumb | string | URL of the thumbnail. | |
data.medias[].link_view | string | URL to view the article. | |
data.total | integer | Total number of articles of this type. |
Chi tiết bài viết (Get article) — zalo.get_article
Get the detail of one OA article.
| Tác động | Rủi ro | Cần duyệt | Idempotent | Scopes |
|---|---|---|---|---|
| NONE | low | không | có | — |
Input
| Field | Nhãn | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
id | Mã bài viết | string | có | Article ID. |
Field thêm: bỏ qua.
Output
| Field | Nhãn | Kiểu | Mô tả |
|---|---|---|---|
data | Kết quả | object | The article. A normal article returns the content fields; a video article returns the upload fields. The reference has examples only, no field table. |
data.id | string | ID of the article. Normal articles only. | |
data.type | string | Article type, normal. Normal articles only. | |
data.title | string | Title. Normal articles only. | |
data.author | string | Author name. Normal articles only. | |
data.cover | object | Cover. Normal articles only. | |
data.cover.cover_type | string | Cover type, e.g. photo. | |
data.cover.photo_url | string | URL of the cover photo. | |
data.cover.status | string | show or hide. | |
data.description | string | Summary. Normal articles only. | |
data.status | string | show or hide for a normal article; for a video article, the numeric upload status (1 in the example for a finished upload). | |
data.body | array of object | Content blocks. Normal articles only. | |
data.body[].type | string | Block type, e.g. text. | |
data.body[].content | string | Text of a text block. | |
data.related_medias | array of object | Related articles. Normal articles only. | |
data.comment | string | Whether comments are shown, show or hide. Normal articles only. | |
data.cite | object | Source citation. Normal articles only. The reference spells the label key lablel. | |
data.cite.url | string | Source URL. | |
data.cite.lablel | string | Source label (spelled this way by Zalo). | |
data.status_message | string | Upload status text. Video articles only. | |
data.video_name | string | File name of the video. Video articles only. | |
data.video_size | integer | Size of the video in bytes. Video articles only. | |
data.convert_percent | integer | Conversion progress, 0 to 100. Video articles only. | |
data.convert_error_code | integer | Conversion error code, 0 when none. Video articles only. | |
data.video_id | string | ID of the video. Video articles only. |
Xóa bài viết (Remove article) — zalo.remove_article
Permanently remove an OA article.
| Tác động | Rủi ro | Cần duyệt | Idempotent | Scopes |
|---|---|---|---|---|
| WRITE | high | có | không | — |
Input
| Field | Nhãn | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
id | Mã bài viết | string | có | Article ID. |
Field thêm: bỏ qua.
Output
| Field | Nhãn | Kiểu | Mô tả |
|---|---|---|---|
data | Kết quả | object | Not returned: Zalo replies only error and message. |