Skip to content

docs(channels/zalo): rewrite zalo-oa, add zalo-bot — GH-966#63

Draft
vanducng wants to merge 6 commits into
masterfrom
docs/zalo-channels-rewrite-GH-966
Draft

docs(channels/zalo): rewrite zalo-oa, add zalo-bot — GH-966#63
vanducng wants to merge 6 commits into
masterfrom
docs/zalo-channels-rewrite-GH-966

Conversation

@vanducng
Copy link
Copy Markdown
Contributor

@vanducng vanducng commented May 1, 2026

Summary

Migrates the operator-facing Zalo channel guides from goclaw/docs/ (deleted in goclaw c9c7617a) to the public docs site, splitting into two pages aligned with the recent zalo_bot / zalo_oa channel rename.

Pairs with goclaw PR: nextlevelbuilder/goclaw#1048 (feat/zalo-oa-webhook-966-clean). Cross-link blockquote in goclaw's docs/05-channels-messaging.md § 10 already points at https://docs.goclaw.sh/channel-zalo-{oa,bot}. Land this PR first so those links resolve.

Status: draft — pending self-review. Feedback from the page author still expected before merge.

What's in here

New / rewritten pages

  • channels/zalo-oa.md — full rewrite. OAuth v4 setup, polling-default with code-verified knobs (poll_count=10, poll_burndown_max_pages=10), webhook bootstrap flow, signature verification (X-ZEvent-Signature), quoted replies (quote_user_message=true default), reaction levels (off config default), media caps (image 1 MB / file 5 MB / gif 5 MB), inline Social API error reference.
  • channels/zalo-bot.md — net-new. Single-token setup, polling-default, webhook with X-Bot-Api-Secret-Token header, DM-only restriction, pairing flow with 60s debounce, inline Bot API error reference. Includes a "newer platform / surface still expanding" note since Zalo is actively adding endpoints (sticker + chat-action shipped recently).

Decision aid (in both pages)

  • "Choosing your Zalo variant" section — 13-row capability matrix covering OA vs Bot vs Personal: official-support status, auth, account type, DMs/groups, multi-account, token rotation, message types, image cap, quotas, ban risk, best-fit use cases. Closes with a one-line "Quick decision" at the bottom.

Locale mirrors

  • VI / ZH copies of both new pages with <!-- TODO: translate --> top comments and proper cập nhật: footer for VI (audit-script convention).

Quadruple-sync nav

  • README.md — Channels list + Structure tree page count (14 → 15)
  • js/docs-app.js — DOC_MAP entry for channel-zalo-bot
  • index.html — sidebar <a class="sidebar-link" data-doc="channel-zalo-bot">
  • channels/INDEX.md (+ vi/, zh/ mirrors) — Quick Start list, Channel Comparison Table (Zalo Bot column added, Zalo OA row updated for OAuth+webhook reality), setup checklist

