CATEGORIES
List Category Translation
Returns all the locales for which translation is uploaded for preference categories.
GET
/
v1
/
{workspace}
/
preference_category
/
translation
/
locale
/
List Translation
curl -X GET "https://management-api.suprsend.com/v1/{workspace}/preference_category/translation/locale/" \
--header "Authorization: ServiceToken {token}" \
--header "Content-Type: application/json"import requests
url = "https://management-api.suprsend.com/v1/{workspace}/preference_category/translation/locale/"
headers = {"ServiceToken <token>": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'ServiceToken <token>': '<api-key>'}};
fetch('https://management-api.suprsend.com/v1/{workspace}/preference_category/translation/locale/', 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://management-api.suprsend.com/v1/{workspace}/preference_category/translation/locale/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"ServiceToken <token>: <api-key>"
],
]);
$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://management-api.suprsend.com/v1/{workspace}/preference_category/translation/locale/"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("ServiceToken <token>", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://management-api.suprsend.com/v1/{workspace}/preference_category/translation/locale/")
.header("ServiceToken <token>", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://management-api.suprsend.com/v1/{workspace}/preference_category/translation/locale/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["ServiceToken <token>"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"results": [
{
"locale": "en"
},
{
"locale": "en-NA"
},
{
"locale": "es"
},
{
"locale": "es-AR"
},
{
"locale": "es-BO"
}
]
}{
"code": 401,
"message": "ServiceToken not found"
}{
"code": 404,
"message": "workspace not found for slug/uid: workspace"
}Authorizations
You can get Service Token from SuprSend dashboard -> Account Settings -> Service Tokens section.
Path Parameters
Workspace slug (staging, production, etc.)
Response
Successfully retrieved list of translation locales
Array of locale objects for which translations are available
Show child attributes
Show child attributes
Was this page helpful?
Previous
Get TranslationFetch translation content for a given locale for preference categories and sections.
Next
⌘I
List Translation
curl -X GET "https://management-api.suprsend.com/v1/{workspace}/preference_category/translation/locale/" \
--header "Authorization: ServiceToken {token}" \
--header "Content-Type: application/json"import requests
url = "https://management-api.suprsend.com/v1/{workspace}/preference_category/translation/locale/"
headers = {"ServiceToken <token>": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'ServiceToken <token>': '<api-key>'}};
fetch('https://management-api.suprsend.com/v1/{workspace}/preference_category/translation/locale/', 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://management-api.suprsend.com/v1/{workspace}/preference_category/translation/locale/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"ServiceToken <token>: <api-key>"
],
]);
$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://management-api.suprsend.com/v1/{workspace}/preference_category/translation/locale/"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("ServiceToken <token>", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://management-api.suprsend.com/v1/{workspace}/preference_category/translation/locale/")
.header("ServiceToken <token>", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://management-api.suprsend.com/v1/{workspace}/preference_category/translation/locale/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["ServiceToken <token>"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"results": [
{
"locale": "en"
},
{
"locale": "en-NA"
},
{
"locale": "es"
},
{
"locale": "es-AR"
},
{
"locale": "es-BO"
}
]
}{
"code": 401,
"message": "ServiceToken not found"
}{
"code": 404,
"message": "workspace not found for slug/uid: workspace"
}