Get supported language pairs
curl --request POST \
--url https://api.mtengine.example.com/languages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"metadata": {
"formality": "informal",
"model": "model123",
"domain": "legal",
"project_uid": "{project_uid}",
"job_uid": "{job_uid}",
"idm_organization_uid": "{idm_organization_uid}"
}
}
'import requests
url = "https://api.mtengine.example.com/languages"
payload = { "metadata": {
"formality": "informal",
"model": "model123",
"domain": "legal",
"project_uid": "{project_uid}",
"job_uid": "{job_uid}",
"idm_organization_uid": "{idm_organization_uid}"
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
metadata: {
formality: 'informal',
model: 'model123',
domain: 'legal',
project_uid: '{project_uid}',
job_uid: '{job_uid}',
idm_organization_uid: '{idm_organization_uid}'
}
})
};
fetch('https://api.mtengine.example.com/languages', 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://api.mtengine.example.com/languages",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'metadata' => [
'formality' => 'informal',
'model' => 'model123',
'domain' => 'legal',
'project_uid' => '{project_uid}',
'job_uid' => '{job_uid}',
'idm_organization_uid' => '{idm_organization_uid}'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.mtengine.example.com/languages"
payload := strings.NewReader("{\n \"metadata\": {\n \"formality\": \"informal\",\n \"model\": \"model123\",\n \"domain\": \"legal\",\n \"project_uid\": \"{project_uid}\",\n \"job_uid\": \"{job_uid}\",\n \"idm_organization_uid\": \"{idm_organization_uid}\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.mtengine.example.com/languages")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"metadata\": {\n \"formality\": \"informal\",\n \"model\": \"model123\",\n \"domain\": \"legal\",\n \"project_uid\": \"{project_uid}\",\n \"job_uid\": \"{job_uid}\",\n \"idm_organization_uid\": \"{idm_organization_uid}\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mtengine.example.com/languages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"metadata\": {\n \"formality\": \"informal\",\n \"model\": \"model123\",\n \"domain\": \"legal\",\n \"project_uid\": \"{project_uid}\",\n \"job_uid\": \"{job_uid}\",\n \"idm_organization_uid\": \"{idm_organization_uid}\"\n }\n}"
response = http.request(request)
puts response.read_body{
"languagePairs": [
{
"sourceLanguage": "en",
"targetLanguage": "es"
}
]
}{
"error": "Unauthorized, Invalid token"
}Supported languages
Get supported language pairs
POST
/
languages
Get supported language pairs
curl --request POST \
--url https://api.mtengine.example.com/languages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"metadata": {
"formality": "informal",
"model": "model123",
"domain": "legal",
"project_uid": "{project_uid}",
"job_uid": "{job_uid}",
"idm_organization_uid": "{idm_organization_uid}"
}
}
'import requests
url = "https://api.mtengine.example.com/languages"
payload = { "metadata": {
"formality": "informal",
"model": "model123",
"domain": "legal",
"project_uid": "{project_uid}",
"job_uid": "{job_uid}",
"idm_organization_uid": "{idm_organization_uid}"
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
metadata: {
formality: 'informal',
model: 'model123',
domain: 'legal',
project_uid: '{project_uid}',
job_uid: '{job_uid}',
idm_organization_uid: '{idm_organization_uid}'
}
})
};
fetch('https://api.mtengine.example.com/languages', 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://api.mtengine.example.com/languages",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'metadata' => [
'formality' => 'informal',
'model' => 'model123',
'domain' => 'legal',
'project_uid' => '{project_uid}',
'job_uid' => '{job_uid}',
'idm_organization_uid' => '{idm_organization_uid}'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.mtengine.example.com/languages"
payload := strings.NewReader("{\n \"metadata\": {\n \"formality\": \"informal\",\n \"model\": \"model123\",\n \"domain\": \"legal\",\n \"project_uid\": \"{project_uid}\",\n \"job_uid\": \"{job_uid}\",\n \"idm_organization_uid\": \"{idm_organization_uid}\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.mtengine.example.com/languages")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"metadata\": {\n \"formality\": \"informal\",\n \"model\": \"model123\",\n \"domain\": \"legal\",\n \"project_uid\": \"{project_uid}\",\n \"job_uid\": \"{job_uid}\",\n \"idm_organization_uid\": \"{idm_organization_uid}\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mtengine.example.com/languages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"metadata\": {\n \"formality\": \"informal\",\n \"model\": \"model123\",\n \"domain\": \"legal\",\n \"project_uid\": \"{project_uid}\",\n \"job_uid\": \"{job_uid}\",\n \"idm_organization_uid\": \"{idm_organization_uid}\"\n }\n}"
response = http.request(request)
puts response.read_body{
"languagePairs": [
{
"sourceLanguage": "en",
"targetLanguage": "es"
}
]
}{
"error": "Unauthorized, Invalid token"
}Authorizations
OAuth2ApiKeyAuth
OAuth 2.0 for accessing the MT API. Supports client credentials (service-to-service).
Body
application/json
Any custom data in form of key/value pairs.
Phrase automatically resolves the following placeholders in request-level metadata values:
{project_uid}— TMS project UID{job_uid}— TMS job UID{idm_organization_uid}— Phrase organization UID
Show child attributes
Show child attributes
Example:
{
"formality": "informal",
"model": "model123",
"domain": "legal",
"project_uid": "{project_uid}",
"job_uid": "{job_uid}",
"idm_organization_uid": "{idm_organization_uid}"
}
Response
List of supported source-target language pairs (Phrase locale codes)
Show child attributes
Show child attributes
Was this page helpful?
⌘I