108 lines
3.6 KiB
Markdown
Executable File
108 lines
3.6 KiB
Markdown
Executable File
# swagger-client
|
|
Lingvanex works via HTTPS requests. The URL of all requests starts with https://api-b2b.backenster.com/b1/api/v3/. In case of a protocol selection error and using HTTP, the request will be redirected to the address with the HTTPS protocol (status code 302). <br><br>Authentication of requests is done by adding the “Authorization” header with the following data format: Bearer The key can be created on the user control panel page https://lingvanex.com/account. Example: \"Authorization: Bearer <YOUR_API_KEY>\".
|
|
|
|
This Python package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
|
|
|
|
- API version: 1.0.0
|
|
- Package version: 1.0.0
|
|
- Build package: io.swagger.codegen.languages.PythonClientCodegen
|
|
|
|
## Requirements.
|
|
|
|
Python 2.7 and 3.4+
|
|
|
|
## Installation & Usage
|
|
### pip install
|
|
|
|
If the python package is hosted on Github, you can install directly from Github
|
|
|
|
```sh
|
|
pip install git+https://github.com//.git
|
|
```
|
|
(you may need to run `pip` with root permission: `sudo pip install git+https://github.com//.git`)
|
|
|
|
Then import the package:
|
|
```python
|
|
import swagger_client
|
|
```
|
|
|
|
### Setuptools
|
|
|
|
Install via [Setuptools](http://pypi.python.org/pypi/setuptools).
|
|
|
|
```sh
|
|
python setup.py install --user
|
|
```
|
|
(or `sudo python setup.py install` to install the package for all users)
|
|
|
|
Then import the package:
|
|
```python
|
|
import swagger_client
|
|
```
|
|
|
|
## Getting Started
|
|
|
|
Please follow the [installation procedure](#installation--usage) and then run the following:
|
|
|
|
```python
|
|
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)
|
|
|
|
```
|
|
|
|
## Documentation for API Endpoints
|
|
|
|
All URIs are relative to *https://api-b2b.backenster.com/b1/api/v3*
|
|
|
|
Class | Method | HTTP request | Description
|
|
------------ | ------------- | ------------- | -------------
|
|
*TranslateApi* | [**get_languages_get**](docs/TranslateApi.md#get_languages_get) | **GET** /getLanguages | Getting the list of languages
|
|
*TranslateApi* | [**translate_post**](docs/TranslateApi.md#translate_post) | **POST** /translate | Text translation
|
|
|
|
|
|
## Documentation For Models
|
|
|
|
- [AuthError](docs/AuthError.md)
|
|
- [InlineResponse200](docs/InlineResponse200.md)
|
|
- [InlineResponse2001](docs/InlineResponse2001.md)
|
|
- [InlineResponse200Modes](docs/InlineResponse200Modes.md)
|
|
- [InlineResponse200Result](docs/InlineResponse200Result.md)
|
|
- [Request](docs/Request.md)
|
|
|
|
|
|
## Documentation For Authorization
|
|
|
|
|
|
## APIKeyHeader
|
|
|
|
- **Type**: API key
|
|
- **API key parameter name**: Authorization
|
|
- **Location**: HTTP header
|
|
|
|
|
|
## Author
|
|
|
|
info@lingvanex.com
|
|
|