Fetching translations

When text is submitted for translation, it is queued to ensure a stable response even under high load. To obtain the translations, send a GET request to the https://api.groupdocs.cloud/v2.0/translation/text/{request ID} GroupDocs.Translation Cloud REST API endpoint. To authorize the request, pass the access token in Authorization header (Bearer authentication).

Provide the unique identifier of the translation task:

curl --request GET --location 'https://api.groupdocs.cloud/v2.0/translation/text/a4fc6c6e-81b0-43c8-b62b-b8bb99520ce9' \
--header 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...UV1hLfgNCSQ4VKGCOA'

Evaluation mode

To get the translation from evaluation request, send a GET request to the endpoint https://api.groupdocs.cloud/v2.0/translation/text/trial/{request ID}.

This endpoint does not use the Authorization header, so there is no need to generate an access token.

You can also use the standard (authorized) endpoint to fetch a translation, even if it was requested in evaluation mode.

Translated texts

Translations are returned in JSON format in the response body.

{
	"status": 200,
	"message": "Text translated successfully",
	"translations": {
		"de": [
			"Hallo, Welt! Ich kann diesen Text in meiner Sprache lesen."
		]
	}
}
Note
Translations are stored in the GroupDocs cloud and can be obtained by the task ID within 24 hours after the text was sent for translation.
PropertyTypeDescription
statusNumberHTTP response status code.
messageStringVerbose status message.
translationsDictionaryTranslations as a key-value list:
  • Key is the language code into which the texts were translated.
  • Value is the array of translated strings corresponding to the source texts.

If the text is not yet translated, try fetching the result in a couple of seconds using the same ID.

cURL example

curl --request GET --location 'https://api.groupdocs.cloud/v2.0/translation/text/a4fc6c6e-81b0-43c8-b62b-b8bb99520ce9' \
--header 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...UV1hLfgNCSQ4VKGCOA'
{
	"status": 200,
	"message": "Text translated successfully",
	"translations": {
		"uk": [
			"Я можу прочитати цей вірш своєю мовою."
		],
		"ja": [
			"\"ハローワールド!この文章は,私の言語で読める."
		]
	}
}