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'
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.
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."
]
}
}
NoteTranslations are stored in the GroupDocs cloud and can be obtained by the task ID within 24 hours after the text was sent for translation.
Property | Type | Description |
---|---|---|
status | Number | HTTP response status code. |
message | String | Verbose status message. |
translations | Dictionary | Translations as a key-value list:
|
If the text is not yet translated, try fetching the result in a couple of seconds using the same ID.
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": [
"\"ハローワールド!この文章は,私の言語で読める."
]
}
}