This document describes the Plugin API for Lilt's Connector platform. The Plugin API is intented to be used by developers who wish to build integrations into their desired systems. The purpose of this API is to enable content transfer and status monitoring for localization projects.
- Read more about the concepts and workflows in the user guide.
- Test the API interactively via Swagger UI.
This API client was generated by the OpenAPI Generator project. By using the OpenAPI-spec from a remote server, you can easily generate an API client.
- API version: 1.0
- Package version: 1.0.0
- Generator version: 7.14.0
- Build package: org.openapitools.codegen.languages.GoClientCodegen
Install the following dependencies:
go get github.com/stretchr/testify/assert
go get golang.org/x/net/contextPut the package under your project folder and add the following in import:
import lilt "github.com/lilt/lilt-connector-sdk-go"To use a proxy, set the environment variable HTTP_PROXY:
os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port")Default configuration comes with Servers field that contains server objects as defined in the OpenAPI specification.
For using other server than the one defined on index 0 set context value lilt.ContextServerIndex of type int.
ctx := context.WithValue(context.Background(), lilt.ContextServerIndex, 1)Templated server URL is formatted using default variables from configuration or from context value lilt.ContextServerVariables of type map[string]string.
ctx := context.WithValue(context.Background(), lilt.ContextServerVariables, map[string]string{
"basePath": "v2",
})Note, enum values are always validated and all unused variables are silently ignored.
Each operation can use different server URL defined using OperationServers map in the Configuration.
An operation is uniquely identified by "{classname}Service.{nickname}" string.
Similar rules for overriding default operation server index and variables applies by using lilt.ContextOperationServerIndices and lilt.ContextOperationServerVariables context maps.
ctx := context.WithValue(context.Background(), lilt.ContextOperationServerIndices, map[string]int{
"{classname}Service.{nickname}": 2,
})
ctx = context.WithValue(context.Background(), lilt.ContextOperationServerVariables, map[string]map[string]string{
"{classname}Service.{nickname}": {
"port": "8443",
},
})All URIs are relative to https://connectors-admin.lilt.com/api/v1.0
| Class | Method | HTTP request | Description |
|---|---|---|---|
| PluginAPI | AddFile | Post /jobs/{id}/files | Add a file to a Job. |
| PluginAPI | CompareFileProcessing | Post /jobs/compare-files | Compare Source and Target Files After Preprocessing |
| PluginAPI | CompleteDelivery | Post /translations/{id}/complete | Complete a Translation. |
| PluginAPI | CreateCreditTransaction | Post /credit-transaction | Create a credit transaction. Request is expected to contain credits information encoded in jwt_token payload. Request encoded should have info for instant_translation_credits_change value, verified_translation_credits_change value, source_metadata which contains any identifying information to attach to the transaction, email for the user starting the transaction, and optionally lilt_token for the connector configuration. |
| PluginAPI | CreateJob | Post /jobs | Create a Connector Job. |
| PluginAPI | DeleteJobById | Delete /jobs/{id} | Delete a Connector Job. |
| PluginAPI | DownloadDelivery | Get /translations/{id}/download | Download a Translation. |
| PluginAPI | DownloadDeliverySource | Get /translations/{id}/source | Download a Translation Source. |
| PluginAPI | GetDeliveriesByJobId | Get /translations | Retrieve a list of Translations. |
| PluginAPI | GetDeliveryById | Get /translations/{id} | Retrieve a Translation. |
| PluginAPI | GetDomains | Get /domains | Retrieve a list of Connector Domains. |
| PluginAPI | GetDomainsLanguages | Get /domains/languages | Retrieve the domains languages. |
| PluginAPI | GetJobById | Get /jobs/{id} | Retrieve a Connector Job. |
| PluginAPI | GetJobTranslations | Get /jobs/translations | Retrieve a list of Translations with their Job information. |
| PluginAPI | GetJobs | Get /jobs | Retrieve a list of Connector Jobs. |
| PluginAPI | GetLanguages | Get /languages | Retrieve supported language and locale codes. |
| PluginAPI | GetOrganizationRecord | Get /organization | Get information about the organization based on lilt_token |
| PluginAPI | GetSettings | Get /settings | Retrieve the settings. |
| PluginAPI | PreviewDelivery | Get /translations/{id}/preview | Get a Translation's source to target mapping. |
| PluginAPI | PreviewFileProcessing | Post /jobs/preview-file | Preview File |
| PluginAPI | RegisterCreditsBasedOrganization | Post /register | Register a new Connectors Organization |
| PluginAPI | StartJob | Post /jobs/{id}/start | Start a Job. |
| PluginAPI | SyncJob | Post /jobs/{id}/sync | Start a Sync. |
| PluginAPI | UpdateDelivery | Put /translations/{id} | Update a Translation. |
| PluginAPI | UpdateJob | Put /jobs/{id} | Update a Connector Job. |
| PluginAPI | UpdateSettings | Put /settings | Update the settings. |
| PluginAPI | Validate | Post /settings/validate | Validate Connector Configuration |
- CompareFileProcessing400Response
- ConnectorConfigurationValidationResponse
- CreateCreditTransactionRequest
- DomainsResponseInner
- ErrorResponse
- JobResponse
- JobsResponse
- LanguagesResponse
- NewJobOptions
- NewJobOptionsTargetModelsInner
- NewOrganizationOptions
- OrganizationResponse
- PreviewTranslationResponseInner
- SettingsLanguagesResponseInner
- SettingsResponse
- SettingsResponseTargetMemoriesValue
- TranslationResponse
- TranslationsResponse
- UpdateDeliveryOptions
- UpdateJobOptions
Authentication schemes defined for the API:
- Type: HTTP Bearer token authentication
Example
auth := context.WithValue(context.Background(), lilt.ContextAccessToken, "BEARER_TOKEN_STRING")
r, err := client.Service.Operation(auth, args)Due to the fact that model structure members are all pointers, this package contains a number of utility functions to easily obtain pointers to values of basic types. Each of these functions takes a value of the given basic type and returns a pointer to it:
PtrBoolPtrIntPtrInt32PtrInt64PtrFloatPtrFloat32PtrFloat64PtrStringPtrTime