curl --request PUT \
--url http://localhost:8080/macros/settings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"translation_languages": [
"<string>"
]
}
'import requests
url = "http://localhost:8080/macros/settings"
payload = { "translation_languages": ["<string>"] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({translation_languages: ['<string>']})
};
fetch('http://localhost:8080/macros/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_PORT => "8080",
CURLOPT_URL => "http://localhost:8080/macros/settings",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'translation_languages' => [
'<string>'
]
]),
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 := "http://localhost:8080/macros/settings"
payload := strings.NewReader("{\n \"translation_languages\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("PUT", 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.put("http://localhost:8080/macros/settings")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"translation_languages\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8080/macros/settings")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"translation_languages\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"translation_languages": [
"<string>"
],
"max_translation_languages": 123,
"supported_translation_languages": [
"<string>"
],
"suggestions_enabled": true
}{
"statusCode": 123,
"message": "<string>",
"error": "<string>"
}Update macro settings
Choose the languages every org-wide macro is translated into. The list replaces the current one; send an empty list to turn macro translation off.
curl --request PUT \
--url http://localhost:8080/macros/settings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"translation_languages": [
"<string>"
]
}
'import requests
url = "http://localhost:8080/macros/settings"
payload = { "translation_languages": ["<string>"] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({translation_languages: ['<string>']})
};
fetch('http://localhost:8080/macros/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_PORT => "8080",
CURLOPT_URL => "http://localhost:8080/macros/settings",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'translation_languages' => [
'<string>'
]
]),
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 := "http://localhost:8080/macros/settings"
payload := strings.NewReader("{\n \"translation_languages\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("PUT", 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.put("http://localhost:8080/macros/settings")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"translation_languages\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8080/macros/settings")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"translation_languages\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"translation_languages": [
"<string>"
],
"max_translation_languages": 123,
"supported_translation_languages": [
"<string>"
],
"suggestions_enabled": true
}{
"statusCode": 123,
"message": "<string>",
"error": "<string>"
}Choosing languages
translation_languages is the full list and replaces the current one. Read it with Get macro settings first and send every language you want to keep. Send at most 10 lower-case codes such as es, each one of supported_translation_languages, with no repeats; anything else is rejected with a 400. An empty list turns macro translation off.
{ "translation_languages": ["es", "fr", "de"] }
suggestions_enabled appears in the response but cannot be changed here. Turn suggested macros on or off for the workspace in Settings → Workspace → Suggested macros.Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
The full list of language codes (lower-case, such as es; at most 10, each from supported_translation_languages, no repeats) to translate every org-wide macro into. It replaces the current list, so send every language you want to keep. [] turns macro translation off.
10Response
Default Response
Language codes (lower-case, such as es) every org-wide macro is translated into, in the order they were chosen. Empty means macro translation is off.
The most languages that can be chosen.
The language codes that can be chosen.
Whether suggested macros are on for the workspace. When off, no agent sees them.
Was this page helpful?