Get a translation
curl --request GET \
--url https://api.usertour.io/v2/projects/{projectId}/content/{contentId}/versions/{versionId}/localizations/{code} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.usertour.io/v2/projects/{projectId}/content/{contentId}/versions/{versionId}/localizations/{code}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.usertour.io/v2/projects/{projectId}/content/{contentId}/versions/{versionId}/localizations/{code}', 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.usertour.io/v2/projects/{projectId}/content/{contentId}/versions/{versionId}/localizations/{code}",
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: 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://api.usertour.io/v2/projects/{projectId}/content/{contentId}/versions/{versionId}/localizations/{code}"
req, _ := http.NewRequest("GET", url, nil)
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://api.usertour.io/v2/projects/{projectId}/content/{contentId}/versions/{versionId}/localizations/{code}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.usertour.io/v2/projects/{projectId}/content/{contentId}/versions/{versionId}/localizations/{code}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"object": "contentVersionLocalization",
"versionId": "<string>",
"code": "<string>",
"name": "<string>",
"enabled": true,
"stats": {
"total": 123,
"missing": 123,
"outdated": 123
},
"units": [
{
"path": "<string>",
"source": "<string>",
"translation": "<string>",
"optional": true,
"outdated": true
}
],
"updatedAt": "2023-11-07T05:31:56Z"
}{
"error": {
"code": "<string>",
"message": "<string>",
"issues": [
{
"rule": "<string>",
"message": "<string>",
"path": "<string>"
}
],
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"issues": [
{
"rule": "<string>",
"message": "<string>",
"path": "<string>"
}
],
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"issues": [
{
"rule": "<string>",
"message": "<string>",
"path": "<string>"
}
],
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"issues": [
{
"rule": "<string>",
"message": "<string>",
"path": "<string>"
}
],
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"issues": [
{
"rule": "<string>",
"message": "<string>",
"path": "<string>"
}
],
"doc_url": "<string>"
}
}Content versions
Get a translation
Every translatable unit of the version for one locale: source text, current translation, and whether the source changed since it was translated (outdated). A locale that was never translated returns all units with empty translations. The code is one of the project’s non-default locales — see List localizations.
GET
/
v2
/
projects
/
{projectId}
/
content
/
{contentId}
/
versions
/
{versionId}
/
localizations
/
{code}
Get a translation
curl --request GET \
--url https://api.usertour.io/v2/projects/{projectId}/content/{contentId}/versions/{versionId}/localizations/{code} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.usertour.io/v2/projects/{projectId}/content/{contentId}/versions/{versionId}/localizations/{code}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.usertour.io/v2/projects/{projectId}/content/{contentId}/versions/{versionId}/localizations/{code}', 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.usertour.io/v2/projects/{projectId}/content/{contentId}/versions/{versionId}/localizations/{code}",
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: 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://api.usertour.io/v2/projects/{projectId}/content/{contentId}/versions/{versionId}/localizations/{code}"
req, _ := http.NewRequest("GET", url, nil)
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://api.usertour.io/v2/projects/{projectId}/content/{contentId}/versions/{versionId}/localizations/{code}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.usertour.io/v2/projects/{projectId}/content/{contentId}/versions/{versionId}/localizations/{code}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"object": "contentVersionLocalization",
"versionId": "<string>",
"code": "<string>",
"name": "<string>",
"enabled": true,
"stats": {
"total": 123,
"missing": 123,
"outdated": 123
},
"units": [
{
"path": "<string>",
"source": "<string>",
"translation": "<string>",
"optional": true,
"outdated": true
}
],
"updatedAt": "2023-11-07T05:31:56Z"
}{
"error": {
"code": "<string>",
"message": "<string>",
"issues": [
{
"rule": "<string>",
"message": "<string>",
"path": "<string>"
}
],
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"issues": [
{
"rule": "<string>",
"message": "<string>",
"path": "<string>"
}
],
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"issues": [
{
"rule": "<string>",
"message": "<string>",
"path": "<string>"
}
],
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"issues": [
{
"rule": "<string>",
"message": "<string>",
"path": "<string>"
}
],
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"issues": [
{
"rule": "<string>",
"message": "<string>",
"path": "<string>"
}
],
"doc_url": "<string>"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Project ID
Content ID
Content version ID
Localization code (not the default locale)
Response
Version translation
Available options:
contentVersionLocalization Whether this translation is delivered. A disabled (or missing) translation means users of that locale see the source language.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
When the translation was last saved; null when it was never saved.