Skip to content

Export INI

Synchronously generate an INI file from an export template (template_id), upload it to object storage, and return a 1-hour signed download URL.

Currently only type="project_strings" is supported. task_strings is not yet exposed via the Open Platform because its export filter is more involved (per source/target language pair) — it'll come in a later version.

Endpoint

POST {BASE_URL}/api/open/v1/export/ini

Authentication Headers

Same as Create Translation Task. The raw POST body participates in the signature: MD5(timestamp + raw_body + appSecret).

Request Body (JSON)

json
{
  "type": "project_strings",
  "template_id": "tpl-9d3f1a2c",
  "target_languages": ["en", "ja"],
  "download_mode": "single",
  "escape_mode": "no-escape",
  "filename": "v1.0_en_ja"
}

Field Reference

FieldTypeRequiredDescription
typestringYesCurrently only project_strings (project-level / full text strings) is supported
template_idstringYesTemplate ID. The template must have format=ini (set when creating it)
target_languagesstring[]NoOverride the template's languages. If omitted, the template's own languages are used. If both are empty → 422
download_modestringNoOverride the template's mode: single (one INI with all languages) / separate (one INI per language, zipped). Default = template's value, falling back to single
escape_modestringNoOverride the project's export_settings.ini_escape_mode: escape (escapes \n / \r / \t / \\) / no-escape (raw). Default = project setting, falling back to no-escape
filenamestringNoOutput filename prefix (.ini or .ini.zip is auto-appended). Defaults to {projectId}_{timestamp}

Response

json
{
  "success": true,
  "code": 0,
  "msg": "ok",
  "trace_id": "...",
  "data": {
    "download_url": "https://storage.googleapis.com/loxily-export/...&Signature=...",
    "expires_at": "2026-05-12T13:00:00.000Z",
    "file_size": 12345,
    "format": "ini",
    "download_mode": "single",
    "target_languages": ["en", "ja"],
    "escape_mode": "no-escape"
  }
}
FieldTypeDescription
download_urlstringGCS v4 signed URL; valid for 1 hour
expires_atstringSignature expiry (ISO 8601)
file_sizeintFile size in bytes
formatstringAlways ini
download_modestringEffective mode (single / separate)
target_languagesstring[]Languages actually exported
escape_modestringEffective escape mode

Behavior

  • Scope: hard-coded all (every string under the project). The Open Platform does not support the page-side "filtered view" export.
  • Empty values: a language with empty / null value for a row is omitted from that row's INI lines; rows with empty string_id are skipped entirely.
  • Volume: a typical project (1k–10k strings, multi-language separate) finishes in tens of milliseconds to a few seconds. The endpoint times out after 5 minutes. For very large exports, split by language subsets across multiple calls.
  • Download URL: download promptly (expires in 1 hour). Need to download again? Call the endpoint again; each call returns a fresh signed URL.

Error Codes

codeDescription
400Body is not valid JSON / template_id missing / wrong type or value for download_mode / escape_mode / target_languages / filename
401Signature invalid / timestamp expired
403App Secret not configured
404No template found for template_id
422type is not project_strings / template's format is not ini / languages end up empty after overriding
500Export failed / GCS upload failed

Example

bash
APP_KEY="5685414646a54423c891d87194d87f3f"
APP_SECRET="<your App Secret>"
BASE_URL="https://api.loxily.com"

BODY='{"type":"project_strings","template_id":"tpl-9d3f1a2c","target_languages":["en","ja"],"download_mode":"single"}'
TIMESTAMP=$(date +%s)
SIGN=$(printf '%s' "${TIMESTAMP}${BODY}${APP_SECRET}" | md5)

# 1) Call the endpoint to get the signed URL
RESP=$(curl -s -X POST "${BASE_URL}/api/open/v1/export/ini" \
  -H "Content-Type: application/json" \
  -H "X-Loxily-AppKey: ${APP_KEY}" \
  -H "X-Loxily-Timestamp: ${TIMESTAMP}" \
  -H "X-Loxily-Sign: ${SIGN}" \
  --data "${BODY}")

echo "$RESP"

# 2) Extract the URL with jq and download
URL=$(echo "$RESP" | jq -r '.data.download_url')
curl -L -o export.ini "$URL"