Skip to main content

Standards and formats

The MT API has been designed following some standards that affect how our API works. Review this information to get familiar with formats, so you can easily apply them and avoid error responses.

Timestamps

Timestamps are returned in ISO 8601 format as Coordinated Universal Time (UTC) with a zero offset: YYYY-MM-DDTHH:MM:SSZ.

Languages

The language codes in our API follow the BCP 47 format and codes schema and syntax defined in RFC.

Some examples:

CodeLanguage Name*Description
en-GBEnglish (UK)Language + region
fr-CAFrench as used in CanadaLanguage + region
es-419Spanish as used in Latin AmericaLanguage + region
de-DEGerman (Germany)Language + region

*Where Language name is always in English

Caution

When specifying the MT language pairs of your need, you must pay special attention to the direction (source-target) of the language pair codes.

Semantic versioning

The MT API development follows the versioning scheme set on the semantic versioning standards. This means that all progressive changes made in our API are tracked and communicated with specific increments to the version number in the URI path.

  • The version format is based on X.Y.Z scheme (Major.Minor.Patch). For example, version 1.3.11 indicates major version 1, minor version 3 and patch level 11.
  • The version number is incremented in line to the level of change included in the release.

Response codes

LanguageWire MT API uses conventional HTTP response codes, as defined in the RFC 2616 and RFC 6585, to indicate the success or failure of an API request. In general:

  • Codes in the 2xx range indicate success.
  • Codes in the 4xx range indicate an error, that failed due to the information provided (e.g. a required parameter missing, an upload failed, unsupported language pair, etc.).
  • Codes in the 5xx range indicate an error coming from LanguageWire servers (these are rare).

For 4xx and 5xx errors, the response body structure varies depending on the error type. Common examples include:

Standard error response:

{
"detail": "Language pair (en-GB -> en-US) is not supported"
}

Validation error response:

{
"detail": [
{
"loc": ["body", "target"],
"msg": "field required",
"type": "value_error.missing"
}
]
}
Info

The MT API uses three different error response structures depending on the error type. For complete details on all error response structures (including asynchronous document translation errors), frequent error codes, and recommended solutions, refer to the Error handling section.