localization
GET /v1/i18n/bundles/{locale}
Get every translated string for one locale.
การยืนยันตัวตน
ส่ง API key เป็น bearer token เอนด์พอยต์นี้ไม่ได้ระบุสิทธิ์การใช้งานเฉพาะในข้อกำหนด ดังนั้นควรให้คีย์ของคุณมีสิทธิ์น้อยที่สุดเท่าที่จำเป็นและให้ตรวจสอบจากการตอบกลับแทนที่จะคาดเดา
ปลายทางนี้ไม่ต้องใช้รหัสองค์กร คีย์ของคุณระบุองค์กรที่เป็นเจ้าของอยู่แล้ว และการตอบกลับจะถูกจำกัดขอบเขตไว้เฉพาะองค์กรนั้น
ทดลองใช้เลย
แทนที่สิ่งใดๆ ที่อยู่ภายในวงเล็บแหลมด้วยค่าของคุณเอง และตัวยึดตำแหน่งคีย์ด้วยคีย์จากแดชบอร์ดของคุณ
curl -X GET https://api.zinndigital.com/v1/i18n/bundles/{locale} \
-H "Authorization: Bearer zdk_live_…"เข้าสู่ระบบแล้วใช่ไหม คอนโซล API ในแดชบอร์ดของคุณจะเติมรหัสองค์กรจริงและคีย์ของคุณเองโดยอัตโนมัติ และทำการส่งคำขอไปยัง API จริง เพื่อให้คุณเห็นผลลัพธ์ที่เป็นข้อมูลจริง เปิดจุดสิ้นสุดนี้ในคอนโซล API
รายละเอียด
Returns the calling organization's translated strings for `locale`, grouped by `object_ref` then `field` — the read a site build or an SSR render performs to populate a locale. **Last-good-while-stale.** An entry's `text` is returned whenever it is non-empty, *regardless of its `status`*: the store retains the previous translation while a re-translation is in flight, and serving that is better than serving an English string (or nothing) on a localized page. The per-entry `status` is exposed so the caller decides — a production build may accept `stale`, a release gate may refuse anything that is not `up_to_date`. Entries with no text yet are omitted entirely rather than returned blank. **Deliberately NOT cursor-paginated — a documented deviation from the rest of this API.** Every other collection here is cursor-paginated, and that is the right default for tenant data that grows without bound. This corpus is different: it is our own bounded, self-owned content, read as a single unit at build time. Paginating it would turn one build into hundreds of sequential round-trips *per locale* (58 locales × pages), for no isolation or performance benefit. Instead the response is bounded by a hard server-side cap; a bundle that would exceed it is a `422` naming the cap and telling the caller to narrow with `surface` or `object_ref_prefix` rather than silently truncating. Cacheable: responses carry a strong `ETag` over the bundle contents plus `Cache-Control: public, max-age=60`. Send `If-None-Match` to get a `304` and skip the transfer entirely.
พารามิเตอร์
| ชื่อ | ประเภท | จำเป็นต้องมี | ลักษณะของสิ่งนี้ |
|---|---|---|---|
locale (path) | LocaleCode | ใช่ | The target locale to build a bundle for (docs/28 registry code). |
surface (query) | string | ไม่ใช่ | Comma-separated list of surfaces to include (e.g. `page,meta_title`). All surfaces when omitted. An unknown surface is a `422`. |
object_ref_prefix (query) | string | ไม่ใช่ | Only include entries whose `object_ref` starts with this prefix (e.g. `kb_article:` or `page:pricing`). Narrows a bundle that would otherwise exceed the entry cap. |
object_ref (query) | string | ไม่ใช่ | Comma-separated list of exact `object_ref` values (at most 100). Fetches a **group** of documents in one request. This exists because a prefix cannot express a group and one req… |
limit (query) | integer | ไม่ใช่ | Page size. **Sending this (or `cursor`) opts into paging**; send neither and the response is the whole bundle, with the `422` above when it exceeds the cap. Clamped to the 5,000… |
cursor (query) | string | ไม่ใช่ | The `next_cursor` from the previous page, passed back verbatim. Opaque — a cursor this endpoint did not issue is a `422`, never a silent restart, which would loop a caller forev… |
If-None-Match (header) | string | ไม่ใช่ | A previously returned `ETag`; a match responds `304`. |
การตอบกลับ
| ชื่อ | ประเภท | จำเป็นต้องมี | ลักษณะของสิ่งนี้ |
|---|---|---|---|
locale | LocaleCode | ใช่ | BCP-47 / ISO locale code from the language registry (docs/28). |
generated_at | string | ใช่ | When this bundle was assembled (server time). |
entries | object | ใช่ | `object_ref` -> `field` -> the translated entry. Entries with no text yet are omitted rather than returned blank. |
next_cursor | string | ไม่ใช่ | Pass back as `cursor` for the next page. `null` on the last page, and **absent entirely** unless the request opted into paging with `limit` or `cursor` — so a caller that never… |
ข้อผิดพลาดที่เอนด์พอยต์นี้สามารถส่งกลับได้
401 · 403 · 422 · 429