Update Key
Updates Key.
Request type: POST
API Endpoint
https://api.translized.com/term/update
Parameters
Param | Type | Required | Description |
---|---|---|---|
projectId | String | True | Id of your project |
termKey | String | True | Key of key to update |
translation | String | False | Translation. If defined languageCode is required |
languageCode | String | False | Code of language for translation. If defined translation is required |
context | String | False | Context of key |
Example requests
- cURL
- Javascript Fetch
- Javascript Axios
curl -X POST -H "Content-Type: application/json" \
-H "api-token: 42cf5fec-a74c-4a53-8ebc-86a4e52b7ce6" \
-d "{"projectId":"A3KJtLw4mt", "termKey":"Api.test", "translation":"API TEST", "languageCode": "en"}" \
https://api.translized.com/term/update
fetch('https://api.translized.com/term/update', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'api-token': '42cf5fec-a74c-4a53-8ebc-86a4e52b7ce6',
},
body: JSON.stringify({
projectId: 'A3KJtLw4mt',
termKey: 'Api.test',
translation: 'API TEST',
languageCode: 'en',
}),
})
.then((response) => response.json())
.then((data) => console.log(data))
.catch((error) => console.error(error));
const response = await axios.post('https://api.translized.com/term/update', {
projectId: 'A3KJtLw4mt',
termKey: 'Api.test',
translation: 'API TEST',
languageCode: 'en',
});
const data = response.result;
info
- projectId can be found inside your project's settings. (Translized App > Your Project > Settings )
- List of all supported languages with languageCode values can be found in our Supported Languages section.
- Key context is not required but it is good way to describe where or how key will be used.
Example response
{
"result": {
"key": "Api.test",
"value": [
{
"code": "en",
"translation": "API TEST"
}
{
"code": "de",
"translation": "Anmelden 1"
},
{
"code": "fr",
"translation": "S'inscrire"
}
]
}
}