Create a project template
curl --request POST \
--url https://public-api.hyperlocalise.com/v1/project-templates \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"name": "<string>",
"description": "<string>",
"sourceLocale": "<string>",
"targetLocales": [
"<string>"
],
"projectDescription": "<string>",
"translationContext": "<string>",
"teamId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"automaticallyGroupIdenticalStrings": true,
"sourceTextEditable": true,
"memoryIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"glossaryIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"fromProjectId": "<string>"
}
'const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
description: '<string>',
sourceLocale: '<string>',
targetLocales: ['<string>'],
projectDescription: '<string>',
translationContext: '<string>',
teamId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
automaticallyGroupIdenticalStrings: true,
sourceTextEditable: true,
memoryIds: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
glossaryIds: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
fromProjectId: '<string>'
})
};
fetch('https://public-api.hyperlocalise.com/v1/project-templates', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://public-api.hyperlocalise.com/v1/project-templates"
payload = {
"name": "<string>",
"description": "<string>",
"sourceLocale": "<string>",
"targetLocales": ["<string>"],
"projectDescription": "<string>",
"translationContext": "<string>",
"teamId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"automaticallyGroupIdenticalStrings": True,
"sourceTextEditable": True,
"memoryIds": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"glossaryIds": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"fromProjectId": "<string>"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(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/project-templates"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"sourceLocale\": \"<string>\",\n \"targetLocales\": [\n \"<string>\"\n ],\n \"projectDescription\": \"<string>\",\n \"translationContext\": \"<string>\",\n \"teamId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"automaticallyGroupIdenticalStrings\": true,\n \"sourceTextEditable\": true,\n \"memoryIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"glossaryIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"fromProjectId\": \"<string>\"\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))
}{
"projectTemplate": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"description": "<string>",
"sourceLocale": "<string>",
"targetLocales": [
"<string>"
],
"projectDescription": "<string>",
"translationContext": "<string>",
"teamId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"automaticallyGroupIdenticalStrings": true,
"sourceTextEditable": true,
"approvedTranslationsOnSourceChange": "stay_approved",
"memoryIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"glossaryIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"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": {}
}Project templates
Create a project template
Requires project-templates:write, which files:write grants to admins and localization managers. With fromProjectId, the template copies that native project’s locales, description, translation context, team, content editor settings, translation memories, and glossaries; other fields in the body override the copied values. Otherwise name, sourceLocale, and targetLocales are required. Every glossary must use the template’s source locale.
POST
https://public-api.hyperlocalise.com
/
v1
/
project-templates
Create a project template
curl --request POST \
--url https://public-api.hyperlocalise.com/v1/project-templates \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"name": "<string>",
"description": "<string>",
"sourceLocale": "<string>",
"targetLocales": [
"<string>"
],
"projectDescription": "<string>",
"translationContext": "<string>",
"teamId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"automaticallyGroupIdenticalStrings": true,
"sourceTextEditable": true,
"memoryIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"glossaryIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"fromProjectId": "<string>"
}
'const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
description: '<string>',
sourceLocale: '<string>',
targetLocales: ['<string>'],
projectDescription: '<string>',
translationContext: '<string>',
teamId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
automaticallyGroupIdenticalStrings: true,
sourceTextEditable: true,
memoryIds: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
glossaryIds: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
fromProjectId: '<string>'
})
};
fetch('https://public-api.hyperlocalise.com/v1/project-templates', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://public-api.hyperlocalise.com/v1/project-templates"
payload = {
"name": "<string>",
"description": "<string>",
"sourceLocale": "<string>",
"targetLocales": ["<string>"],
"projectDescription": "<string>",
"translationContext": "<string>",
"teamId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"automaticallyGroupIdenticalStrings": True,
"sourceTextEditable": True,
"memoryIds": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"glossaryIds": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"fromProjectId": "<string>"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(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/project-templates"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"sourceLocale\": \"<string>\",\n \"targetLocales\": [\n \"<string>\"\n ],\n \"projectDescription\": \"<string>\",\n \"translationContext\": \"<string>\",\n \"teamId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"automaticallyGroupIdenticalStrings\": true,\n \"sourceTextEditable\": true,\n \"memoryIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"glossaryIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"fromProjectId\": \"<string>\"\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))
}{
"projectTemplate": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"description": "<string>",
"sourceLocale": "<string>",
"targetLocales": [
"<string>"
],
"projectDescription": "<string>",
"translationContext": "<string>",
"teamId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"automaticallyGroupIdenticalStrings": true,
"sourceTextEditable": true,
"approvedTranslationsOnSourceChange": "stay_approved",
"memoryIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"glossaryIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"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
application/json
Was this page helpful?

