Skip to main content
POST
/
v1
/
fileTranslations
curl --request POST \
  --url https://eu.phrase.com/smt/api/v1/fileTranslations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: multipart/form-data'
{
  "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"
    ],
    "callbackUrl": "<string>",
    "mtSettings": {
      "usePhraseMTSettings": true,
      "profile": {
        "uid": "CFUki8ptanoz1WAIYoXSH4"
      }
    },
    "transMemoriesConfig": [
      {
        "targetLang": {
          "code": "cs"
        },
        "transMemories": [
          {
            "transMemory": {
              "uid": "<string>"
            },
            "tmSourceLocale": {
              "code": "cs"
            },
            "tmTargetLocale": {
              "code": "cs"
            }
          }
        ]
      }
    ]
  }
}

Authorizations

Authorization
string
header
required

Provide Authorization header with token obtained through Login operation.

Body

multipart/form-data

Source file with the metadata used for the translation process. Multipart request with metadata and file parts. Metadata accepts the following actionTypes:

Action TypeDescription
FILE_IMPORTImports the file into the system
CONVERTER_IMPORTExtracts the translatable texts out of the file
MT_GENERIC_PRETRANSLATETranslates the extracted text
QUALITY_ESTIMATIONReturns 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

metadata
object
required
file
file
required

Response

Response with UID of the file translations request.

uid
string
required

UID of the operation. UID can be used to query the result.

Example:

"random-uid"

actions
object[]
required
Minimum array length: 1
metadata
object
required