Update macro settings
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>"
}Macros
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.
PUT
/
macros
/
settings
Update macro settings
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 → Replies → Suggested macros.Authorizations
Body
application/json
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.
Maximum array length:
10Response
Default Response
Was this page helpful?