Zalo — Articles
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.
| Side effect | Risk | Needs approval | Idempotent | Scopes |
|---|---|---|---|---|
| WRITE | medium | yes | no | — |
Input
| Field | Type | Required | Description |
|---|---|---|---|
type | any | yes | Article type. One of: normal. |
title | string | yes | Article title. |
author | string | yes | Author name. |
cover | object | yes | Cover photo: cover_type 'photo', photo_url, status show/hide. |
cover.cover_type | any | yes | One of: photo. |
cover.photo_url | string | yes | |
cover.status | any | no | One of: show, hide. |
description | string | yes | Short summary shown in the feed. |
body | array of object | yes | Ordered content blocks. |
body[].type | any | yes | One of: text, image. |
body[].content | string | no | Text of a text block. |
body[].url | string | no | Image URL of an image block. |
status | any | no | Article visibility. One of: show, hide. |
comment | any | no | Whether comments are shown. One of: show, hide. |
Extra fields: ignored.
Output
| Field | Type | Description |
|---|---|---|
data | object | Result of the request. |
data.token | string | Token of the asynchronous job. Pass it to verify_article to get the article ID. |
Verify article — zalo.verify_article
Get the article ID of a created article from its token. Error -214 means it is still processing.
| Side effect | Risk | Needs approval | Idempotent | Scopes |
|---|---|---|---|---|
| NONE | low | no | yes | — |
Input
| Field | Type | Required | Description |
|---|---|---|---|
token | string | yes | Token from create_article. |
Extra fields: ignored.
Output
| Field | Type | Description |
|---|---|---|
data | object | The created or updated article. |
data.id | string | ID of the article. |
Update article — zalo.update_article
Update an OA article. Zalo returns a token to verify, as for create_article.
| Side effect | Risk | Needs approval | Idempotent | Scopes |
|---|---|---|---|---|
| WRITE | medium | yes | no | — |
Input
| Field | Type | Required | Description |
|---|---|---|---|
id | string | yes | Article ID. |
type | any | yes | Article type. One of: normal. |
title | string | yes | Article title. |
author | string | yes | Author name. |
cover | object | yes | Cover photo: cover_type 'photo', photo_url, status show/hide. |
cover.cover_type | any | yes | One of: photo. |
cover.photo_url | string | yes | |
cover.status | any | no | One of: show, hide. |
description | string | yes | Short summary shown in the feed. |
body | array of object | yes | Ordered content blocks. |
body[].type | any | yes | One of: text, image. |
body[].content | string | no | Text of a text block. |
body[].url | string | no | Image URL of an image block. |
status | any | no | Article visibility. One of: show, hide. |
comment | any | no | Whether comments are shown. One of: show, hide. |
Extra fields: ignored.
Output
| Field | Type | Description |
|---|---|---|
data | object | Result of the request. |
data.token | string | Token of the asynchronous job. Pass it to verify_article to get the article ID. |
List articles — zalo.list_articles
List OA articles, newest first.
| Side effect | Risk | Needs approval | Idempotent | Scopes |
|---|---|---|---|---|
| NONE | low | no | yes | — |
Input
| Field | Type | Required | Description |
|---|---|---|---|
offset | integer | yes | Min 0. |
limit | integer | yes | Min 1. Max 100. |
type | any | yes | One of: normal, video. |
Extra fields: ignored.
Output
| Field | Type | Description |
|---|---|---|
data | 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. |
Get article — zalo.get_article
Get the detail of one OA article.
| Side effect | Risk | Needs approval | Idempotent | Scopes |
|---|---|---|---|---|
| NONE | low | no | yes | — |
Input
| Field | Type | Required | Description |
|---|---|---|---|
id | string | yes | Article ID. |
Extra fields: ignored.
Output
| Field | Type | Description |
|---|---|---|
data | 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. |
Remove article — zalo.remove_article
Permanently remove an OA article.
| Side effect | Risk | Needs approval | Idempotent | Scopes |
|---|---|---|---|---|
| WRITE | high | yes | no | — |
Input
| Field | Type | Required | Description |
|---|---|---|---|
id | string | yes | Article ID. |
Extra fields: ignored.
Output
| Field | Type | Description |
|---|---|---|
data | object | Not returned: Zalo replies only error and message. |