Conversion_Kitchen_Code/kitchen_counter/conversion/translation/docs/TranslateApi.md

4.1 KiB
Executable File

swagger_client.TranslateApi

All URIs are relative to https://api-b2b.backenster.com/b1/api/v3

Method HTTP request Description
get_languages_get GET /getLanguages Getting the list of languages
translate_post POST /translate Text translation

get_languages_get

InlineResponse200 get_languages_get(platform, code=code)

Getting the list of languages

Example

from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: APIKeyHeader
configuration = swagger_client.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'

# create an instance of the API class
api_instance = swagger_client.TranslateApi(swagger_client.ApiClient(configuration))
platform = 'api' # str | api (default to api)
code = 'en_GB' # str | the language code in the format “language code_code of the country”, which is used to display the names of the languages. The language code is represented only in lowercase letters, the country code only in uppercase letters (example en_GB, es_ES, ru_RU etc). If this option is not present, then English is used by default (optional) (default to en_GB)

try:
    # Getting the list of languages
    api_response = api_instance.get_languages_get(platform, code=code)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling TranslateApi->get_languages_get: %s\n" % e)

Parameters

Name Type Description Notes
platform str api [default to api]
code str the language code in the format “language code_code of the country”, which is used to display the names of the languages. The language code is represented only in lowercase letters, the country code only in uppercase letters (example en_GB, es_ES, ru_RU etc). If this option is not present, then English is used by default [optional] [default to en_GB]

Return type

InlineResponse200

Authorization

APIKeyHeader

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

translate_post

InlineResponse2001 translate_post(request=request)

Text translation

Example

from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: APIKeyHeader
configuration = swagger_client.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'

# create an instance of the API class
api_instance = swagger_client.TranslateApi(swagger_client.ApiClient(configuration))
request = swagger_client.Request() # Request |  (optional)

try:
    # Text translation
    api_response = api_instance.translate_post(request=request)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling TranslateApi->translate_post: %s\n" % e)

Parameters

Name Type Description Notes
request Request [optional]

Return type

InlineResponse2001

Authorization

APIKeyHeader

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]