Export a file containing translations

POST /api/translations/export

Success: 200 OK

Overview

Exports a CSV file containing rows and columns with the requested translations.

Despite being a POST, this reads rather than writes: it returns a file download, not JSON. The response is text/csv with a Content-Disposition attachment named {translationType}-Translations.csv, so read the body as text rather than parsing it as JSON.

The file is the round-trip format for the import endpoint. Export first, edit the translated columns, then send the same file back — the import endpoint checks the column count against the translation type's configuration, so a hand-built file with the wrong shape is rejected. Columns come in pairs: a source column suffixed (DO NOT CHANGE) and the editable translation beside it. A basic type gives 3 columns; a type with names gives 5; a type with names and web comments gives 7.

Every row is quoted and HTML tags are rewritten. Angle-bracketed tags become double square brackets — <b> is exported as [[b]] — carriage returns are dropped, newlines become spaces, and embedded double quotes are doubled. The import endpoint reverses the bracket substitution, so leave it alone rather than converting the tags back by hand.

One row is exported for every record of the type, whether or not it has a translation. Every record of the type is included, not only those with existing translations, so an untranslated record still appears with its translation columns empty. A type with no records at all returns a file containing only the header line.

Endpoint

POST {base_url}/api/translations/export

{base_url} is the environment URL issued to your integration. See Authenticating with Gladstone APIs.

Request body

FieldTypeRequiredDescription
onlyMissingTranslationsbooleanNoRestricts the file to records that have nothing translated yet for language — a row is included only when its translated name, description and web comments are all empty. Defaults to false, which exports every record of the type. Useful for handing a translator just the outstanding work, but note that a row with a partial translation counts as translated and is left out.
languagestringYesThe culture code whose translations fill the editable columns — matched case-insensitively against the culture recorded on each translation. Required: omitting it or sending null returns 400 with Language must be specified. It is not validated against the list of configured cultures. A code that matches nothing is not an error; you get a file where every translation column is empty, and combined with onlyMissingTranslations: true that means every record comes back looking untranslated. Check the code against the cultures endpoint before you trust the output.
translationTypestringYesThe kind of record to export translations for — for example Site, Product or ActivityGroup. Required: omitting it or sending null returns 400 with TranslationType must be specified. It is matched case-insensitively against the configured translation types, and an unrecognised value returns 400 with TranslationType "{value}" is not a valid translation type. Take the value from the translation-types endpoint rather than guessing. It also determines the file's shape — whether name and web-comment columns are present — and the download filename.

Sample request

cURL
curl -X POST '{base_url}/api/translations/export' \
  -H 'Authorization: Bearer {accessToken}' \
  -H 'X-Use-SSO: true' \
  -H 'Content-Type: application/json' \
  -d '{
  "onlyMissingTranslations": true,
  "language": "string",
  "translationType": "string"
}'

Sample response

200 OK
"string"

Errors

StatusMeaningWhen
400Bad requestlanguage or translationType was omitted or null — Language must be specified or TranslationType must be specified. The body is a validation error object keyed by field name.
400Bad requesttranslationType does not match any configured translation type — TranslationType "{value}" is not a valid translation type, as a plain string. Note there is no equivalent check on language.
500Internal server errorThe export failed while reading the type's records or building the file. The body is empty.

This page as markdown · All pages · llms.txt