> ## Documentation Index
> Fetch the complete documentation index at: https://developers.phrase.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Action result

> Use the Accept header with either `application/octet-stream` to get the file or use `application/json` to get the quality estimation.



## OpenAPI

````yaml /openapi/phrase-language-ai.json get /v1/fileTranslations/{uid}/{actionType}/{language}
openapi: 3.0.2
info:
  title: Phrase Language AI via API
  description: >
    ### Machine translation powered by [Phrase](https://phrase.com) allows the
    translation of content utilizing  a unique AI powered feature to pick the
    best available translation engine for that content.
  version: 1.0.0
  termsOfService: https://phrase.com/terms/
  contact:
    url: https://phrase.com
servers:
  - url: https://eu.phrase.com/smt/api/
    description: The API server for EU data center.
  - url: https://us.phrase.com/smt/api/
    description: The API server for US data center.
security:
  - BearerAuth: []
tags:
  - name: File translations
    description: >-
      Allows the processing files asynchronously with the file being uploaded
      and stored in Phrase.  Files can be either stored or translated by the
      best available MT engine. File TTL is limited to 24 hours  after which the
      file is deleted from storage.
  - name: Authentication
    description: >
      Allows the authentication of a user and to get the token to be used in the
      Authorization header.
  - name: Text translations
    description: >
      Allows the translation of text content utilizing Phrase Language AI
      capabilities. APIs are synchronous, 

      designed for quick turnaround and are limited in size of the request.
paths:
  /v1/fileTranslations/{uid}/{actionType}/{language}:
    get:
      tags:
        - File translations
      summary: Action result
      description: >-
        Use the Accept header with either `application/octet-stream` to get the
        file or use `application/json` to get the quality estimation.
      operationId: getFilesV1
      parameters:
        - $ref: '#/components/parameters/Accept'
        - in: path
          name: uid
          description: >-
            UID of the operation. See [File
            translations](/en/api/language-ai/file-translations/file-translations)
            endpoint.
          required: true
          schema:
            type: string
        - in: path
          name: actionType
          description: >-
            File associated with the specified action type will be returned, if
            the action was completed.
          required: true
          schema:
            $ref: '#/components/schemas/ActionTypeEnumV1'
        - in: path
          name: language
          description: >-
            Requested language of the file. Please note different actions have
            different languages available.
          required: true
          x-constraints: '@ValidLocale'
          schema:
            type: string
      responses:
        '200':
          description: Action result has been successfully returned.
          headers:
            Memsource-Action-Id:
              $ref: '#/components/headers/MemsourceActionId'
            Content-Type:
              $ref: '#/components/headers/ContentType'
          content:
            multipart/form-data:
              schema:
                type: object
                properties:
                  metadata:
                    $ref: '#/components/schemas/FileTranslationsMetadataV1'
                  file:
                    description: The file data.
                    type: string
                    format: binary
                required:
                  - metadata
                  - file
              examples:
                translated-file:
                  value: >
                    --Boundary_1_1453803947_1691603987728

                    Content-Type: application/octet-stream

                    Content-Disposition: form-data; name="file";
                    filename="test.txt"

                    Přeložený text


                    --Boundary_1_1453803947_1691603987728

                    Content-Type: application/json

                    Content-Disposition: form-data; name="metadata"


                    {"sourceLang":{"code":"en"},"targetLangs":[{"code":"cs"}],"actionTypes":["MT_GENERIC_PRETRANSLATE"],"callbackUrl":"https://your-server.com/send/data/here"}

                    --Boundary_1_1453803947_1691603987728--
              encoding:
                metadata:
                  contentType: application/json
                file:
                  contentType: application/octet-stream
            application/octet-stream:
              schema:
                type: string
                format: binary
              examples:
                translated-file:
                  value: |
                    Přeložený text
            application/json:
              schema:
                $ref: '#/components/schemas/QualityEstimationResponseV1'
        '400':
          $ref: '#/components/responses/Tms400'
        '401':
          $ref: '#/components/responses/Tms401'
        '403':
          $ref: '#/components/responses/Tms403'
        '404':
          $ref: '#/components/responses/Tms404'
        '405':
          $ref: '#/components/responses/Tms405'
        '408':
          $ref: '#/components/responses/Tms408'
        '410':
          $ref: '#/components/responses/Tms410'
        '415':
          $ref: '#/components/responses/Tms415'
        '429':
          $ref: '#/components/responses/Tms429'
        '500':
          $ref: '#/components/responses/Tms500'
        '501':
          $ref: '#/components/responses/Tms501'
