Translate a form into one or more languages
curl --request POST \
--url https://api.octaviatech.app/cms/ai/translateForm \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"formId": "{{objectId}}",
"targetLanguages": [
"en",
"ar",
"tr"
],
"sourceLanguage": "en"
}
'import requests
url = "https://api.octaviatech.app/cms/ai/translateForm"
payload = {
"formId": "{{objectId}}",
"targetLanguages": ["en", "ar", "tr"],
"sourceLanguage": "en"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
formId: '{{objectId}}',
targetLanguages: ['en', 'ar', 'tr'],
sourceLanguage: 'en'
})
};
fetch('https://api.octaviatech.app/cms/ai/translateForm', 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/ai/translateForm",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'formId' => '{{objectId}}',
'targetLanguages' => [
'en',
'ar',
'tr'
],
'sourceLanguage' => 'en'
]),
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/ai/translateForm"
payload := strings.NewReader("{\n \"formId\": \"{{objectId}}\",\n \"targetLanguages\": [\n \"en\",\n \"ar\",\n \"tr\"\n ],\n \"sourceLanguage\": \"en\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.octaviatech.app/cms/ai/translateForm")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"formId\": \"{{objectId}}\",\n \"targetLanguages\": [\n \"en\",\n \"ar\",\n \"tr\"\n ],\n \"sourceLanguage\": \"en\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.octaviatech.app/cms/ai/translateForm")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"formId\": \"{{objectId}}\",\n \"targetLanguages\": [\n \"en\",\n \"ar\",\n \"tr\"\n ],\n \"sourceLanguage\": \"en\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"statusCode": 200,
"message": "Form translated successfully",
"data": {
"formId": "{{objectId}}",
"sourceLanguage": "en",
"targetLanguages": [
"en",
"ar",
"tr"
],
"translations": {
"en": {
"title": "Contact us",
"description": "…",
"submitButtonText": "Send",
"sections": [
{
"index": 0,
"title": "Your details",
"description": "…",
"fields": [
{
"name": "email",
"label": "Email address",
"placeholder": "you@example.com",
"options": []
}
]
}
]
}
}
}
}Text Tools
Translate Form
Translate Form.
POST
/
ai
/
translateForm
Translate a form into one or more languages
curl --request POST \
--url https://api.octaviatech.app/cms/ai/translateForm \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"formId": "{{objectId}}",
"targetLanguages": [
"en",
"ar",
"tr"
],
"sourceLanguage": "en"
}
'import requests
url = "https://api.octaviatech.app/cms/ai/translateForm"
payload = {
"formId": "{{objectId}}",
"targetLanguages": ["en", "ar", "tr"],
"sourceLanguage": "en"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
formId: '{{objectId}}',
targetLanguages: ['en', 'ar', 'tr'],
sourceLanguage: 'en'
})
};
fetch('https://api.octaviatech.app/cms/ai/translateForm', 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/ai/translateForm",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'formId' => '{{objectId}}',
'targetLanguages' => [
'en',
'ar',
'tr'
],
'sourceLanguage' => 'en'
]),
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/ai/translateForm"
payload := strings.NewReader("{\n \"formId\": \"{{objectId}}\",\n \"targetLanguages\": [\n \"en\",\n \"ar\",\n \"tr\"\n ],\n \"sourceLanguage\": \"en\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.octaviatech.app/cms/ai/translateForm")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"formId\": \"{{objectId}}\",\n \"targetLanguages\": [\n \"en\",\n \"ar\",\n \"tr\"\n ],\n \"sourceLanguage\": \"en\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.octaviatech.app/cms/ai/translateForm")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"formId\": \"{{objectId}}\",\n \"targetLanguages\": [\n \"en\",\n \"ar\",\n \"tr\"\n ],\n \"sourceLanguage\": \"en\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"statusCode": 200,
"message": "Form translated successfully",
"data": {
"formId": "{{objectId}}",
"sourceLanguage": "en",
"targetLanguages": [
"en",
"ar",
"tr"
],
"translations": {
"en": {
"title": "Contact us",
"description": "…",
"submitButtonText": "Send",
"sections": [
{
"index": 0,
"title": "Your details",
"description": "…",
"fields": [
{
"name": "email",
"label": "Email address",
"placeholder": "you@example.com",
"options": []
}
]
}
]
}
}
}
}Authorizations
Body
application/json
Example:
"{{objectId}}"
Target language codes; at least one is required
Minimum array length:
1Example:
["en", "ar", "tr"]
Source language; auto-detected from the form when omitted
Example:
"en"
Which parts of the form to translate. All flags default to true.
Show child attributes
Show child attributes
Response
OK (translated)
Was this page helpful?

