brandon14/ebay-sdk-php

View on GitHub
api-specs/commerce_translation_v1_beta_oas3.yaml

Summary

Maintainability
Test Coverage
openapi: 3.0.0
info:
  title: Translation API
  description: This API allows 3rd party developers to translate item titles.
  contact:
    name: 'eBay Inc,'
  license:
    name: eBay API License Agreement
    url: 'https://go.developer.ebay.com/api-license-agreement'
  version: v1_beta.1.4
servers:
  - url: 'https://api.ebay.com{basePath}'
    description: Production
    variables:
      basePath:
        default: /commerce/translation/v1_beta
paths:
  /translate:
    post:
      tags:
        - language
      description: 'This method translates listing title and listing description text from one language into another. For a full list of supported language translations, see the table in the API Overview page.'
      operationId: translate
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TranslateRequest'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TranslateResponse'
        '400':
          description: Bad Request
          x-response-codes:
            errors:
              '110001':
                domain: API_TRANSLATION
                category: REQUEST
                description: 'From language is invalid, missing or not supported. For more information, see the API call reference documentation.'
              '110002':
                domain: API_TRANSLATION
                category: REQUEST
                description: 'To language is invalid, missing or not supported. For more information, see the API call reference documentation.'
              '110003':
                domain: API_TRANSLATION
                category: REQUEST
                description: 'Context is not supported. For more information, see the API call reference documentation.'
              '110004':
                domain: API_TRANSLATION
                category: REQUEST
                description: 'Maximum number of input text reached. For more information, see the API call reference documentation.'
              '110005':
                domain: API_TRANSLATION
                category: REQUEST
                description: 'Maximum length of input text reached. For more information, see the API call reference documentation.'
              '110006':
                domain: API_TRANSLATION
                category: REQUEST
                description: Unsupported from and to combination.
              '110007':
                domain: API_TRANSLATION
                category: REQUEST
                description: Markups are not supported in input texts.
        '500':
          description: Internal Server Error
          x-response-codes:
            errors:
              '110000':
                domain: API_TRANSLATION
                category: APPLICATION
                description: There was a problem with an eBay internal system or process. Contact eBay developer support for assistance.
      security:
        - api_auth:
            - 'https://api.ebay.com/oauth/api_scope'
components:
  schemas:
    Error:
      type: object
      properties:
        category:
          type: string
          description: Identifies the type of erro.
        domain:
          type: string
          description: Name for the primary system where the error occurred. This is relevant for application errors.
        errorId:
          type: integer
          description: A unique number to identify the error.
          format: int32
        inputRefIds:
          type: array
          description: An array of request elements most closely associated to the error.
          items:
            type: string
        longMessage:
          type: string
          description: A more detailed explanation of the error.
        message:
          type: string
          description: 'Information on how to correct the problem, in the end user''s terms and language where applicable.'
        outputRefIds:
          type: array
          description: An array of request elements most closely associated to the error.
          items:
            type: string
        parameters:
          type: array
          description: An array of name/value pairs that describe details the error condition. These are useful when multiple errors are returned.
          items:
            $ref: '#/components/schemas/ErrorParameter'
        subdomain:
          type: string
          description: 'Further helps indicate which subsystem the error is coming from. System subcategories include: Initialization, Serialization, Security, Monitoring, Rate Limiting, etc.'
      description: This type defines the fields that can be returned in an error.
    ErrorParameter:
      type: object
      properties:
        name:
          type: string
          description: The object of the error.
        value:
          type: string
          description: The value of the object.
    TranslateRequest:
      type: object
      properties:
        from:
          type: string
          description: 'The language of the input text to be translated. Not all LanguageEnum values are supported in this field. For a full list of supported language translations, see the table in the API Overview page. For implementation help, refer to <a href=''https://developer.ebay.com/api-docs/commerce/translation/types/api:LanguageEnum''>eBay API documentation</a>'
        text:
          type: array
          description: 'The input text to translate. For ITEM_DESCRIPTION translations, HTML/CSS markup and links can be included, but will count toward max character limit. Max Length: 1,000 characters for ITEM_TITLE 100,000 characters for ITEM_DESCRIPTION, including markup/tagsMax Occurrence: 1. Only one continuous text string currently supported.'
          items:
            type: string
        to:
          type: string
          description: 'The target language for the translation of the input text. Not all LanguageEnum values are supported in this field. For a full list of supported language translations, see the table in the API Overview page. For implementation help, refer to <a href=''https://developer.ebay.com/api-docs/commerce/translation/types/api:LanguageEnum''>eBay API documentation</a>'
        translationContext:
          type: string
          description: 'Input the listing entity to be translated. Valid Values: ITEM_TITLE and ITEM_DESCRIPTION For implementation help, refer to <a href=''https://developer.ebay.com/api-docs/commerce/translation/types/api:TranslationContextEnum''>eBay API documentation</a>'
      description: This is the base type of the translate method request payload.
    TranslateResponse:
      type: object
      properties:
        from:
          type: string
          description: 'The enumeration value indicates the language of the input text. For implementation help, refer to <a href=''https://developer.ebay.com/api-docs/commerce/translation/types/api:LanguageEnum''>eBay API documentation</a>'
        to:
          type: string
          description: 'The enumeration value indicates the language of the translated text. For implementation help, refer to <a href=''https://developer.ebay.com/api-docs/commerce/translation/types/api:LanguageEnum''>eBay API documentation</a>'
        translations:
          type: array
          description: An array showing the input and translated text. Only one input string can be translated at this time. Support for multiple continuous text strings is expected in the future.
          items:
            $ref: '#/components/schemas/Translation'
      description: This is the base type of the translate method response payload.
    Translation:
      type: object
      properties:
        originalText:
          type: string
          description: 'The original text, in the language specified in the from field, that was input into the text field in the request.'
        translatedText:
          type: string
          description: The translation of the original text into the language specified in the to field.
      description: 'This type is used by the translations array, which shows the original text supplied by the user in the request payload, and the text translated by eBay. Only one input string can be translated at this time. Support for multiple continuous text strings is expected in the future.'
  securitySchemes:
    api_auth:
      type: oauth2
      description: The security definitions for this API. Please check individual operations for applicable scopes.
      flows:
        clientCredentials:
          tokenUrl: 'https://api.ebay.com/identity/v1/oauth2/token'
          scopes:
            'https://api.ebay.com/oauth/api_scope': View public data from eBay