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:

<table style="font-size: .8rem; font-family: Roboto, sans-serif;"> <thead> <th>Action Type</th> <th>Description</th> </thead> <tbody> <tr> <td>FILE_IMPORT</td> <td>Imports the file into the system</td> </tr> <tr> <td>CONVERTER_IMPORT</td> <td>Extracts the translatable texts out of the file</td> </tr> <tr> <td>MT_GENERIC_PRETRANSLATE</td> <td>Translates the extracted text</td> </tr> <tr> <td>QUALITY_ESTIMATION</td> <td>Returns Phrase Quality Performance Score (QPS)</td> </tr> </tbody> </table>

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

The body is of type object.

Response

200
application/json

Response with UID of the file translations request.

The response is of type object.