Skip to content

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 độngRủi roCần duyệtIdempotentScopes
WRITEmediumcókhông—

Input

FieldNhãnKiểuBắt buộcMô tả
typeLoại bài viếtanycóArticle type. One of: normal.
titleTiêu đềstringcóArticle title.
authorTác giảstringcóAuthor name.
coverẢnh bìaobjectcóCover photo: cover_type 'photo', photo_url, status show/hide.
cover.cover_typeanycóOne of: photo.
cover.photo_urlstringcó
cover.statusanykhôngOne of: show, hide.
descriptionMô tảstringcóShort summary shown in the feed.
bodyNội dungarray of objectcóOrdered content blocks.
body[].typeanycóOne of: text, image.
body[].contentstringkhôngText of a text block.
body[].urlstringkhôngImage URL of an image block.
statusTrạng tháianykhôngArticle visibility. One of: show, hide.
commentBình luậnanykhôngWhether comments are shown. One of: show, hide.

Field thêm: bỏ qua.

Output

FieldNhãnKiểuMô tả
dataKết quảobjectResult of the request.
data.tokenstringToken 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 độngRủi roCần duyệtIdempotentScopes
NONElowkhôngcó—

Input

FieldNhãnKiểuBắt buộcMô tả
tokenMã tokenstringcóToken from create_article.

Field thêm: bỏ qua.

Output

FieldNhãnKiểuMô tả
dataKết quảobjectThe created or updated article.
data.idstringID 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 độngRủi roCần duyệtIdempotentScopes
WRITEmediumcókhông—

Input

FieldNhãnKiểuBắt buộcMô tả
idMã bài viếtstringcóArticle ID.
typeLoại bài viếtanycóArticle type. One of: normal.
titleTiêu đềstringcóArticle title.
authorTác giảstringcóAuthor name.
coverẢnh bìaobjectcóCover photo: cover_type 'photo', photo_url, status show/hide.
cover.cover_typeanycóOne of: photo.
cover.photo_urlstringcó
cover.statusanykhôngOne of: show, hide.
descriptionMô tảstringcóShort summary shown in the feed.
bodyNội dungarray of objectcóOrdered content blocks.
body[].typeanycóOne of: text, image.
body[].contentstringkhôngText of a text block.
body[].urlstringkhôngImage URL of an image block.
statusTrạng tháianykhôngArticle visibility. One of: show, hide.
commentBình luậnanykhôngWhether comments are shown. One of: show, hide.

Field thêm: bỏ qua.

Output

FieldNhãnKiểuMô tả
dataKết quảobjectResult of the request.
data.tokenstringToken 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 độngRủi roCần duyệtIdempotentScopes
NONElowkhôngcó—

Input

FieldNhãnKiểuBắt buộcMô tả
offsetVị trí bắt đầuintegercóMin 0.
limitSố lượngintegercóMin 1. Max 100.
typeLoại bài viếtanycóOne of: normal, video.

Field thêm: bỏ qua.

Output

FieldNhãnKiểuMô tả
dataKết quảobjectA page of articles.
data.mediasarray of objectArticles on this page. Fields of video items are not documented.
data.medias[].idstringID of the article.
data.medias[].typestringnormal or video.
data.medias[].titlestringTitle.
data.medias[].statusstringshow or hide.
data.medias[].total_viewintegerNumber of views.
data.medias[].total_shareintegerNumber of shares.
data.medias[].create_dateintegerCreation time, Unix timestamp in milliseconds.
data.medias[].update_dateintegerLast update time, Unix timestamp in milliseconds.
data.medias[].thumbstringURL of the thumbnail.
data.medias[].link_viewstringURL to view the article.
data.totalintegerTotal 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 độngRủi roCần duyệtIdempotentScopes
NONElowkhôngcó—

Input

FieldNhãnKiểuBắt buộcMô tả
idMã bài viếtstringcóArticle ID.

Field thêm: bỏ qua.

Output

FieldNhãnKiểuMô tả
dataKết quảobjectThe article. A normal article returns the content fields; a video article returns the upload fields. The reference has examples only, no field table.
data.idstringID of the article. Normal articles only.
data.typestringArticle type, normal. Normal articles only.
data.titlestringTitle. Normal articles only.
data.authorstringAuthor name. Normal articles only.
data.coverobjectCover. Normal articles only.
data.cover.cover_typestringCover type, e.g. photo.
data.cover.photo_urlstringURL of the cover photo.
data.cover.statusstringshow or hide.
data.descriptionstringSummary. Normal articles only.
data.statusstringshow or hide for a normal article; for a video article, the numeric upload status (1 in the example for a finished upload).
data.bodyarray of objectContent blocks. Normal articles only.
data.body[].typestringBlock type, e.g. text.
data.body[].contentstringText of a text block.
data.related_mediasarray of objectRelated articles. Normal articles only.
data.commentstringWhether comments are shown, show or hide. Normal articles only.
data.citeobjectSource citation. Normal articles only. The reference spells the label key lablel.
data.cite.urlstringSource URL.
data.cite.lablelstringSource label (spelled this way by Zalo).
data.status_messagestringUpload status text. Video articles only.
data.video_namestringFile name of the video. Video articles only.
data.video_sizeintegerSize of the video in bytes. Video articles only.
data.convert_percentintegerConversion progress, 0 to 100. Video articles only.
data.convert_error_codeintegerConversion error code, 0 when none. Video articles only.
data.video_idstringID of the video. Video articles only.

Xóa bài viết (Remove article) — zalo.remove_article ​

Permanently remove an OA article.

Tác độngRủi roCần duyệtIdempotentScopes
WRITEhighcókhông—

Input

FieldNhãnKiểuBắt buộcMô tả
idMã bài viếtstringcóArticle ID.

Field thêm: bỏ qua.

Output

FieldNhãnKiểuMô tả
dataKết quảobjectNot returned: Zalo replies only error and message.