CDN

Publish a locale to the CDN

Publish the locale's current translations as a new immutable bundle version, the API twin of the console's publish button.

POST
/v1/cdn/publish

Publish the locale's current translations as a new immutable bundle version, the API twin of the console's publish button. When the content is identical to the live version, no new version is minted and created is false. The bundle's format is the project's runtime delivery format. Needs a plan that includes CDN delivery; otherwise 403 plan-limit.

Authorization

deployToken
headerAuthorizationBearer <token>

A project deploy token, minted in the console under Settings, Developer, API tokens. Send the whole value, including the numeric prefix before the |. A token carries a set of abilities (push, pull, manage, read, write) and each operation requires one of them. Tokens do not inherit from each other: a manage token cannot read the glossary unless it also has read.

Request Body

application/json
  1. body
locale*string
Lengthlength <= 35

Response Body

The live bundle for this locale.

application/json
  1. response
locale?string
version?integer

The published version number. Versions only increase.

format?FileFormat

A file format transglot reads and writes.

Value in"json_flat""json_nested""android_xml""ios_strings""ios_stringsdict""flutter_arb""laravel_php""laravel_json""xliff_12""ios_xcstrings""gettext_po""yaml""csv""xlsx""xliff_20""java_properties""resx""markdown""unity_csv""unreal_po"
content_hash?string

SHA-256 of the bundle body. It is the bundle's ETag.

key_count?integer

Entries in the bundle.

omitted_invalid_icu_keys?integer

Translations left out of the bundle because their message syntax would fail at runtime. They are not counted in key_count.

byte_size?integer
created?boolean

false when the content was identical to the live version, so no new version was minted.

published_at?string
Formatdate-time
immutable_url?string

The URL of this exact version. Its response never changes.

Formaturi
latest_url?string

The URL that always serves the newest published version.

Formaturi
curl -X POST 'https://api.transglot.ai/v1/cdn/publish' \  -H 'Content-Type: application/json' \  -d '{  "locale": "fr"}'
{  "locale": "string",  "version": 0,  "format": "json_flat",  "content_hash": "string",  "key_count": 0,  "omitted_invalid_icu_keys": 0,  "byte_size": 0,  "created": true,  "published_at": "2019-08-24T14:15:22Z",  "immutable_url": "http://example.com",  "latest_url": "http://example.com"}