curl --request GET \
--url https://api.phrase.com/v2/accounts/{account_id}/machine_translation_settings \
--header 'Authorization: Basic <encoded-value>'import requests
url = "https://api.phrase.com/v2/accounts/{account_id}/machine_translation_settings"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Basic <encoded-value>'}};
fetch('https://api.phrase.com/v2/accounts/{account_id}/machine_translation_settings', 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.phrase.com/v2/accounts/{account_id}/machine_translation_settings",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>"
],
]);
$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://api.phrase.com/v2/accounts/{account_id}/machine_translation_settings"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Basic <encoded-value>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.phrase.com/v2/accounts/{account_id}/machine_translation_settings")
.header("Authorization", "Basic <encoded-value>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.phrase.com/v2/accounts/{account_id}/machine_translation_settings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic <encoded-value>'
response = http.request(request)
puts response.read_body{
"default_service": "google_translate",
"machine_translation_units_used": 12500,
"machine_translation_units_total": 1000000,
"locale_provider_mappings": [
{
"source_locale_code": "en",
"target_locale_code": "de",
"service": "google_translate"
}
]
}Get machine translation settings
Returns the machine translation configuration for the account, including the default translation service, current machine translation unit usage, and any locale-pair-specific provider mappings.
curl --request GET \
--url https://api.phrase.com/v2/accounts/{account_id}/machine_translation_settings \
--header 'Authorization: Basic <encoded-value>'import requests
url = "https://api.phrase.com/v2/accounts/{account_id}/machine_translation_settings"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Basic <encoded-value>'}};
fetch('https://api.phrase.com/v2/accounts/{account_id}/machine_translation_settings', 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.phrase.com/v2/accounts/{account_id}/machine_translation_settings",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>"
],
]);
$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://api.phrase.com/v2/accounts/{account_id}/machine_translation_settings"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Basic <encoded-value>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.phrase.com/v2/accounts/{account_id}/machine_translation_settings")
.header("Authorization", "Basic <encoded-value>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.phrase.com/v2/accounts/{account_id}/machine_translation_settings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic <encoded-value>'
response = http.request(request)
puts response.read_body{
"default_service": "google_translate",
"machine_translation_units_used": 12500,
"machine_translation_units_total": 1000000,
"locale_provider_mappings": [
{
"source_locale_code": "en",
"target_locale_code": "de",
"service": "google_translate"
}
]
}Authorizations
Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.
Headers
Two-Factor-Authentication token (optional)
Path Parameters
Account ID
Response
OK
The default machine translation engine configured for the account. Returns "microsoft_translate" when no service has been explicitly configured. Supported values: language_ai_translate, aita_translate, microsoft_translate, google_translate, amazon_translate, intento_translate, gpt_translate.
"google_translate"
Number of machine translation characters consumed in the current billing period.
12500
Total machine translation character quota granted for the current billing period.
1000000
Per-locale-pair provider overrides. When a matching mapping exists for a source/target locale pair, that provider takes precedence over the account default.
Show child attributes
Show child attributes
Was this page helpful?