put https://api.onesky.app/v1/workspaces//strings
This endpoint allows the user to update or add new strings within a specific workspace. The HTTP PUT request should be made to https://api.onesky.app/v1/workspaces/{workspace_id}/strings with the payload containing an array of strings to be updated or added.
The request payload should have the following structure:
{
"strings": [
{
"archived": boolean,
"character_limit": number,
"content": array,
"context": string,
"is_plural": boolean,
"is_translated": boolean,
"key": string,
"locales": {
"source": string,
"target": array
},
"string_id": string,
"tag": string,
"translatable": boolean
}
]
}
In the response, the updated or added strings will be returned with the following structure:
{
"strings": [
{
"string_id": string,
"key": string,
"context": string,
"locales": {
"source": string,
"target": array
},
"content": array,
"tag": string,
"character_limit": number,
"translatable": boolean,
"archived": boolean,
"is_plural": boolean,
"is_translated": boolean,
"values": [
{
"locale": string,
"value": string or array of objects
},
...
]
},
...
]
}
The values
array in the response contains the translated values for each locale, and for plural forms, it includes an array of objects with the value and its corresponding plural form.
Example response:
{
"strings": [
{
"string_id": "550e8400-e29b-41d4-a716-446655440000",
"key": "example_key",
"context": "example_context",
"locales": {
"source": "en_US",
"target": ["fr_FR", "es_ES"]
},
"content": ["Web", "Game"],
"tag": "content_editor",
"character_limit": 100,
"translatable": true,
"archived": false,
"is_plural": false,
"is_translated": true,
"values": [
{
"locale": "en_US",
"value": "valeur_exemple_1"
},
{
"locale": "fr_FR",
"value": "valeur_exemple_1"
},
{
"locale": "es_ES",
"value": "valor_ejemplo_1"
}
}
},
...
]
}