Evaluate segments
curl --request POST \
--url https://eu.phrase.com/quality-evaluator/v3/evaluation \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: <content-type>' \
--data '
{
"contentGroupId": "cg-abc123",
"segments": [
{
"id": "seg-1",
"source": "Sample sentence.",
"target": "Einige deutsche Wörter."
}
],
"sourceLocaleCode": "en_gb",
"targetLocaleCode": "de_de"
}
'import requests
url = "https://eu.phrase.com/quality-evaluator/v3/evaluation"
payload = {
"contentGroupId": "cg-abc123",
"segments": [
{
"id": "seg-1",
"source": "Sample sentence.",
"target": "Einige deutsche Wörter."
}
],
"sourceLocaleCode": "en_gb",
"targetLocaleCode": "de_de"
}
headers = {
"Content-Type": "<content-type>",
"Authorization": "Bearer <token>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': '<content-type>', Authorization: 'Bearer <token>'},
body: JSON.stringify({
contentGroupId: 'cg-abc123',
segments: [{id: 'seg-1', source: 'Sample sentence.', target: 'Einige deutsche Wörter.'}],
sourceLocaleCode: 'en_gb',
targetLocaleCode: 'de_de'
})
};
fetch('https://eu.phrase.com/quality-evaluator/v3/evaluation', 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/quality-evaluator/v3/evaluation",
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([
'contentGroupId' => 'cg-abc123',
'segments' => [
[
'id' => 'seg-1',
'source' => 'Sample sentence.',
'target' => 'Einige deutsche Wörter.'
]
],
'sourceLocaleCode' => 'en_gb',
'targetLocaleCode' => 'de_de'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: <content-type>"
],
]);
$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://eu.phrase.com/quality-evaluator/v3/evaluation"
payload := strings.NewReader("{\n \"contentGroupId\": \"cg-abc123\",\n \"segments\": [\n {\n \"id\": \"seg-1\",\n \"source\": \"Sample sentence.\",\n \"target\": \"Einige deutsche Wörter.\"\n }\n ],\n \"sourceLocaleCode\": \"en_gb\",\n \"targetLocaleCode\": \"de_de\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "<content-type>")
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.post("https://eu.phrase.com/quality-evaluator/v3/evaluation")
.header("Content-Type", "<content-type>")
.header("Authorization", "Bearer <token>")
.body("{\n \"contentGroupId\": \"cg-abc123\",\n \"segments\": [\n {\n \"id\": \"seg-1\",\n \"source\": \"Sample sentence.\",\n \"target\": \"Einige deutsche Wörter.\"\n }\n ],\n \"sourceLocaleCode\": \"en_gb\",\n \"targetLocaleCode\": \"de_de\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://eu.phrase.com/quality-evaluator/v3/evaluation")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = '<content-type>'
request["Authorization"] = 'Bearer <token>'
request.body = "{\n \"contentGroupId\": \"cg-abc123\",\n \"segments\": [\n {\n \"id\": \"seg-1\",\n \"source\": \"Sample sentence.\",\n \"target\": \"Einige deutsche Wörter.\"\n }\n ],\n \"sourceLocaleCode\": \"en_gb\",\n \"targetLocaleCode\": \"de_de\"\n}"
response = http.request(request)
puts response.read_body{
"contentGroupId": "cg-abc123",
"segments": [
{
"id": "segment-1",
"source": "Hello, world!",
"target": "Hallo, Welt!",
"results": [
{
"type": "AI_CHECK",
"ruleUid": "rule-abc123",
"evaluation": {
"isValid": true,
"explanation": "The translation uses standard German sentence structure.",
"hasError": false,
"errorMessage": null
}
}
]
}
],
"evaluationHistoryId": "1f0f1d7e-7b8c-4a47-9a8e-5d3c6e2b9a10"
}Evaluation
Evaluate segments
Resolves the AI Checks (Style Guide Rules with AI Check enabled) that apply to the given Content Group and target locale, and evaluates every segment against each of them.
Requires a valid Platform IDM token of an organization with the Quality Evaluation entitlement.
When no checks are associated with the Content Group, all segments are returned with an empty results array and no error is raised. Segments with an empty or blank target are not evaluated and are returned with an empty results array.
POST
/
v3
/
evaluation
Evaluate segments
curl --request POST \
--url https://eu.phrase.com/quality-evaluator/v3/evaluation \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: <content-type>' \
--data '
{
"contentGroupId": "cg-abc123",
"segments": [
{
"id": "seg-1",
"source": "Sample sentence.",
"target": "Einige deutsche Wörter."
}
],
"sourceLocaleCode": "en_gb",
"targetLocaleCode": "de_de"
}
'import requests
url = "https://eu.phrase.com/quality-evaluator/v3/evaluation"
payload = {
"contentGroupId": "cg-abc123",
"segments": [
{
"id": "seg-1",
"source": "Sample sentence.",
"target": "Einige deutsche Wörter."
}
],
"sourceLocaleCode": "en_gb",
"targetLocaleCode": "de_de"
}
headers = {
"Content-Type": "<content-type>",
"Authorization": "Bearer <token>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': '<content-type>', Authorization: 'Bearer <token>'},
body: JSON.stringify({
contentGroupId: 'cg-abc123',
segments: [{id: 'seg-1', source: 'Sample sentence.', target: 'Einige deutsche Wörter.'}],
sourceLocaleCode: 'en_gb',
targetLocaleCode: 'de_de'
})
};
fetch('https://eu.phrase.com/quality-evaluator/v3/evaluation', 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/quality-evaluator/v3/evaluation",
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([
'contentGroupId' => 'cg-abc123',
'segments' => [
[
'id' => 'seg-1',
'source' => 'Sample sentence.',
'target' => 'Einige deutsche Wörter.'
]
],
'sourceLocaleCode' => 'en_gb',
'targetLocaleCode' => 'de_de'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: <content-type>"
],
]);
$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://eu.phrase.com/quality-evaluator/v3/evaluation"
payload := strings.NewReader("{\n \"contentGroupId\": \"cg-abc123\",\n \"segments\": [\n {\n \"id\": \"seg-1\",\n \"source\": \"Sample sentence.\",\n \"target\": \"Einige deutsche Wörter.\"\n }\n ],\n \"sourceLocaleCode\": \"en_gb\",\n \"targetLocaleCode\": \"de_de\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "<content-type>")
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.post("https://eu.phrase.com/quality-evaluator/v3/evaluation")
.header("Content-Type", "<content-type>")
.header("Authorization", "Bearer <token>")
.body("{\n \"contentGroupId\": \"cg-abc123\",\n \"segments\": [\n {\n \"id\": \"seg-1\",\n \"source\": \"Sample sentence.\",\n \"target\": \"Einige deutsche Wörter.\"\n }\n ],\n \"sourceLocaleCode\": \"en_gb\",\n \"targetLocaleCode\": \"de_de\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://eu.phrase.com/quality-evaluator/v3/evaluation")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = '<content-type>'
request["Authorization"] = 'Bearer <token>'
request.body = "{\n \"contentGroupId\": \"cg-abc123\",\n \"segments\": [\n {\n \"id\": \"seg-1\",\n \"source\": \"Sample sentence.\",\n \"target\": \"Einige deutsche Wörter.\"\n }\n ],\n \"sourceLocaleCode\": \"en_gb\",\n \"targetLocaleCode\": \"de_de\"\n}"
response = http.request(request)
puts response.read_body{
"contentGroupId": "cg-abc123",
"segments": [
{
"id": "segment-1",
"source": "Hello, world!",
"target": "Hallo, Welt!",
"results": [
{
"type": "AI_CHECK",
"ruleUid": "rule-abc123",
"evaluation": {
"isValid": true,
"explanation": "The translation uses standard German sentence structure.",
"hasError": false,
"errorMessage": null
}
}
]
}
],
"evaluationHistoryId": "1f0f1d7e-7b8c-4a47-9a8e-5d3c6e2b9a10"
}Authorizations
Headers
Body
application/json
Request to evaluate translation segments using the AI Checks resolved from a Content Group.
Response
Evaluation completed successfully. Returns the evaluated segments with the per-check results.
Evaluation results for the v3 endpoint.
Was this page helpful?