Documentation

API

TermBase Translation API

List, create and update the translations of glossary terms with the WebTranslateIt TermBase Translation API. 4 min read

The TermBase Translation API is composed of 3 endpoints:

List Term Translations

This endpoint is only accessible by the read-write Project API key and is used to list translations for a term.

/api/projects/:project_token/terms/:term_id/locales/:locale_code/translations.format [GET]

Where format is one of xml, json or yaml.

GET/api/projects/:project_token/terms/:term_id/locales/:locale_code/translations.json
curl "https://webtranslateit.com/api/projects/PROJECT_TOKEN/terms/1234/locales/fr/translations.json"

Example response with JSON:

json
[
  {
    "id": 1234,
    "locale": "fr",
    "text": "Utilisateur",
    "description": "Une personne utilisant WebTranslateIt",
    "status": "approved",
    "created_at": "2010-02-11 21:14:19 UTC",
    "updated_at": "2011-10-09 08:33:18 UTC",
  },
  {
    "id": 1234,
    "locale": "fr",
    "text": "Voiture",
    "description": "Une personne utilisant WebTranslateIt",
    "status": "refused",
    "created_at": "2010-02-11 21:14:19 UTC",
    "updated_at": "2011-10-09 08:33:18 UTC",
  },
]
  • text: The actual term translation.
  • description: Term translation description
  • status: Term Translation status. One of approved, refused, proposed.

Create Term Translation

This endpoint is only accessible by the read-write Project API key and is used to create a new term translation.

/api/projects/:project_token/terms/:term_id/locales/:locale_code/translations [POST]

Parameters

A JSON object modelled after the following:

json
{
  "text": "Utilisateur",
  "description": "Une personne utilisant WebTranslateIt.",
  "status": "approved"
}

description and status are optional.

status can be one of approved, proposed or refused.

If everything goes well, WebTranslateIt will respond with 201 Created in the header and a JSON representation of the string just created in the body.

POST/api/projects/:project_token/terms/:term_id/locales/:locale_code/translations
curl -X POST "https://webtranslateit.com/api/projects/PROJECT_TOKEN/terms/1234/locales/fr/translations" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "Utilisateur",
    "description": "Une personne utilisant WebTranslateIt.",
    "status": "approved"
  }'

Update Term Translation

This endpoint is only accessible by the read-write Project API key and is used to update a term translation.

/api/projects/:project_token/terms/:term_id/locales/:locale_code/translations/:term_translation_id [PATCH]

Parameters

A JSON object modelled after the following:

json
{
  "text": "Utilisateur",
  "description": "Une personne utilisant WebTranslateIt.",
  "status": "refused"
}

description and status are optional.

status can be one of approved, proposed or refused.

If everything goes well, WebTranslateIt will respond with 202 Accepted in the header and a JSON representation of the string just created in the body.

PATCH/api/projects/:project_token/terms/:term_id/locales/:locale_code/translations/:term_translation_id
curl -X PATCH "https://webtranslateit.com/api/projects/PROJECT_TOKEN/terms/1234/locales/fr/translations/5678" \
  -H "Content-Type: application/json" \
  -d '{ "status": "refused" }'