Synchronise keys
curl --request POST \
--url https://api.tolk.every-day.io/v1/keys/sync \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"keys": [
{
"key": "<string>",
"namespace": "<string>",
"context": "<string>",
"value": "<string>",
"forms": {},
"description": "<string>",
"maxLength": 123,
"tags": [
"<string>"
]
}
],
"archive": [
"<string>"
]
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tolk.every-day.io/v1/keys/sync",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'keys' => [
[
'key' => '<string>',
'namespace' => '<string>',
'context' => '<string>',
'value' => '<string>',
'forms' => [
],
'description' => '<string>',
'maxLength' => 123,
'tags' => [
'<string>'
]
]
],
'archive' => [
'<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: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
keys: [
{
key: '<string>',
namespace: '<string>',
context: '<string>',
value: '<string>',
forms: {},
description: '<string>',
maxLength: 123,
tags: ['<string>']
}
],
archive: ['<string>']
})
};
fetch('https://api.tolk.every-day.io/v1/keys/sync', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": {
"created": 123,
"updated": 123,
"restored": 123,
"unchanged": 123,
"archived": 123,
"rejected": [
{
"hash": "<string>",
"reason": "plural_changed"
}
]
}
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>",
"reason": "source_language_change"
}{
"message": "<string>",
"errors": {},
"reason": "key_limit_reached",
"limit": 123,
"used": 123,
"requested": 123
}{
"message": "<string>"
}KeysSync
Synchronise keys
Creates and updates the sent keys with their source text and archives the sent hashes. Tags are added, never
removed. A key that would change between singular and plural is refused per item (plural_changed). The
same sync twice changes nothing the second time. When the new and restored keys would take the customer over
its key limit, nothing is written and the answer is a 422 with reason: key_limit_reached.
POST
/
keys
/
sync
Synchronise keys
curl --request POST \
--url https://api.tolk.every-day.io/v1/keys/sync \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"keys": [
{
"key": "<string>",
"namespace": "<string>",
"context": "<string>",
"value": "<string>",
"forms": {},
"description": "<string>",
"maxLength": 123,
"tags": [
"<string>"
]
}
],
"archive": [
"<string>"
]
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tolk.every-day.io/v1/keys/sync",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'keys' => [
[
'key' => '<string>',
'namespace' => '<string>',
'context' => '<string>',
'value' => '<string>',
'forms' => [
],
'description' => '<string>',
'maxLength' => 123,
'tags' => [
'<string>'
]
]
],
'archive' => [
'<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: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
keys: [
{
key: '<string>',
namespace: '<string>',
context: '<string>',
value: '<string>',
forms: {},
description: '<string>',
maxLength: 123,
tags: ['<string>']
}
],
archive: ['<string>']
})
};
fetch('https://api.tolk.every-day.io/v1/keys/sync', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": {
"created": 123,
"updated": 123,
"restored": 123,
"unchanged": 123,
"archived": 123,
"rejected": [
{
"hash": "<string>",
"reason": "plural_changed"
}
]
}
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>",
"reason": "source_language_change"
}{
"message": "<string>",
"errors": {},
"reason": "key_limit_reached",
"limit": 123,
"used": 123,
"requested": 123
}{
"message": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Response
Show child attributes
Show child attributes