Translate text - Fluid Topics - Latest

Fluid Topics API Reference Guide

Category
Reference Guides
Audience
public
Version
Latest

This web service allows users with the AI_USER role to translate text.

An AI profile is linked to a specific translation provider. The translation style, quality, and accuracy differs greatly between translation engines.

Method Endpoint
POST
/api/ai/translate

Request example

The following code block is an example of JSON request body for this web service:

{
  "profileId": "translator",
  "content": [
    "May the force be with you.",
    "I am your father."
  ],
  "sourceLanguage": "en",
  "destinationLanguage": "fr",
  "format": "text"
}
Field Type Required? Description
profileId String Yes An AI profile ID of type Translation.
content Array Yes The content to translate. The content can be raw text or HTML.
sourceLanguage String No The language for the content to translate. If missing, the translation engine tries to identify the language.
Not providing a source language can result in inaccurate translations. Users should try to provide one, if possible.
The value must be a ISO 639-1 language designator (for example, fr for French, or es for Spanish). Can be followed by a hyphen, and an ISO 3166-1 region designator in uppercase (for example, fr-CA for Canadian French, or es-ES for Castilian Spanish).
destinationLanguage String Yes The language to translate into. The value must be a ISO 639-1 language designator (for example, en for English, or es for Spanish). Can be followed by a hyphen, and an ISO 3166-1 region designator in uppercase (for example, en-US for American English, or es-MX for Mexican Spanish).
format String No Can be text or html. It is text by default.

Response body

The following code block is an example of JSON response body for this web service:

{
  "items": [
    "Que la force soit avec vous.",
    "Je suis ton père."
  ]
}
Return code Description
200 OK Returns the translated content.
401 UNAUTHORIZED
  • Profile must be of type TRANSLATION. The provided profile if not of the right type.
  • Required Authentication The user does not have the AI_USER role.

For a comprehensive list of all possible return codes, see Return codes.