Build & audit hygiene

  • mapping.json (audit skill) — internal/channels/zalo/* rule extended to cover both pages
  • llms.txt — manual TOC entry added; llms-full.txt regenerated for root + vi/ + zh/
  • ./scripts/audit-docs.sh reports both new pages clean (matching goclaw HEAD bb68b750 at push time)

Authoritative references (canonical official URLs)

  • https://developers.zalo.me/docs/social-api/tham-khao/ma-loi — Social API error codes
  • https://bot.zapps.me/docs/ — Zalo Bot Platform docs (Zalo Platforms LLC, VNG subsidiary)
  • https://bot.zapps.me/docs/error-code/ — Bot API error reference

Defaults verified against goclaw code

Setting Value Source
transport polling (default), webhook (opt-in) internal/config/config_channels.go:177
reaction_level "off" config default internal/channels/zalo/oa/reactions.go:126
quote_user_message true default internal/config/config_channels.go:174
poll_count 10 (Zalo hard cap) internal/channels/zalo/oa/poll.go:174-177
poll_burndown_max_pages 10 same

Test plan

  • npm run dev → load /channel-zalo-oa, /channel-zalo-bot — sidebar shows both, no 404, footer renders as commit-link badge
  • Confirm Comparison Table in channels/INDEX.md renders the Zalo Bot column without layout breakage
  • Validate VI / ZH locale mirrors render at /vi/channel-zalo-{oa,bot} and /zh/channel-zalo-{oa,bot}
  • Cloudflare Pages preview deploy succeeds; smoke-test the three production URLs after merge
  • After merge: bump cross-link in goclaw to live URLs and unblock feat(channels/zalo): OA OAuth + webhook transport (#966) goclaw#1048

Out of scope / follow-ups

  • VI / ZH translations are placeholder copies of EN — translation pass tracked via <!-- TODO: translate --> comments
  • No standalone zalo-error-codes reference page (decision: codes are inlined per page where operationally relevant)
  • scripts/fetch-zalo-error-codes.cjs left in goclaw repo (not relocated)

vanducng added 5 commits May 1, 2026 03:56
Migrates the operator-facing Zalo channel guides from goclaw/docs to the
public docs site, splitting into two pages aligned with the zalo_bot/zalo_oa
channel rename.

- channels/zalo-oa.md: full rewrite — OAuth v4 setup, polling-default
  (poll_count=10, poll_burndown_max_pages=10), webhook bootstrap flow,
  signature verification, quoted replies, reaction levels, inline error
  code reference table.
- channels/zalo-bot.md: new page — single-token setup, polling-default,
  webhook with X-Bot-Api-Secret-Token header, DM-only, pairing flow,
  inline Bot API error code table.
- VI/ZH locale mirrors with TODO-translate comments and audit-script
  compatible footers (cập nhật: for vi).
- Quadruple-sync nav: README, DOC_MAP, sidebar, channels/INDEX.md
  (Quick Start + Comparison Table updated for OAuth+webhook reality).
- Audit mapping extends internal/channels/zalo/* to cover both new pages.
- llms.txt + llms-full.txt regenerated.
Cross-checked against Zalo developer documentation:

- Prerequisites now distinguish app (developers.zalo.me) vs OA
  (oa.zalo.me) and surface the Liên kết OA step.
- Add permission-groups requirement (Quản lý tin nhắn, Quản lý người
  quan tâm, Upload, Webhook); without these, API calls fail with -216.
- Add token lifecycle callout: 1h access, 90d single-use refresh with
  automatic rotation; refresh failure → re-consent.
- New Media Limits section with per-endpoint caps (image 1 MB, file
  5 MB, gif 5 MB) — these are Zalo server-side, not GoClaw config.
- Error code table now distinguishes -216 (perms) vs -217 (token
  expired, auto-recovers) vs -220/-118 (refresh dead, re-consent).

Bot page unchanged structurally; SHA bumped for footer freshness.
…tion note

Helps users decide between Zalo OA, Zalo Bot, and Zalo Personal.

- Add identical "Choosing your Zalo variant" section to both zalo-oa.md
  and zalo-bot.md, with a 13-row capability matrix covering official
  support status, auth model, account type, DM/group support, multi-
  account capacity, token rotation, message types, image cap, quotas,
  ban risk, and best-fit use cases.
- Note Bot platform (bot.zapps.me) is newer than the OA API and the
  surface is still expanding (sticker + chat-action endpoints landed
  recently per https://bot.zapps.me/docs/).
- Note Personal uses reverse-engineered protocol; not for production.
- End each comparison with a "Quick decision" one-liner.

Replaces the prior 6-row Bot vs OA mini-table and 3-row OA-anchored
mini-table with a unified, decision-oriented matrix.
…r table

Switch the Social API error-code reference link from the static-CDN host
(stc-developers.zdn.vn) to the canonical user-facing URL on
developers.zalo.me. The CDN URL still resolves but is not the official
documentation entry point.

All other URLs in zalo-oa.md and zalo-bot.md verified against canonical
hosts:
- bot.zapps.me/docs/ — official Zalo Bot Platform (Zalo Platforms LLC,
  VNG subsidiary)
- bot.zapps.me/docs/error-code/ — official Bot API error reference
- developers.zalo.me — official Zalo developer console
- oa.zalo.me — official Zalo OA management console
Source paths in goclaw rot quickly across refactors and would silently
mislead readers. The pages now lean on:

- runtime slog keys (already documented under Troubleshooting)
- public API surfaces (Zalo dev console fields, header names)
- official Zalo / Bot Platform docs (already linked)

If a maintainer needs to find the implementation, they can grep — that
is not the docs reader's job.
@thieung thieung marked this pull request as ready for review May 2, 2026 15:20
@thieung
Copy link
Copy Markdown
Contributor

thieung commented May 22, 2026

Please resolve conflicts and sync with new goclaw code base @vanducng

Resolve conflicts:
- README.md: combine page counts (providers 25, channels 15)
- llms{,-full}.txt (EN/VI/ZH): regenerate via scripts/generate-llms-txt.sh
@vanducng vanducng marked this pull request as draft May 23, 2026 01:55
@vanducng
Copy link
Copy Markdown
Contributor Author

@thieu1995 thanks for the review!

Quick status update:

  • Resolved merge conflicts with master (README page counts + regenerated llms{,-full}.txt for EN/VI/ZH via scripts/generate-llms-txt.sh).
  • Marking this PR as draft to wait on the upstream dependency: feat(channels/zalo): OA OAuth + webhook transport (#966) goclaw#1048. Will flip back to ready once that lands so the cross-links to https://docs.goclaw.sh/channel-zalo-{oa,bot} resolve in the right order.

Will ping you again once it's ready for re-review.

@thieung
Copy link
Copy Markdown
Contributor

thieung commented May 24, 2026 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants