curl --request PATCH \
--url https://public-api.hyperlocalise.com/v1/projects/{projectId}/strings/{stringId} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"sourceText": "<string>",
"context": "<string>",
"maxLength": 50000,
"hidden": true,
"keepApproved": false,
"customMetadata": {}
}
'const options = {
method: 'PATCH',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
sourceText: '<string>',
context: '<string>',
maxLength: 50000,
hidden: true,
keepApproved: false,
customMetadata: {}
})
};
fetch('https://public-api.hyperlocalise.com/v1/projects/{projectId}/strings/{stringId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://public-api.hyperlocalise.com/v1/projects/{projectId}/strings/{stringId}"
payload = {
"sourceText": "<string>",
"context": "<string>",
"maxLength": 50000,
"hidden": True,
"keepApproved": False,
"customMetadata": {}
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://public-api.hyperlocalise.com/v1/projects/{projectId}/strings/{stringId}"
payload := strings.NewReader("{\n \"sourceText\": \"<string>\",\n \"context\": \"<string>\",\n \"maxLength\": 50000,\n \"hidden\": true,\n \"keepApproved\": false,\n \"customMetadata\": {}\n}")
req, _ := http.NewRequest("PATCH", 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))
}{
"string": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"key": "<string>",
"sourceText": "<string>",
"context": "<string>",
"type": "<string>",
"maxLength": 123,
"hidden": true,
"filePath": "<string>",
"tags": [
"<string>"
],
"designUrl": "<string>",
"customMetadata": {},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}Update a string
Requires strings:write. Native projects only. Send null to clear context or maxLength. Changing sourceText on a locked segment returns 409, and so does changing the sourceText of a string in a file while the project’s “Allow source text editing” setting is off, or of a hidden string, or in a file that isn’t JSON, JSONC or ARB, came from an integration, or was last uploaded before uploads were recorded (source_text_not_editable). New sourceText holding the control characters U+001E or U+0000 returns 400 (invalid_source_text). Only admins, localization managers and developers may change the sourceText of a string in a file (403). Surrounding spaces alone are not a change. In a project whose “When source text changes” setting is “Needs review”, changing sourceText moves the string’s approved translations back to needs_review, unless keepApproved is true.
curl --request PATCH \
--url https://public-api.hyperlocalise.com/v1/projects/{projectId}/strings/{stringId} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"sourceText": "<string>",
"context": "<string>",
"maxLength": 50000,
"hidden": true,
"keepApproved": false,
"customMetadata": {}
}
'const options = {
method: 'PATCH',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
sourceText: '<string>',
context: '<string>',
maxLength: 50000,
hidden: true,
keepApproved: false,
customMetadata: {}
})
};
fetch('https://public-api.hyperlocalise.com/v1/projects/{projectId}/strings/{stringId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://public-api.hyperlocalise.com/v1/projects/{projectId}/strings/{stringId}"
payload = {
"sourceText": "<string>",
"context": "<string>",
"maxLength": 50000,
"hidden": True,
"keepApproved": False,
"customMetadata": {}
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://public-api.hyperlocalise.com/v1/projects/{projectId}/strings/{stringId}"
payload := strings.NewReader("{\n \"sourceText\": \"<string>\",\n \"context\": \"<string>\",\n \"maxLength\": 50000,\n \"hidden\": true,\n \"keepApproved\": false,\n \"customMetadata\": {}\n}")
req, _ := http.NewRequest("PATCH", 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))
}{
"string": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"key": "<string>",
"sourceText": "<string>",
"context": "<string>",
"type": "<string>",
"maxLength": 123,
"hidden": true,
"filePath": "<string>",
"tags": [
"<string>"
],
"designUrl": "<string>",
"customMetadata": {},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}Body
Was this page helpful?

