hosting
GET /v1/sites/{site_id}/translation/bundle/{locale}
One locale of a site's translated content, for the site itself to render.
Аутентификация
Передайте API-ключ в качестве маркера носителя (bearer token). Эта конечная точка не указывает конкретное разрешение в спецификации, поэтому предоставьте своему ключу минимум необходимых прав и проверьте ответ, вместо того чтобы делать предположения.
Этот эндпоинт не принимает идентификатор организации. Ваш ключ уже определяет организацию, к которой он принадлежит, и ответ ограничивается ее рамками.
Попробовать
Замените всё в угловых скобках на собственные значения, а плейсхолдер ключа — на ключ из вашей панели управления.
curl -X GET https://api.zinndigital.com/v1/sites/{site_id}/translation/bundle/{locale} \
-H "Authorization: Bearer zdk_live_…"Вошли в систему? Консоль API в вашей панели управления автоматически подставляет реальный идентификатор вашей организации и ваш собственный ключ, а также выполняет запрос к работающему API, чтобы вы могли увидеть актуальный ответ. Откройте эту конечную точку в API-консоли
Подробнее
Every translated string this site has in `locale`, keyed by document. **This is the consumer end of the product**: the Zinn® Translate plugin on the customer's own WordPress site calls it, caches the payload, and swaps titles, bodies, excerpts and slugs at render time. **Last-good-while-stale, per string.** An entry is returned whenever its text is non-empty, whatever its status: a re-translation in flight must not blank a paragraph that is already live on someone's site. A string with no translation yet is **absent from the payload** rather than present and empty — the plugin then renders the customer's own words, and those two cases mean different things. Readable without good standing, deliberately: taking a live site's translated pages down over an unpaid invoice is a worse outcome than the invoice, and the customer never agreed to it. It does require a live subscription — a site that never bought this gets a `403`.
Параметры
| Имя | Тип | Обязательно | Что это |
|---|---|---|---|
site_id (path) | Uuid | Да | — |
locale (path) | LocaleCode | Да | The locale to fetch (docs/28 registry code). |
Ответ
| Имя | Тип | Обязательно | Что это |
|---|---|---|---|
locale | LocaleCode | Да | BCP-47 / ISO locale code from the language registry (docs/28). |
documents | SiteTranslationDocument[] | Да | — |
ready | integer | Да | — |
total | integer | Да | — |
Ошибки, которые может возвращать этот эндпоинт
401 · 403 · 404 · 422