Update a key
curl --request PATCH \
--url https://api.tolk.every-day.io/v1/keys/{keyHash} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"description": "<string>",
"maxLength": 32768,
"tags": [
"<string>"
]
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tolk.every-day.io/v1/keys/{keyHash}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'description' => '<string>',
'maxLength' => 32768,
'tags' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({description: '<string>', maxLength: 32768, tags: ['<string>']})
};
fetch('https://api.tolk.every-day.io/v1/keys/{keyHash}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": {
"hash": "<string>",
"namespace": "<string>",
"key": "<string>",
"context": "<string>",
"isPlural": true,
"description": "<string>",
"maxLength": 123,
"sourceHash": "<string>",
"source": {
"value": "<string>",
"forms": {}
},
"tags": [
"<string>"
],
"archived": true,
"updatedAt": "<string>"
}
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>",
"reason": "source_language_change"
}{
"message": "<string>",
"errors": {}
}{
"message": "<string>"
}Keys
Update a key
Changes the description, the maximum length or the tags (the new set) of the key with this hash. A field that
is left out stays as it is; null clears the description or the maximum length.
PATCH
/
keys
/
{keyHash}
Update a key
curl --request PATCH \
--url https://api.tolk.every-day.io/v1/keys/{keyHash} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"description": "<string>",
"maxLength": 32768,
"tags": [
"<string>"
]
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tolk.every-day.io/v1/keys/{keyHash}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'description' => '<string>',
'maxLength' => 32768,
'tags' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({description: '<string>', maxLength: 32768, tags: ['<string>']})
};
fetch('https://api.tolk.every-day.io/v1/keys/{keyHash}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": {
"hash": "<string>",
"namespace": "<string>",
"key": "<string>",
"context": "<string>",
"isPlural": true,
"description": "<string>",
"maxLength": 123,
"sourceHash": "<string>",
"source": {
"value": "<string>",
"forms": {}
},
"tags": [
"<string>"
],
"archived": true,
"updatedAt": "<string>"
}
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>",
"reason": "source_language_change"
}{
"message": "<string>",
"errors": {}
}{
"message": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Body
application/json
Response
Show child attributes
Show child attributes