Allows the processing files asynchronously with the file being uploaded and stored in Phrase. Files can be either stored or translated by the best available MT engine. File TTL is limited to 24 hours after which the file is deleted from storage.
Creates a new file translations request based on multipart/form-data. The translation state can be fetched
utilizing a returned UID in the response and a Metadata endpoint. It is also
possible to download the translated file using the Get file endpoint once the
translation is complete (action.status == OK
).
Source file with the metadata used for the translation process.
Multipart request with metadata
and file
parts.
Metadata accepts the following actionTypes
:
Action Type | Description |
---|---|
FILE_IMPORT | Imports the file into the system |
CONVERTER_IMPORT | Extracts the translatable texts out of the file |
MT_GENERIC_PRETRANSLATE | Translates the extracted text |
QUALITY_ESTIMATION | Returns Phrase Quality Performance Score (QPS) |
Note that only action type MT_GENERIC_PRETRANSLATE
is needed when user wants to translate the
file. Or only action type QUALITY_ESTIMATION
is needed when user wants to translate the file and
to get the quality estimation
file required | string <binary> |
required | object (FileTranslationsMetadataV1) |
--Boundary_1_1453803947_1691603987728 Content-Type: application/octet-stream Content-Disposition: form-data; name="file"; filename="test.txt" Text for translation --Boundary_1_1453803947_1691603987728 Content-Type: application/json Content-Disposition: form-data; name="metadata" {"sourceLang":{"code":"en"},"targetLangs":[{"code":"cs"}],"actionTypes":["MT_GENERIC_PRETRANSLATE"],"callbackUrl":"https://your-server.com/send/data/here"} --Boundary_1_1453803947_1691603987728--
{- "uid": "random-uid",
- "actions": [
- {
- "actionType": "MT_GENERIC_PRETRANSLATE",
- "results": [
- {
- "id": "random-uid",
- "sourceLang": "en",
- "targetLang": "cs",
- "status": "OK"
}
]
}
], - "metadata": {
- "sourceLang": {
- "code": "cs"
}, - "targetLangs": [
- {
- "code": "cs"
}
], - "actionTypes": [
- "MT_GENERIC_PRETRANSLATE"
], - "mtSettings": {
- "usePhraseMTSettings": true,
- "profile": {
- "uid": "CFUki8ptanoz1WAIYoXSH4"
}
}, - "transMemoriesConfig": [
- {
- "targetLang": {
- "code": "cs"
}, - "transMemories": [
- {
- "transMemory": {
- "uid": "string"
}, - "tmSourceLocale": {
- "code": "cs"
}, - "tmTargetLocale": {
- "code": "cs"
}
}
]
}
]
}
}
{- "uid": "random-uid",
- "actions": [
- {
- "actionType": "MT_GENERIC_PRETRANSLATE",
- "results": [
- {
- "id": "random-uid",
- "sourceLang": "en",
- "targetLang": "cs",
- "status": "OK"
}
]
}
], - "metadata": {
- "sourceLang": {
- "code": "cs"
}, - "targetLangs": [
- {
- "code": "cs"
}
], - "actionTypes": [
- "MT_GENERIC_PRETRANSLATE"
], - "mtSettings": {
- "usePhraseMTSettings": true,
- "profile": {
- "uid": "CFUki8ptanoz1WAIYoXSH4"
}
}, - "transMemoriesConfig": [
- {
- "targetLang": {
- "code": "cs"
}, - "transMemories": [
- {
- "transMemory": {
- "uid": "string"
}, - "tmSourceLocale": {
- "code": "cs"
}, - "tmTargetLocale": {
- "code": "cs"
}
}
]
}
]
}
}
Use the Accept header with either application/octet-stream
to get the file or use application/json
to get the quality estimation.
actionType required | string (ActionTypeEnumV1) Enum: "CONVERTER_IMPORT" "FILE_IMPORT" "MT_GENERIC_PRETRANSLATE" "QUALITY_ESTIMATION" Example: MT_GENERIC_PRETRANSLATE File associated with the specified action type will be returned, if the action was completed. |
language required | string Requested language of the file. Please note different actions have different languages available. |
uid required | string UID of the operation. See File translations endpoint. |
Accept required | string Media type which caller expects as a response. |
--Boundary_1_1453803947_1691603987728 Content-Type: application/octet-stream Content-Disposition: form-data; name="file"; filename="test.txt" Přeložený text --Boundary_1_1453803947_1691603987728 Content-Type: application/json Content-Disposition: form-data; name="metadata" {"sourceLang":{"code":"en"},"targetLangs":[{"code":"cs"}],"actionTypes":["MT_GENERIC_PRETRANSLATE"],"callbackUrl":"https://your-server.com/send/data/here"} --Boundary_1_1453803947_1691603987728--
Allows the fetching of metadata from the processing file. The completed file can be downloaded using the File download endpoint.
uid required | string UID of the operation. See File translations endpoint. |
{- "uid": "random-uid",
- "actions": [
- {
- "actionType": "MT_GENERIC_PRETRANSLATE",
- "results": [
- {
- "id": "random-uid",
- "sourceLang": "en",
- "targetLang": "cs",
- "status": "OK"
}
]
}
], - "metadata": {
- "sourceLang": {
- "code": "cs"
}, - "targetLangs": [
- {
- "code": "cs"
}
], - "actionTypes": [
- "MT_GENERIC_PRETRANSLATE"
], - "mtSettings": {
- "usePhraseMTSettings": true,
- "profile": {
- "uid": "CFUki8ptanoz1WAIYoXSH4"
}
}, - "transMemoriesConfig": [
- {
- "targetLang": {
- "code": "cs"
}, - "transMemories": [
- {
- "transMemory": {
- "uid": "string"
}, - "tmSourceLocale": {
- "code": "cs"
}, - "tmTargetLocale": {
- "code": "cs"
}
}
]
}
]
}
}
Allows the authentication of a user and to get the token to be used in the Authorization header.
Returns information about the user with the token to be used in the Authorization header and its expiration date.
password required | string |
userName required | string |
object (OrganizationUidV1) | |
otpCode | string |
{- "userName": "string",
- "password": "string",
- "otpCode": "string",
- "organization": {
- "uid": "string"
}
}
{- "token": "string",
- "tokenType": "Bearer",
- "expires": "string"
}
Allows the translation of text content utilizing Phrase Language AI capabilities. APIs are synchronous, designed for quick turnaround and are limited in size of the request.
Translates the text content utilizing Phrase Language AI capabilities. Can identify the source language, if not provided, and translate the text to the target language. If language identification is requested, system needs to have at least 50 characters.
sourceText required | string [ 1 .. 2000 ] |
required | object (LanguageV1) |
object (MtSettingSimplifiedV1) | |
object (LanguageV1) |
{- "sourceLang": {
- "code": "en"
}, - "sourceText": "Hello, world!",
- "targetLang": {
- "code": "cs"
}, - "mtSettings": {
- "profile": {
- "uid": "CFUki8ptanoz1WAIYoXSH4"
}
}
}
{- "sourceLang": {
- "code": "en"
}, - "translatedText": "Ahoj, světe!",
- "targetLang": {
- "code": "cs"
}
}
Translates the text content utilizing Phrase Language AI capabilities. Can identify the source language, if not provided, and translate the text to the target language. If language identification is requested, system needs to have at least 50 characters.
consumerId required | string (ConsumerIdV2) [ 1 .. 50 ] characters Use short descriptive ID that represents the calling integration. E.g. JIRA_INTEGRATION, GDRIVE_SYNC, SHOPIFY_EXT:v1.2 etc. |
required | Array of objects (SourceTextRequestV2) [ 1 .. 6 ] items |
required | object (LanguageV1) |
object (MtSettingSimplifiedV1) | |
object (LanguageV1) |
{- "sourceLang": {
- "code": "en"
}, - "sourceTexts": [
- {
- "key": "key1",
- "source": "Hello, world!"
}
], - "targetLang": {
- "code": "cs"
}, - "mtSettings": {
- "profile": {
- "uid": "CFUki8ptanoz1WAIYoXSH4"
}
}, - "consumerId": "consumer1"
}
{- "sourceLang": {
- "code": "en"
}, - "translatedTexts": [
- {
- "key": "key1",
- "target": "Ahoj, světe!"
}
], - "targetLang": {
- "code": "cs"
}, - "consumerId": "consumer1"
}
List available Language AI profiles for the user.
name | string Filter by name |
order | string Default: "asc" Enum: "asc" "desc" desc |
pageNumber | integer <int32> >= 0 Default: 0 Page number, starting with 0, default 0 |
pageSize | integer <int32> [ 1 .. 50 ] Default: 10 Page size, accepts values between 1 and 50, default 10 |
sort | string Default: "name" Enum: "name" "dateCreated" Sort by |
{- "pageNumber": 0,
- "content": [
- {
- "uid": "string",
- "name": "string",
- "engines": [
- {
- "id": "string",
- "uid": "string",
- "baseName": "string",
- "name": "string",
- "type": "string",
- "category": "string",
- "enabled": true,
- "glossarySupported": true
}
], - "glossaries": [
- {
- "uid": "string",
- "name": "string"
}
], - "dateCreated": "string"
}
], - "numberOfElements": 0,
- "totalElements": 0,
- "pageSize": 0,
- "totalPages": 0
}