Action result
curl --request GET \
--url https://eu.phrase.com/smt/api/v1/fileTranslations/{uid}/{actionType}/{language} \
--header 'Accept: <accept>' \
--header 'Authorization: Bearer <token>'import requests
url = "https://eu.phrase.com/smt/api/v1/fileTranslations/{uid}/{actionType}/{language}"
headers = {
"Accept": "<accept>",
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Accept: '<accept>', Authorization: 'Bearer <token>'}};
fetch('https://eu.phrase.com/smt/api/v1/fileTranslations/{uid}/{actionType}/{language}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://eu.phrase.com/smt/api/v1/fileTranslations/{uid}/{actionType}/{language}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Accept: <accept>",
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://eu.phrase.com/smt/api/v1/fileTranslations/{uid}/{actionType}/{language}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Accept", "<accept>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://eu.phrase.com/smt/api/v1/fileTranslations/{uid}/{actionType}/{language}")
.header("Accept", "<accept>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://eu.phrase.com/smt/api/v1/fileTranslations/{uid}/{actionType}/{language}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Accept"] = '<accept>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"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"
}
}
]
}
]
},
"file": "<string>"
}File translations
Action result
Use the Accept header with either application/octet-stream to get the file or use application/json to get the quality estimation.
GET
/
v1
/
fileTranslations
/
{uid}
/
{actionType}
/
{language}
Action result
curl --request GET \
--url https://eu.phrase.com/smt/api/v1/fileTranslations/{uid}/{actionType}/{language} \
--header 'Accept: <accept>' \
--header 'Authorization: Bearer <token>'import requests
url = "https://eu.phrase.com/smt/api/v1/fileTranslations/{uid}/{actionType}/{language}"
headers = {
"Accept": "<accept>",
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Accept: '<accept>', Authorization: 'Bearer <token>'}};
fetch('https://eu.phrase.com/smt/api/v1/fileTranslations/{uid}/{actionType}/{language}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://eu.phrase.com/smt/api/v1/fileTranslations/{uid}/{actionType}/{language}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Accept: <accept>",
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://eu.phrase.com/smt/api/v1/fileTranslations/{uid}/{actionType}/{language}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Accept", "<accept>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://eu.phrase.com/smt/api/v1/fileTranslations/{uid}/{actionType}/{language}")
.header("Accept", "<accept>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://eu.phrase.com/smt/api/v1/fileTranslations/{uid}/{actionType}/{language}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Accept"] = '<accept>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"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"
}
}
]
}
]
},
"file": "<string>"
}Authorizations
Headers
Media type which caller expects as a response.
Path Parameters
UID of the operation. See File translations endpoint.
File associated with the specified action type will be returned, if the action was completed.
Available options:
CONVERTER_IMPORT, FILE_IMPORT, MT_GENERIC_PRETRANSLATE, QUALITY_ESTIMATION Example:
"MT_GENERIC_PRETRANSLATE"
Requested language of the file. Please note different actions have different languages available.
Was this page helpful?
⌘I