Get a language by id
curl --request GET \
--url https://api.octaviatech.app/cms/languages/getById \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"id": "64b1f2c9a7d4f1a2b3c4d5e6"
}
'import requests
url = "https://api.octaviatech.app/cms/languages/getById"
payload = { "id": "64b1f2c9a7d4f1a2b3c4d5e6" }
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.get(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({id: '64b1f2c9a7d4f1a2b3c4d5e6'})
};
fetch('https://api.octaviatech.app/cms/languages/getById', 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.octaviatech.app/cms/languages/getById",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => json_encode([
'id' => '64b1f2c9a7d4f1a2b3c4d5e6'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.octaviatech.app/cms/languages/getById"
payload := strings.NewReader("{\n \"id\": \"64b1f2c9a7d4f1a2b3c4d5e6\"\n}")
req, _ := http.NewRequest("GET", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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.get("https://api.octaviatech.app/cms/languages/getById")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"64b1f2c9a7d4f1a2b3c4d5e6\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.octaviatech.app/cms/languages/getById")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": \"64b1f2c9a7d4f1a2b3c4d5e6\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"statusCode": 200,
"message": "Language retrieved successfully",
"data": {
"_id": "64b1f2c9a7d4f1a2b3c4d5e6",
"code": "en",
"name": "English",
"isActive": true
}
}Languages
Get a language by id
Fetch a single language for the current tenant using its identifier.
Request body:
id(string, required): The language identifier. Must be a 24-character hexadecimal string. Note: despite the endpoint using GET, the identifier is read from the request body, not from the query string.
Behavior:
- Returns 404 if the identifier does not match a language owned by the current tenant.
GET
/
languages
/
getById
Get a language by id
curl --request GET \
--url https://api.octaviatech.app/cms/languages/getById \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"id": "64b1f2c9a7d4f1a2b3c4d5e6"
}
'import requests
url = "https://api.octaviatech.app/cms/languages/getById"
payload = { "id": "64b1f2c9a7d4f1a2b3c4d5e6" }
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.get(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({id: '64b1f2c9a7d4f1a2b3c4d5e6'})
};
fetch('https://api.octaviatech.app/cms/languages/getById', 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.octaviatech.app/cms/languages/getById",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => json_encode([
'id' => '64b1f2c9a7d4f1a2b3c4d5e6'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.octaviatech.app/cms/languages/getById"
payload := strings.NewReader("{\n \"id\": \"64b1f2c9a7d4f1a2b3c4d5e6\"\n}")
req, _ := http.NewRequest("GET", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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.get("https://api.octaviatech.app/cms/languages/getById")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"64b1f2c9a7d4f1a2b3c4d5e6\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.octaviatech.app/cms/languages/getById")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": \"64b1f2c9a7d4f1a2b3c4d5e6\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"statusCode": 200,
"message": "Language retrieved successfully",
"data": {
"_id": "64b1f2c9a7d4f1a2b3c4d5e6",
"code": "en",
"name": "English",
"isActive": true
}
}Was this page helpful?

