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

     1  ---
     2  summary: Create a distribution
     3  description: Create a new distribution.
     4  operationId: distribution/create
     5  tags:
     6  - Distributions
     7  parameters:
     8  - "$ref": "../../parameters.yaml#/X-PhraseApp-OTP"
     9  - "$ref": "../../parameters.yaml#/account_id"
    10  responses:
    11    '201':
    12      description: Created
    13      content:
    14        application/json:
    15          schema:
    16            "$ref": "../../schemas/distribution.yaml#/distribution"
    17      headers:
    18        X-Rate-Limit-Limit:
    19          "$ref": "../../headers.yaml#/X-Rate-Limit-Limit"
    20        X-Rate-Limit-Remaining:
    21          "$ref": "../../headers.yaml#/X-Rate-Limit-Remaining"
    22        X-Rate-Limit-Reset:
    23          "$ref": "../../headers.yaml#/X-Rate-Limit-Reset"
    24    '400':
    25      "$ref": "../../responses.yaml#/400"
    26    '404':
    27      "$ref": "../../responses.yaml#/404"
    28    '429':
    29      "$ref": "../../responses.yaml#/429"
    30  x-code-samples:
    31  - lang: Curl
    32    source: |-
    33      curl "https://api.phrase.com/v2/accounts/:account_id/distributions" \
    34        -u USERNAME_OR_ACCESS_TOKEN \
    35        -X POST \
    36        -d '{"name":"My Android Distribution","project_id":"abcd1234abcd1234abcd1234","platforms":["android","ios"],"locale_ids":["fff565db236400772368235db2c6117e,abcd1234cdef1234abcd1234cdef1234"],"format_options":"{xml:{enclose_in_cdata:'1'}}","fallback_to_non_regional_locale":true,"fallback_to_default_locale":true,"use_last_reviewed_version":true}' \
    37        -H 'Content-Type: application/json'
    38  - lang: CLI v2
    39    source: |-
    40      phrase distributions create \
    41      --account_id <account_id> \
    42      --data '{"name": "My Android Distribution", "project_id":"abcd1234abcd1234abcd1234", "platforms": "android,ios", "locale_ids":["fff565db236400772368235db2c6117e,abcd1234cdef1234abcd1234cdef1234"], "format_options": "{xml:{enclose_in_cdata:'1'}}", "fallback_to_non_regional_locale":true, "fallback_to_default_locale":true, "use_last_reviewed_version":true}' \
    43      --access_token <token>
    44  requestBody:
    45    required: true
    46    content:
    47      application/json:
    48        schema:
    49          type: object
    50          title: distribution/create/parameters
    51          required:
    52            - name
    53            - project_id
    54          properties:
    55            name:
    56              description: Name of the distribution
    57              type: string
    58              example: My Android Distribution
    59            project_id:
    60              description: Project id the distribution should be assigned to.
    61              type: string
    62              example: abcd1234abcd1234abcd1234
    63            platforms:
    64              description: |-
    65                List of platforms the distribution should support.
    66                Valid values are:
    67                * `android`
    68                * `ios`
    69                * `flutter`
    70                * `i18next`
    71                * `rails`
    72              type: array
    73              items:
    74                type: string
    75              example:
    76              - android
    77              - ios
    78            locale_ids:
    79              description: List of locale ids that will be part of distribution releases
    80              type: array
    81              items:
    82                type: string
    83              example:
    84              - abcd1234cdef1234abcd1234cdef1234
    85              - fff565db236400772368235db2c6117e
    86            format_options:
    87              description: Additional formatting and render options. Only <code>enclose_in_cdata</code> is available for platform <code>android</code>.
    88              type: object
    89              additionalProperties:
    90                type: string
    91              example: "{xml:{enclose_in_cdata:'1'}}"
    92            fallback_locales_enabled:
    93              description: Use fallback locale if there is no translation in the current locale.
    94              type: boolean
    95              example: true
    96            fallback_to_non_regional_locale:
    97              description: Indicates whether to fallback to non regional locale when locale can not be found
    98              type: boolean
    99              example: true
   100            fallback_to_default_locale:
   101              description: Indicates whether to fallback to projects default locale when locale can not be found
   102              type: boolean
   103              example: true
   104            use_last_reviewed_version:
   105              description: Use last reviewed instead of latest translation in a project
   106              type: boolean
   107              example: true
   108  x-cli-version: '2.5'