Save translation overlay
curl --request PUT \
--url https://api.example.com/v1/data-apps/{app_id}/translations/{locale} \
--header 'Content-Type: application/json' \
--data '
{
"entries": {},
"expected_revision": 123
}
'import requests
url = "https://api.example.com/v1/data-apps/{app_id}/translations/{locale}"
payload = {
"entries": {},
"expected_revision": 123
}
headers = {"Content-Type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({entries: {}, expected_revision: 123})
};
fetch('https://api.example.com/v1/data-apps/{app_id}/translations/{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://api.example.com/v1/data-apps/{app_id}/translations/{locale}",
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([
'entries' => [
],
'expected_revision' => 123
]),
CURLOPT_HTTPHEADER => [
"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 := "https://api.example.com/v1/data-apps/{app_id}/translations/{locale}"
payload := strings.NewReader("{\n \"entries\": {},\n \"expected_revision\": 123\n}")
req, _ := http.NewRequest("PUT", url, payload)
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("https://api.example.com/v1/data-apps/{app_id}/translations/{locale}")
.header("Content-Type", "application/json")
.body("{\n \"entries\": {},\n \"expected_revision\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/data-apps/{app_id}/translations/{locale}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"entries\": {},\n \"expected_revision\": 123\n}"
response = http.request(request)
puts response.read_bodyPublishing
Save translation overlay
Create or update a locale translation overlay for an app.
PUT
/
v1
/
data-apps
/
{app_id}
/
translations
/
{locale}
Save translation overlay
curl --request PUT \
--url https://api.example.com/v1/data-apps/{app_id}/translations/{locale} \
--header 'Content-Type: application/json' \
--data '
{
"entries": {},
"expected_revision": 123
}
'import requests
url = "https://api.example.com/v1/data-apps/{app_id}/translations/{locale}"
payload = {
"entries": {},
"expected_revision": 123
}
headers = {"Content-Type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({entries: {}, expected_revision: 123})
};
fetch('https://api.example.com/v1/data-apps/{app_id}/translations/{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://api.example.com/v1/data-apps/{app_id}/translations/{locale}",
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([
'entries' => [
],
'expected_revision' => 123
]),
CURLOPT_HTTPHEADER => [
"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 := "https://api.example.com/v1/data-apps/{app_id}/translations/{locale}"
payload := strings.NewReader("{\n \"entries\": {},\n \"expected_revision\": 123\n}")
req, _ := http.NewRequest("PUT", url, payload)
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("https://api.example.com/v1/data-apps/{app_id}/translations/{locale}")
.header("Content-Type", "application/json")
.body("{\n \"entries\": {},\n \"expected_revision\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/data-apps/{app_id}/translations/{locale}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"entries\": {},\n \"expected_revision\": 123\n}"
response = http.request(request)
puts response.read_bodyPUT https://api-datahub.octoparse.com/v1/data-apps/{app_id}/translations/{locale}
Authentication: API key required (Authorization: Bearer <API Key>). App author only.
Writes card fields and optional README for one locale. Hash baseline is workspace (falls back to latest Release). stale=true means the overlay targets unpublished draft changes. Source locale cannot be used as target.
Request
string
required
field
string
required
Locale code.
object
required
field
integer
field
Example request
curl -X PUT \
-H "Authorization: Bearer $OCTOPARSE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"entries": {"identity.name": "Product Review Lookup", "identity.summary": "Fetch public reviews by product id"}, "readme": "# Product Review Lookup\n…"}' \
"https://api-datahub.octoparse.com/v1/data-apps/carol/reviews-query/translations/en"
Response
200 success
{
"data": {
"locale": "string",
"origin": "author",
"revision": 0,
"based_on_version": "string",
"based_on_hash": "string",
"stale": false,
"stale_paths": [
"string"
],
"warnings": [
{
"code": "string",
"params": {}
}
]
}
}
Errors
| HTTP | code | category | Description |
|---|---|---|---|
| 401 | unauthorized | forbidden | Missing or invalid API key. |
| 404 | *-not-found | not_found | Target does not exist or is invisible to the current credential. |
{"error": {code, category, message, retryable}}. See Errors.