Search & Feed APIs (api/search.php, api/feed.php)

Standalone Qwiki exposes read-only endpoints for full-text search and category syndication, both enforcing session, visibility, and lifecycle gating.

Full-Text Search (api/search.php)

Endpoint: GET /api/search.php?q=<query>

  • Response Format:
    {
      "success": true,
      "results": ["user-markdown-and-editor", "tech-headless-publish-api"]
    }
  • How Matching Works:
    1. Checks Auth::canView($config)β€”returns an empty results array if Private Portal mode is active and the caller is unauthenticated.
    2. Warms remote transclusion caches via RemoteContentManager::warmAllRemoteCaches().
    3. Traverses categories, sub-folders, and hyperlinks recursively, skipping admin_only items for non-admins, logged_in items for unauthenticated guests, and draft/in_review/archived chapters via Navigation::isChapterVisibleForStatus().
    4. Matches q case-insensitively against document title, description, and body text extracted through ExtensionManager::extractSearchableText().

RSS / Atom Feed Syndication (api/feed.php)

Endpoint: GET /api/feed.php[?category=<id-or-title>][&token=<feedAccessToken>]

  • Access Control:
    • If feedAccessToken is set in βš™οΈ Settings βž” πŸ“‘ Feeds & Integrations, or if Private Portal (requireLoginToView) is active, callers must provide ?token=<feedAccessToken> (validated with hash_equals()) or hold an authenticated viewer/admin sessionβ€”otherwise the endpoint returns 403.
    • Inherited category visibility is evaluated recursively (admin_only > logged_in > public), and unpublished lifecycle statuses are excluded.
  • Scoping: Omit category to syndicate recent public items across the wiki (capped by feedItemCount, default 10), or pass ?category=<id> to syndicate a single category or nested sub-category.