components:
  parameters:
    Accept:
      name: Accept
      description: Media type which caller expects as a response.
      in: header
      required: true
      schema:
        type: string
  schemas:
    ActionTypeEnumV1:
      type: string
      enum:
        - CONVERTER_IMPORT
        - FILE_IMPORT
        - MT_GENERIC_PRETRANSLATE
        - QUALITY_ESTIMATION
      example: MT_GENERIC_PRETRANSLATE
    FileTranslationsMetadataV1:
      type: object
      properties:
        sourceLang:
          $ref: '#/components/schemas/LanguageV1'
        targetLangs:
          type: array
          items:
            $ref: '#/components/schemas/LanguageV1'
          uniqueItems: true
          minItems: 1
        actionTypes:
          type: array
          items:
            $ref: '#/components/schemas/ActionTypeEnumV1'
          uniqueItems: true
          minItems: 1
        callbackUrl:
          type: string
          description: >-
            URI in [RFC 2396](https://datatracker.ietf.org/doc/html/rfc2396)
            format.
          format: uri
        mtSettings:
          $ref: '#/components/schemas/MtSettingsV1'
        transMemoriesConfig:
          type: array
          items:
            $ref: '#/components/schemas/TranslationMemoriesConfigV1'
      required:
        - sourceLang
        - targetLangs
        - actionTypes
    QualityEstimationResponseV1:
      type: object
      properties:
        score:
          type: number
          format: double
          example: 0.42
      required:
        - score
    LanguageV1:
      type: object
      properties:
        code:
          type: string
          description: >-
            Language code, using a two-letter language code from ISO 639-1,
            e.g., `cs`.  Optionally, a region subtag based on a two-letter
            country code from ISO 3166-1 alpha-2,  e.g., `cs_cz`, or a
            three-digit code from UN M.49, e.g., `es_419`, separated by an
            underscore.  Both the two-letter language code and the two-letter
            country code need to be lower case.

            Note that the Phrase Language AI setup dictates whether the region
            subtag is optional or not.  If the only models deployed to a profile
            explicitly specify or are customized with a target locale,  then a
            region subtag is mandatory.
          example: cs
          x-constraints: '@ValidLocale'
      required:
        - code
    MtSettingsV1:
      type: object
      properties:
        usePhraseMTSettings:
          type: boolean
          default: false
          description: Use Language AI to apply Machine Translation
          example: true
        profile:
          $ref: '#/components/schemas/TranslationProfileRequestV1'
    TranslationMemoriesConfigV1:
      type: object
      properties:
        targetLang:
          $ref: '#/components/schemas/LanguageV1'
        transMemories:
          type: array
          items:
            $ref: '#/components/schemas/TranslationMemoryRequestV1'
    TranslationProfileRequestV1:
      type: object
      required:
        - uid
      properties:
        uid:
          type: string
          description: UID for the translation profile
          example: CFUki8ptanoz1WAIYoXSH4
    TranslationMemoryRequestV1:
      type: object
      properties:
        transMemory:
          type: object
          properties:
            uid:
              type: string
              description: Unique identifier of the translation memory
        tmSourceLocale:
          $ref: '#/components/schemas/LanguageV1'
        tmTargetLocale:
          $ref: '#/components/schemas/LanguageV1'
  headers:
    MemsourceActionId:
      description: Memsource action identifier used for tracking request across services.
      schema:
        type: string
    ContentType:
      description: Describes format (its MIME type) of the content.
      schema:
        type: string
  responses:
    Tms400:
      description: Bad request
      headers:
        Memsource-Action-Id:
          $ref: '#/components/headers/MemsourceActionId'
    Tms401:
      description: Not authorized
      headers:
        Memsource-Action-Id:
          $ref: '#/components/headers/MemsourceActionId'
    Tms403:
      description: Forbidden
      headers:
        Memsource-Action-Id:
          $ref: '#/components/headers/MemsourceActionId'
    Tms404:
      description: Resource not found
      headers:
        Memsource-Action-Id:
          $ref: '#/components/headers/MemsourceActionId'
    Tms405:
      description: Method not allowed
      headers:
        Memsource-Action-Id:
          $ref: '#/components/headers/MemsourceActionId'
    Tms408:
      description: Timeout
      headers:
        Memsource-Action-Id:
          $ref: '#/components/headers/MemsourceActionId'
    Tms410:
      description: Gone
      headers:
        Memsource-Action-Id:
          $ref: '#/components/headers/MemsourceActionId'
    Tms415:
      description: Unsupported media type
      headers:
        Memsource-Action-Id:
          $ref: '#/components/headers/MemsourceActionId'
    Tms429:
      description: Too many requests
      headers:
        Memsource-Action-Id:
          $ref: '#/components/headers/MemsourceActionId'
    Tms500:
      description: Internal server error
      headers:
        Memsource-Action-Id:
          $ref: '#/components/headers/MemsourceActionId'
    Tms501:
      description: Not implemented
      headers:
        Memsource-Action-Id:
          $ref: '#/components/headers/MemsourceActionId'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Provide `Authorization` header with token obtained through
        [Login](/en/api/language-ai/authentication/login) operation.

````