Get macro translations
curl --request GET \
--url http://localhost:8080/macros/{id}/translations \
--header 'Authorization: Bearer <token>'import requests
url = "http://localhost:8080/macros/{id}/translations"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('http://localhost:8080/macros/{id}/translations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8080",
CURLOPT_URL => "http://localhost:8080/macros/{id}/translations",
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 := "http://localhost:8080/macros/{id}/translations"
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("http://localhost:8080/macros/{id}/translations")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8080/macros/{id}/translations")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"saved_reply_id": "<string>",
"source_language": "<string>",
"items": [
{
"language": "<string>",
"status": "pending",
"title": "<string>",
"content": "<string>",
"options": [
{
"id": "<string>",
"label": "<string>"
}
],
"updated_at": "2023-11-07T05:31:56Z"
}
]
}{
"statusCode": 123,
"message": "<string>",
"error": "<string>"
}Macros
Get macro translations
See one macro’s translation into each chosen language: its status and the translated title, body, and option labels. Read-only generated copies.
GET
/
macros
/
{id}
/
translations
Get macro translations
curl --request GET \
--url http://localhost:8080/macros/{id}/translations \
--header 'Authorization: Bearer <token>'import requests
url = "http://localhost:8080/macros/{id}/translations"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('http://localhost:8080/macros/{id}/translations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8080",
CURLOPT_URL => "http://localhost:8080/macros/{id}/translations",
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 := "http://localhost:8080/macros/{id}/translations"
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("http://localhost:8080/macros/{id}/translations")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8080/macros/{id}/translations")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"saved_reply_id": "<string>",
"source_language": "<string>",
"items": [
{
"language": "<string>",
"status": "pending",
"title": "<string>",
"content": "<string>",
"options": [
{
"id": "<string>",
"label": "<string>"
}
],
"updated_at": "2023-11-07T05:31:56Z"
}
]
}{
"statusCode": 123,
"message": "<string>",
"error": "<string>"
}Statuses
Each item is one chosen language:ready— translated, and made from the macro as it is now.pending— being translated, or the macro changed since the last translation. It becomesreadyby itself.failed— could not be translated. Use Retranslate a macro to try again.
title and content are empty and options is an empty list until the item is ready. source_language is the language the macro is written in, or null until it has been detected. It gets no translation of its own. items is empty when no translation languages are chosen.
Translations are generated copies and cannot be edited: edit the macro itself and they refresh.Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Macro ID
Pattern:
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$Was this page helpful?