Documentation menu

Public API

Fetch published content from any front-end.

The public API is read-only and ETag-cached. It accepts only GET, HEAD and OPTIONS; any other method returns 405. Only published content is returned, never drafts.

Markets and locales

  • The market codes are vn, ph and id.
  • Locales are vi and en for vn, fil and en for ph, and id and en for id.
  • When fetching a page, a missing or invalid locale falls back to the market's default locale.

Landing content

  • GET /api/v1/public/pages/{market}/{pageKey}?locale=: returns structured page fields as { fields }.
  • GET /api/v1/public/translations/{market}/{locale}: returns UI translations as { messages }.
  • GET /api/v1/public/enablement/{market}: returns which pages and services are live in that market.
ts
const res = await fetch(
  "https://tixigen.com/api/v1/public/pages/vn/home?locale=en",
  { next: { revalidate: 60 } }
);
const { fields } = await res.json();
fields["home.hero.headline"];

Articles

  • GET /api/v1/page-articles/{pageKey}: article list
  • GET /api/v1/page-articles/{pageKey}/{slug}: a single article
  • GET /api/v1/page-articles/{pageKey}/search: keyword search
  • GET /api/v1/page-articles/{pageKey}/trending: trending articles
  • GET /api/v1/page-articles/{pageKey}/categories, /tags, /authors: categories, tags and authors

pageKey is the key of a headless page created by an admin. Lists accept page (default 1), limit (default 12, max 50), category, tag, author, q and sort (latest, oldest, updated, sort_order). Responses have the shape { items, pagination }.

bash
curl "https://tixigen.com/api/v1/page-articles/$PAGE_KEY?limit=6&sort=latest" \
  -H "x-api-key: $API_KEY"

# {
#   "items": [ { "slug": "...", "title": "...", "publishedAt": "..." } ],
#   "pagination": { "page": 1, "limit": 6, "total": 42, "totalPages": 7 }
# }
If the headless page has a public API key, send it in the x-api-key header or as Authorization: Bearer. Without it you get 401 (invalid_api_key).

Caching and conditional requests

  • JSON responses carry an ETag. Send it back in If-None-Match and you get 304 when nothing has changed.
  • Cache-Control is s-maxage=60 for lists, s-maxage=300 for details and pages, and s-maxage=600 for feeds, each with stale-while-revalidate.
  • Right after publishing, the old content may be returned until the cache refreshes.

Errors

json
{
  "error": {
    "code": "invalid_market",
    "message": "Unknown market \"xx\""
  }
}
  • 400: invalid_market, invalid_page, invalid_locale, invalid_query
  • 401: invalid_api_key
  • 404: not_found
  • 405: method_not_allowed (Allow: GET, HEAD, OPTIONS)
  • 500: internal_error
Call the API from your server. Browser calls only work from allowed origins, and server-side calls keep your API key private.