github.com/phrase/openapi@v0.0.0-20240514140800-49e8a106740e/paths/glossary_term_translations/create.yaml (about)

     1  ---
     2  summary: Create a translation for a term
     3  description: 'Create a new translation for a term in a term base (previously: glossary).'
     4  operationId: glossary_term_translation/create
     5  tags:
     6  - Glossary Term Translations
     7  parameters:
     8  - "$ref": "../../parameters.yaml#/X-PhraseApp-OTP"
     9  - "$ref": "../../parameters.yaml#/account_id"
    10  - "$ref": "../../parameters.yaml#/glossary_id"
    11  - "$ref": "../../parameters.yaml#/term_id"
    12  responses:
    13    '201':
    14      description: Created
    15      content:
    16        application/json:
    17          schema:
    18            "$ref": "../../schemas/glossary_term_translation.yaml#/glossary_term_translation"
    19      headers:
    20        X-Rate-Limit-Limit:
    21          "$ref": "../../headers.yaml#/X-Rate-Limit-Limit"
    22        X-Rate-Limit-Remaining:
    23          "$ref": "../../headers.yaml#/X-Rate-Limit-Remaining"
    24        X-Rate-Limit-Reset:
    25          "$ref": "../../headers.yaml#/X-Rate-Limit-Reset"
    26    '400':
    27      "$ref": "../../responses.yaml#/400"
    28    '404':
    29      "$ref": "../../responses.yaml#/404"
    30    '429':
    31      "$ref": "../../responses.yaml#/429"
    32  x-code-samples:
    33  - lang: Curl
    34    source: |-
    35      curl "https://api.phrase.com/v2/accounts/:account_id/glossaries/:glossary_id/terms/:term_id/translations" \
    36        -u USERNAME_OR_ACCESS_TOKEN \
    37        -X POST \
    38        -d '{"locale_code":"en-US","content":"My translated term"}' \
    39        -H 'Content-Type: application/json'
    40  - lang: CLI v2
    41    source: |-
    42      phrase glossary_term_translations create \
    43      --account_id <account_id> \
    44      --glossary_id <glossary_id> \
    45      --term_id <term_id> \
    46      --data '{"locale_code":"en-US", "content": "My translated term"}' \
    47      --access_token <token>
    48  requestBody:
    49    required: true
    50    content:
    51      application/json:
    52        schema:
    53          type: object
    54          title: glossary_term_translation/create/parameters
    55          required:
    56            - locale_code
    57            - content
    58          properties:
    59            locale_code:
    60              description: Identifies the language for this translation
    61              type: string
    62              example: en-US
    63            content:
    64              description: The content of the translation
    65              type: string
    66              example: My translated term
    67  x-cli-version: '2.5'