-
Notifications
You must be signed in to change notification settings - Fork 5
/
openapi.yaml
638 lines (637 loc) · 21.6 KB
/
openapi.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
openapi: 3.0.1
info:
title: Localizely API
description: >-
<h2>Getting started</h2><p>Localizely API is built on <a
href="https://en.wikipedia.org/wiki/Representational_state_transfer"
target="_blank">REST</a>. <br>You can use this API for importing & exporting
your localization files in order to automate the process with `curl` scripts
or external <a href="https://en.wikipedia.org/wiki/Continuous_integration"
target="_blank">CI</a> tools. <br>Response is returned in JSON form even in
case of error. <br></p><p>If you Authenticate with your API token on this
page by clicking "Authorize" button, you can make API calls directly from
here with "Try it out", and generate such `curl` examples. </p><h2>API
Authentication</h2><p>Authenticate your account by sending your API token as
a request header `X-Api-Token`. <br>The token can be found under <a
href="https://app.localizely.com/account" target="_blank">My Profile</a>
page. <br>A user must have an Admin role in the project in order to access
the project with his token. <br>API requests without authentication will
fail.</p><p><b>Base url:</b> `https://api.localizely.com`</p>
version: 1.2.1
termsOfService: https://localizely.com/terms-of-service/
servers:
- description: Generated server url
url: https://api.localizely.com
tags:
- name: Upload API
- name: Branch API
- name: Translation Status API
- name: Download API
paths:
/v1/projects/{project_id}/files/upload:
post:
tags:
- Upload API
summary: Upload translations for a language
operationId: UploadApi_languageTranslationsUpload
security:
- API auth: []
parameters:
- description: Project ID - Can be found on 'My projects' page
name: project_id
in: path
required: true
schema:
type: string
- description: >-
Name of the branch to upload file into. Only in case of activated
branching feature.
name: branch
in: query
required: false
schema:
type: string
- description: >-
Language to upload, specified as language code. e.g. `en`, `en_GB`
or `en-GB`
name: lang_code
in: query
required: true
schema:
type: string
- description: >-
If translation in given language should be overwritten with modified
translation from uploading file.
name: overwrite
in: query
required: false
schema:
type: boolean
default: false
- description: >-
If uploading translations, that are added, should be marked as
Reviewed. For uploading translations that are only modified it will
have effect only if `overwrite` is set to `true`.
name: reviewed
in: query
required: false
schema:
type: boolean
default: false
- description: >-
Optional list of tags to add to new translations from uploading
file. <br><br>Multiple tags can be defined in a following way:
`&tag_added_keys=NEW&tag_added_keys=NEW_SPRINT05`
name: tag_added
in: query
required: false
schema:
type: array
items:
type: string
- description: >-
Optional list of tags to add to updated translations from uploading
file. <br><br>Multiple tags can be defined in a following way:
`&tag_updated_keys=UPDATED&tag_updated_keys=UPDATED_SPRINT05`
name: tag_updated
in: query
required: false
schema:
type: array
items:
type: string
- description: >-
Optional list of tags to add to removed translations from uploading
file. <br><br>Multiple tags can be defined in a following way:
`&tag_removed_keys=REMOVED&tag_removed_keys=REMOVED_SPRINT05`
name: tag_removed
in: query
required: false
schema:
type: array
items:
type: string
requestBody:
content:
multipart/form-data:
schema:
$ref: '#/components/schemas/UploadApiLanguageTranslationsUploadRequest'
responses:
'200':
description: OK, file uploaded
'400':
description: >-
Error codes:<br /> <br />- `invalid_import_file` when file
invalid. Returned with `errors` list<br />-
`max_upload_size_exceeded` when uploading file exceeds size limit<br
/>- `upgrade_required` when uploading more string keys than accepted
by owner's account plan limit<br />- `projects_limit_read_only` when
project is in read-only state due to exceeded projects limit
`'bad_request'` when request generally is not well formed
content:
'*/*':
schema:
$ref: '#/components/schemas/InvalidImportFileErrorDto'
'404':
description: Not Found
content:
'*/*':
schema:
$ref: '#/components/schemas/ErrorDto'
/v1/projects/{project_id}/branches/{branch}:
post:
tags:
- Branch API
summary: Create a new branch
operationId: BranchApi_createNewBranch
security:
- API auth: []
parameters:
- description: Project ID - Can be found on 'My projects' page
name: project_id
in: path
required: true
schema:
type: string
format: uuid
- description: Name of the branch to be created
name: branch
in: path
required: true
schema:
maxLength: 200
minLength: 0
type: string
- description: Name of the source branch from which new branch will be created
name: source_branch
in: query
required: true
schema:
type: string
responses:
'200':
description: OK, created
'400':
description: >-
Error codes:<br /> <br />- `bad_request` when request generally
is not well formed<br />- `limit_reached` when project already has
max allowed number of branches<br />- `projects_limit_read_only`
when project is in read-only state due to exceeded projects limit
content:
'*/*':
schema:
$ref: '#/components/schemas/ErrorDto'
'404':
description: Not Found
content:
'*/*':
schema:
$ref: '#/components/schemas/ErrorDto'
/v1/projects/{project_id}/status:
get:
tags:
- Translation Status API
summary: Get Translation Status for the project
operationId: TranslationStatusApi_getProjectStatus
security:
- API auth: []
parameters:
- description: Project ID - Can be found on 'My projects' page
name: project_id
in: path
required: true
schema:
type: string
- description: >-
Name of the branch to get translation status for. Only in case of
activated branching feature.
name: branch
in: query
required: false
schema:
type: string
responses:
'200':
description: OK, data returned
content:
'*/*':
schema:
$ref: '#/components/schemas/ProjectStatusDto'
'400':
description: >-
Error codes:<br /> <br />- `bad_request` when request generally
is not well formed
content:
'*/*':
schema:
$ref: '#/components/schemas/ErrorDto'
'404':
description: Not Found
content:
'*/*':
schema:
$ref: '#/components/schemas/ErrorDto'
/v1/projects/{project_id}/files/download:
get:
tags:
- Download API
summary: Download translations for a language in a specified file format
operationId: DownloadApi_translationsDownload
security:
- API auth: []
description: >-
<b>Note:</b> This endpoint is intended for getting translation files to
your source-code. This endpoint should not be called directly from you
app in runtime, as it has <b>rate-limiting</b>. <br/>For over-the-air
translation updates please consider using our <a
href="https://localizely.com/flutter-over-the-air/" target="_blank">SDK
for Flutter</a> or <a href="https://localizely.com/aws-s3-integration/"
target="_blank">integrate with AWS S3 bucket</a>.
parameters:
- description: Project ID - Can be found on 'My projects' page
name: project_id
in: path
required: true
schema:
type: string
- description: >-
Name of the branch to download file from. Only in case of activated
branching feature.
name: branch
in: query
required: false
schema:
type: string
- description: >-
Language to download, specified as language code. e.g. `en`, `en_GB`
or `en-GB`. For multiple languages use comma separator. If omitted,
all languages are downloaded.
name: lang_codes
in: query
required: false
schema:
type: string
- description: File format
name: type
in: query
required: true
schema:
type: string
enum:
- android_xml
- ios_strings
- ios_stringsdict
- java_properties
- rails_yaml
- angular_xlf
- flutter_arb
- dotnet_resx
- po
- pot
- json
- csv
- xlsx
- description: >-
(Only for Java .properties files download) Character encoding.
Default is `latin_1`.
name: java_properties_encoding
in: query
required: false
schema:
type: string
enum:
- utf_8
- latin_1
- description: >-
Optional list of tags to be downloaded. <br>If not set, all string
keys will be considered for download. <br><br>Multiple tags can be
defined in a following way:
`&include_tags=ANDROID&include_tags=ANDROID_SPRINT05`.
name: include_tags
in: query
required: false
schema:
type: array
items:
type: string
- description: >-
Optional list of tags to be excluded from download. <br>If not set,
all string keys will be considered for download. <br><br> Multiple
tags can be defined in a following way:
`&exclude_tags=REMOVED&exclude_tags=REMOVED_SPRINT05`.
name: exclude_tags
in: query
required: false
schema:
type: array
items:
type: string
- description: >-
Optional. How you would like empty translations to be exported.
Allowed values are `empty` to keep empty, `main` to replace with the
main language value, or `skip` to omit.
name: export_empty_as
in: query
required: false
schema:
type: string
default: empty
enum:
- empty
- main
- skip
responses:
'200':
description: OK, file returned
'400':
description: >-
Error codes:<br /> <br />- `invalid_export_data_rails_yaml`
when data collision for yaml download<br />- `bad_request` when
request generally is not well formed
content:
'*/*':
schema:
$ref: '#/components/schemas/ErrorDto'
'404':
description: Not Found
content:
'*/*':
schema:
$ref: '#/components/schemas/ErrorDto'
components:
schemas:
ErrorDto:
type: object
properties:
errorCode:
type: string
enum:
- already_exists
- too_long
- too_many_requests
- bad_request
- not_configured
- bad_captcha
- bad_turnstile
- bad_url
- confirmation_invalid
- forbidden_email
- main_locale_invalid
- branching_disabled
- not_activated
- invalid_password
- invalid_import_file
- invalid_export_data_rails_yaml
- forbidden
- internal_error
- not_found
- upgrade_required
- subscription_change_disabled_in_past_due
- subscription_creation_still_processing
- order_creation_still_processing
- branching_not_supported
- ota_not_supported
- string_keys_limit
- projects_limit
- projects_limit_read_only
- limit_reached
- import_keys_limit_exceeded
- max_upload_size_exceeded
- prevention_limit_reached
- tags_prevention_limit_reached
- string_key_not_found
- merge_outdated
- mt_locale_not_supported
- mt_main_translation_empty
- mt_main_translation_not_supported
- mt_source_translation_too_long
- mt_chars_missing
- mt_no_selected_strings
- tm_upload_file_invalid
- tm_upload_file_max_entries_exceeded
- tm_upload_file_version_not_supported
- tm_max_total_entries_exceeded
- tm_max_total_memories_exceeded
- glossary_locale_cant_remove
- glossary_upload_file_invalid
- glossary_upload_file_column_separator_invalid
- glossary_upload_file_headers_invalid
- glossary_upload_file_max_terms_exceeded
- glossary_max_total_terms_exceeded
- glossary_max_total_glossaries_exceeded
- order_oversize
- github_not_supported
- github_token_invalid
- github_token_scope_invalid
- github_url_invalid
- github_branch_invalid
- github_repo_invalid
- github_config_file_missing
- github_config_file_invalid
- github_push_no_changes
- gitlab_not_supported
- gitlab_token_invalid
- gitlab_token_scope_invalid
- gitlab_url_invalid
- gitlab_branch_invalid
- gitlab_repo_invalid
- gitlab_config_file_missing
- gitlab_config_file_invalid
- gitlab_push_no_changes
- bitbucket_not_supported
- bitbucket_token_invalid
- bitbucket_token_scope_invalid
- bitbucket_url_invalid
- bitbucket_branch_invalid
- bitbucket_repo_invalid
- bitbucket_config_file_missing
- bitbucket_config_file_invalid
- bitbucket_push_no_changes
- aws_s3_not_supported
- aws_s3_credentials_invalid
- aws_s3_permissions_invalid
- aws_s3_bucket_invalid
- aws_s3_region_invalid
- expired
- unauthorized
- unexpected_error
- service_unavailable
errorMessage:
type: string
errorData:
type: object
additionalProperties:
type: object
ImportFileError:
type: object
properties:
line:
type: integer
format: int32
position:
type: integer
format: int32
errorMessage:
type: string
InvalidImportFileErrorDto:
type: object
properties:
errorCode:
type: string
enum:
- already_exists
- too_long
- too_many_requests
- bad_request
- not_configured
- bad_captcha
- bad_turnstile
- bad_url
- confirmation_invalid
- forbidden_email
- main_locale_invalid
- branching_disabled
- not_activated
- invalid_password
- invalid_import_file
- invalid_export_data_rails_yaml
- forbidden
- internal_error
- not_found
- upgrade_required
- subscription_change_disabled_in_past_due
- subscription_creation_still_processing
- order_creation_still_processing
- branching_not_supported
- ota_not_supported
- string_keys_limit
- projects_limit
- projects_limit_read_only
- limit_reached
- import_keys_limit_exceeded
- max_upload_size_exceeded
- prevention_limit_reached
- tags_prevention_limit_reached
- string_key_not_found
- merge_outdated
- mt_locale_not_supported
- mt_main_translation_empty
- mt_main_translation_not_supported
- mt_source_translation_too_long
- mt_chars_missing
- mt_no_selected_strings
- tm_upload_file_invalid
- tm_upload_file_max_entries_exceeded
- tm_upload_file_version_not_supported
- tm_max_total_entries_exceeded
- tm_max_total_memories_exceeded
- glossary_locale_cant_remove
- glossary_upload_file_invalid
- glossary_upload_file_column_separator_invalid
- glossary_upload_file_headers_invalid
- glossary_upload_file_max_terms_exceeded
- glossary_max_total_terms_exceeded
- glossary_max_total_glossaries_exceeded
- order_oversize
- github_not_supported
- github_token_invalid
- github_token_scope_invalid
- github_url_invalid
- github_branch_invalid
- github_repo_invalid
- github_config_file_missing
- github_config_file_invalid
- github_push_no_changes
- gitlab_not_supported
- gitlab_token_invalid
- gitlab_token_scope_invalid
- gitlab_url_invalid
- gitlab_branch_invalid
- gitlab_repo_invalid
- gitlab_config_file_missing
- gitlab_config_file_invalid
- gitlab_push_no_changes
- bitbucket_not_supported
- bitbucket_token_invalid
- bitbucket_token_scope_invalid
- bitbucket_url_invalid
- bitbucket_branch_invalid
- bitbucket_repo_invalid
- bitbucket_config_file_missing
- bitbucket_config_file_invalid
- bitbucket_push_no_changes
- aws_s3_not_supported
- aws_s3_credentials_invalid
- aws_s3_permissions_invalid
- aws_s3_bucket_invalid
- aws_s3_region_invalid
- expired
- unauthorized
- unexpected_error
- service_unavailable
errorMessage:
type: string
errorData:
type: object
additionalProperties:
type: object
errors:
type: array
items:
$ref: '#/components/schemas/ImportFileError'
ProjectLocaleStatsDto:
description: Translation status per language
type: object
properties:
langCode:
description: Language code (ie `en` or `en-US`)
type: string
langName:
description: Language name (ie `English` or `English (US)`)
type: string
strings:
description: Total number of string keys in the project
type: integer
format: int32
reviewed:
description: Number of reviewed string keys for a language
type: integer
format: int32
reviewedProgress:
description: Reviewed progress for a language, in percentage
type: integer
format: int32
ProjectStatusDto:
type: object
properties:
strings:
description: Total number of string keys in the project
type: integer
format: int32
reviewedProgress:
description: Total reviewed progress across all languages, in percentage
type: integer
format: int32
languages:
description: Translation status per language
type: array
items:
$ref: '#/components/schemas/ProjectLocaleStatsDto'
UploadApiLanguageTranslationsUploadRequest:
required:
- file
type: object
properties:
file:
description: >-
Uploading file. Supported following formats: `Flutter ARB, Android
XML, iOS strings, iOS stringsdict, Angular XLF, Gettext PO, Gettext
POT, Java properties, Ruby on Rails yaml, .NET resx, flat json, csv,
Excel .xlsx, Excel .xls`
type: string
format: binary
securitySchemes:
API auth:
type: apiKey
name: X-Api-Token
in: header