Skip to content

Commit 08e1ed9

Browse files
committed
feat(API): creating upload batches #SCD-687
1 parent 6c9e371 commit 08e1ed9

6 files changed

Lines changed: 1595 additions & 625 deletions

File tree

doc/compiled.json

Lines changed: 136 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2717,7 +2717,12 @@
27172717
"type": "string"
27182718
}
27192719
},
2720-
"example": null
2720+
"example": {
2721+
"id": "abcd1234cdef1234abcd1234cdef1234",
2722+
"username": "johndoe",
2723+
"name": "John Doe",
2724+
"gravatar_uid": "205e460b479e2e5b48aec07710c08d50"
2725+
}
27212726
},
27222727
"user": {
27232728
"type": "object",
@@ -15125,6 +15130,136 @@
1512515130
"x-cli-version": "2.5"
1512615131
}
1512715132
},
15133+
"/projects/{project_id}/upload_batches": {
15134+
"post": {
15135+
"summary": "Create upload batch",
15136+
"description": "Groups multiple file uploads into a single batch. Optionally, launches the deletion of unmentioned translation keys\nafter all uploads in the batch are completed.\n",
15137+
"operationId": "upload_batches/create",
15138+
"tags": [
15139+
"Upload Batches"
15140+
],
15141+
"parameters": [
15142+
{
15143+
"$ref": "#/components/parameters/X-PhraseApp-OTP"
15144+
},
15145+
{
15146+
"$ref": "#/components/parameters/project_id"
15147+
}
15148+
],
15149+
"requestBody": {
15150+
"required": true,
15151+
"content": {
15152+
"application/json": {
15153+
"schema": {
15154+
"type": "object",
15155+
"title": "upload_batches/create/parameters",
15156+
"required": [
15157+
"upload_ids"
15158+
],
15159+
"properties": {
15160+
"branch": {
15161+
"description": "specify the branch to use",
15162+
"type": "string",
15163+
"example": "my-feature-branch"
15164+
},
15165+
"delete_unmentioned_keys": {
15166+
"description": "If set to true, after all uploads in the batch are completed, translation keys that were not mentioned in any of the uploaded files will be deleted.",
15167+
"type": "boolean",
15168+
"example": true
15169+
},
15170+
"upload_ids": {
15171+
"description": "Array of upload IDs to include in the batch",
15172+
"type": "array",
15173+
"items": {
15174+
"type": "string"
15175+
},
15176+
"example": [
15177+
"abcd1234cdef1234abcd1234cdef1234",
15178+
"bcde2345defg2345bcde2345defg2345"
15179+
]
15180+
}
15181+
}
15182+
}
15183+
}
15184+
}
15185+
},
15186+
"responses": {
15187+
"201": {
15188+
"description": "Created",
15189+
"content": {
15190+
"application/json": {
15191+
"schema": {
15192+
"type": "object",
15193+
"title": "upload_batch",
15194+
"properties": {
15195+
"state": {
15196+
"type": "string"
15197+
},
15198+
"delete_unmentioned_keys": {
15199+
"type": "boolean"
15200+
},
15201+
"created_at": {
15202+
"type": "string",
15203+
"format": "date-time"
15204+
},
15205+
"updated_at": {
15206+
"type": "string",
15207+
"format": "date-time"
15208+
},
15209+
"project": {
15210+
"type": "object",
15211+
"$ref": "#/components/schemas/project_short"
15212+
},
15213+
"user": {
15214+
"type": "object",
15215+
"$ref": "#/components/schemas/user_preview"
15216+
},
15217+
"uploads": {
15218+
"type": "array",
15219+
"items": {
15220+
"type": "object",
15221+
"$ref": "#/components/schemas/upload"
15222+
}
15223+
}
15224+
}
15225+
}
15226+
}
15227+
},
15228+
"headers": {
15229+
"X-Rate-Limit-Limit": {
15230+
"$ref": "#/components/headers/X-Rate-Limit-Limit"
15231+
},
15232+
"X-Rate-Limit-Remaining": {
15233+
"$ref": "#/components/headers/X-Rate-Limit-Remaining"
15234+
},
15235+
"X-Rate-Limit-Reset": {
15236+
"$ref": "#/components/headers/X-Rate-Limit-Reset"
15237+
}
15238+
}
15239+
},
15240+
"400": {
15241+
"$ref": "#/components/responses/400"
15242+
},
15243+
"404": {
15244+
"$ref": "#/components/responses/404"
15245+
},
15246+
"429": {
15247+
"$ref": "#/components/responses/429"
15248+
}
15249+
},
15250+
"x-code-samples": [
15251+
{
15252+
"lang": "Curl",
15253+
"source": "curl \"https://api.phrase.com/v2/projects/:project_id/upload_batches\" \\\n-X POST \\\n-H \"Content-Type: application/json\" \\\n-d '{\n \"branch\": \"my-feature-branch\",\n \"delete_unmentioned_keys\": true,\n \"upload_ids\": [\n \"abcd1234cdef1234abcd1234cdef1234\",\n \"bcde2345defg2345bcde2345defg2345\"\n ]\n}' \\\n-u <token>:"
15254+
},
15255+
{
15256+
"lang": "CLI v2",
15257+
"source": "phrase upload_batches create --project-id :project_id \\\n--data '{\n \"branch\": \"my-feature-branch\",\n \"delete_unmentioned_keys\": true,\n \"upload_ids\": [\n \"abcd1234cdef1234abcd1234cdef1234\",\n \"bcde2345defg2345bcde2345defg2345\"\n ]\n}' \\\n--access_token <token>"
15258+
}
15259+
],
15260+
"x-cli-version": "2.12"
15261+
}
15262+
},
1512815263
"/projects/{project_id}/translations/{translation_id}/versions": {
1512915264
"get": {
1513015265
"summary": "List all versions",

0 commit comments

Comments
 (0)