-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(api): Add QPS endpoint and documentation (#521)
- Loading branch information
1 parent
162325b
commit d22c558
Showing
5 changed files
with
302 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
--- | ||
summary: Get project's translations' quality performance scores | ||
description: Get project's translations' quality performance scores | ||
operationId: projects/quality_performance_score | ||
tags: | ||
- Quality performance score | ||
parameters: | ||
- "$ref": "../../parameters.yaml#/X-PhraseApp-OTP" | ||
- "$ref": "../../parameters.yaml#/id" | ||
responses: | ||
'200': | ||
description: OK | ||
content: | ||
application/json: | ||
schema: | ||
"$ref": "../../schemas/quality_performance_score.yaml#/quality_performance_score" | ||
headers: | ||
X-Rate-Limit-Limit: | ||
"$ref": "../../headers.yaml#/X-Rate-Limit-Limit" | ||
X-Rate-Limit-Remaining: | ||
"$ref": "../../headers.yaml#/X-Rate-Limit-Remaining" | ||
X-Rate-Limit-Reset: | ||
"$ref": "../../headers.yaml#/X-Rate-Limit-Reset" | ||
'400': | ||
"$ref": "../../responses.yaml#/400" | ||
'401': | ||
"$ref": "../../responses.yaml#/401" | ||
'404': | ||
"$ref": "../../responses.yaml#/404" | ||
'422': | ||
"$ref": "../../responses.yaml#/422" | ||
'429': | ||
"$ref": "../../responses.yaml#/429" | ||
'504': | ||
"$ref": "../../responses.yaml#/504" | ||
x-code-samples: | ||
- lang: Curl | ||
source: |- | ||
curl "https://api.phrase.com/v2/projects/:id/quality_performance_score" \ | ||
-X POST \ | ||
-u USERNAME_OR_ACCESS_TOKEN \ | ||
-d '{"translation_ids":["translation_id_1", "translation_id_2"]}' \ | ||
-H 'Content-Type: application/json' | ||
- lang: CLI v2 | ||
source: |- | ||
phrase projects quality_performance_score \ | ||
--id <id> \ | ||
--data '{"translation_ids":["translation_id_1", "translation_id_2"]}' \ | ||
--access_token <token> | ||
requestBody: | ||
required: true | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
properties: | ||
translation_ids: | ||
description: Translation ids you want to get the quality performance score for | ||
type: array | ||
items: | ||
type: string | ||
example: translation_id_1 | ||
x-cli-version: '2.20' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -78,3 +78,5 @@ | |
$ref: "./headers.yaml#/X-Rate-Limit-Reset" | ||
503: | ||
description: Server error | ||
504: | ||
description: Gateway timeout |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
--- | ||
quality_performance_score: | ||
anyOf: | ||
- type: object | ||
title: error | ||
description: Error field for when the request completely fails | ||
properties: | ||
error: | ||
type: object | ||
properties: | ||
message: | ||
type: string | ||
code: | ||
type: string | ||
- type: object | ||
properties: | ||
data: | ||
type: object | ||
properties: | ||
translations: | ||
type: array | ||
items: | ||
type: object | ||
properties: | ||
engine: | ||
type: string | ||
description: Engine used for the translation scoring | ||
score: | ||
type: number | ||
description: Quality score for the translation | ||
id: | ||
type: string | ||
description: One of the translation ids passed in arguments | ||
errors: | ||
type: array | ||
description: Array of errors for any failing translation ids | ||
items: | ||
type: object | ||
properties: | ||
message: | ||
type: string | ||
code: | ||
type: string | ||
id: | ||
type: string | ||
description: One of the translation ids passed in arguments | ||
example: | ||
data: | ||
translations: | ||
- engine: "qe_v4" | ||
score: 0.78 | ||
id: "translation_id_1" | ||
- engine: "qe_v4" | ||
score: 0.95 | ||
id: "translation_id_2" | ||
errors: [] |