API bindings for the Lilt REST API.
All URIs are relative to https://lilt.com/2
Method | HTTP request | Description |
---|---|---|
assign_document | PUT /documents/share | Assign a Document |
create_document | POST /documents | Create a Document |
delete_document | DELETE /documents | Delete a Document |
download_document | GET /documents/files | Download a Document |
get_document | GET /documents | Retrieve a Document |
mark_review_done | POST /documents/done/review | Mark review done |
mark_translation_done | POST /documents/done/translation | Mark translation done |
pretranslate_documents | POST /documents/pretranslate | Pretranslate a Document |
unlock_documents | POST /documents/done/unlock | Unlock documents |
upload_document | POST /documents/files | Upload a File |
DocumentAssignmentResponse assign_document(body)
Assign a Document
Assign and unassign a Document for translation and/or review.
configuration = lilt.Configuration( host = “https://lilt.com/2” )
configuration = lilt.Configuration( host = “https://lilt.com/2”, api_key = { ‘key’: ‘YOUR_API_KEY’ } )
configuration = lilt.Configuration( username = ‘YOUR_USERNAME’, password = ‘YOUR_PASSWORD’ )
with lilt.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = lilt.DocumentsApi(api_client) body = lilt.DocumentAssignmentParameters() # DocumentAssignmentParameters |
try:
# Assign a Document
api_response = api_instance.assign_document(body)
pprint(api_response)
except ApiException as e:
print("Exception when calling DocumentsApi->assign_document: %s\n" % e) ```
configuration = lilt.Configuration( host = “https://lilt.com/2” )
configuration = lilt.Configuration( host = “https://lilt.com/2”, api_key = { ‘key’: ‘YOUR_API_KEY’ } )
configuration = lilt.Configuration( username = ‘YOUR_USERNAME’, password = ‘YOUR_PASSWORD’ )
with lilt.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = lilt.DocumentsApi(api_client) body = lilt.DocumentAssignmentParameters() # DocumentAssignmentParameters |
try:
# Assign a Document
api_response = api_instance.assign_document(body)
pprint(api_response)
except ApiException as e:
print("Exception when calling DocumentsApi->assign_document: %s\n" % e) ```
Name | Type | Description | Notes |
---|---|---|---|
body | DocumentAssignmentParameters |
| Status code | Description | Response headers | |————-|————-|——————| 200 | A status object. | - | 0 | Unexpected error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DocumentWithSegments create_document(body=body)
Create a Document
Create a new Document. A Document is a collection of one or more Segments. Documents are nested inside of Projects, and appear in the Project details view in the web app. Document-level relationships between Segments are considered by the machine translation system during adaptation. If there is no inherent document structure in your data, you still might consider grouping related Segments into Documents to improve translation quality.
configuration = lilt.Configuration( host = “https://lilt.com/2” )
configuration = lilt.Configuration( host = “https://lilt.com/2”, api_key = { ‘key’: ‘YOUR_API_KEY’ } )
configuration = lilt.Configuration( username = ‘YOUR_USERNAME’, password = ‘YOUR_PASSWORD’ )
with lilt.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = lilt.DocumentsApi(api_client) body = lilt.DocumentParameters() # DocumentParameters | (optional)
try:
# Create a Document
api_response = api_instance.create_document(body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling DocumentsApi->create_document: %s\n" % e) ```
configuration = lilt.Configuration( host = “https://lilt.com/2” )
configuration = lilt.Configuration( host = “https://lilt.com/2”, api_key = { ‘key’: ‘YOUR_API_KEY’ } )
configuration = lilt.Configuration( username = ‘YOUR_USERNAME’, password = ‘YOUR_PASSWORD’ )
with lilt.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = lilt.DocumentsApi(api_client) body = lilt.DocumentParameters() # DocumentParameters | (optional)
try:
# Create a Document
api_response = api_instance.create_document(body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling DocumentsApi->create_document: %s\n" % e) ```
Name | Type | Description | Notes |
---|---|---|---|
body | DocumentParameters | [optional] |
| Status code | Description | Response headers | |————-|————-|——————| 200 | A Document object. | - | 0 | Unexpected error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DocumentDeleteResponse delete_document(id)
Delete a Document
Delete a Document.
configuration = lilt.Configuration( host = “https://lilt.com/2” )
configuration = lilt.Configuration( host = “https://lilt.com/2”, api_key = { ‘key’: ‘YOUR_API_KEY’ } )
configuration = lilt.Configuration( username = ‘YOUR_USERNAME’, password = ‘YOUR_PASSWORD’ )
with lilt.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = lilt.DocumentsApi(api_client) id = 56 # int | A unique Document identifier.
try:
# Delete a Document
api_response = api_instance.delete_document(id)
pprint(api_response)
except ApiException as e:
print("Exception when calling DocumentsApi->delete_document: %s\n" % e) ```
configuration = lilt.Configuration( host = “https://lilt.com/2” )
configuration = lilt.Configuration( host = “https://lilt.com/2”, api_key = { ‘key’: ‘YOUR_API_KEY’ } )
configuration = lilt.Configuration( username = ‘YOUR_USERNAME’, password = ‘YOUR_PASSWORD’ )
with lilt.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = lilt.DocumentsApi(api_client) id = 56 # int | A unique Document identifier.
try:
# Delete a Document
api_response = api_instance.delete_document(id)
pprint(api_response)
except ApiException as e:
print("Exception when calling DocumentsApi->delete_document: %s\n" % e) ```
Name | Type | Description | Notes |
---|---|---|---|
id | int | A unique Document identifier. |
| Status code | Description | Response headers | |————-|————-|——————| 200 | A status object. | - | 0 | Unexpected error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
str download_document(id, is_xliff=is_xliff)
Download a Document
Export a Document that has been translated in the Lilt web application. Any Document can be downloaded in XLIFF 1.2 format, or can be retrieved in its original uploaded format by setting is_xliff=false
. This endpoint will fail if either (a) export or (b) pre-translation operations are in-progress. The status of those operations can be determined by retrieving the Document resource. Example CURL command: curl -X GET https://lilt.com/2/documents/files?key=API_KEY&id=274 -o from_lilt.xliff
configuration = lilt.Configuration( host = “https://lilt.com/2” )
configuration = lilt.Configuration( host = “https://lilt.com/2”, api_key = { ‘key’: ‘YOUR_API_KEY’ } )
configuration = lilt.Configuration( username = ‘YOUR_USERNAME’, password = ‘YOUR_PASSWORD’ )
with lilt.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = lilt.DocumentsApi(api_client) id = 56 # int | An unique Document identifier. is_xliff = True # bool | Download the document in XLIFF 1.2 format. (optional) (default to True)
try:
# Download a Document
api_response = api_instance.download_document(id, is_xliff=is_xliff)
pprint(api_response)
except ApiException as e:
print("Exception when calling DocumentsApi->download_document: %s\n" % e) ```
configuration = lilt.Configuration( host = “https://lilt.com/2” )
configuration = lilt.Configuration( host = “https://lilt.com/2”, api_key = { ‘key’: ‘YOUR_API_KEY’ } )
configuration = lilt.Configuration( username = ‘YOUR_USERNAME’, password = ‘YOUR_PASSWORD’ )
with lilt.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = lilt.DocumentsApi(api_client) id = 56 # int | An unique Document identifier. is_xliff = True # bool | Download the document in XLIFF 1.2 format. (optional) (default to True)
try:
# Download a Document
api_response = api_instance.download_document(id, is_xliff=is_xliff)
pprint(api_response)
except ApiException as e:
print("Exception when calling DocumentsApi->download_document: %s\n" % e) ```
Name | Type | Description | Notes |
---|---|---|---|
id | int | An unique Document identifier. | |
is_xliff | bool | Download the document in XLIFF 1.2 format. | [optional] [default to True] |
str
| Status code | Description | Response headers | |————-|————-|——————| 200 | A file. | - | 502 | File in pretranslation. | - | 0 | Unexpected error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DocumentWithSegments get_document(id, with_segments=with_segments)
Retrieve a Document
List a Document. The listing will include the pretranslation status for the document. When pretranslation is in progress for a document, the GET /documents
endpoint’s response will include is_pretranslating = true
as well as a more detailed status property status.pretranslation
one of idle
, pending
, or running
.
configuration = lilt.Configuration( host = “https://lilt.com/2” )
configuration = lilt.Configuration( host = “https://lilt.com/2”, api_key = { ‘key’: ‘YOUR_API_KEY’ } )
configuration = lilt.Configuration( username = ‘YOUR_USERNAME’, password = ‘YOUR_PASSWORD’ )
with lilt.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = lilt.DocumentsApi(api_client) id = 56 # int | A unique Document identifier. with_segments = True # bool | Flag indicating whether full segment information should be returned. (optional)
try:
# Retrieve a Document
api_response = api_instance.get_document(id, with_segments=with_segments)
pprint(api_response)
except ApiException as e:
print("Exception when calling DocumentsApi->get_document: %s\n" % e) ```
configuration = lilt.Configuration( host = “https://lilt.com/2” )
configuration = lilt.Configuration( host = “https://lilt.com/2”, api_key = { ‘key’: ‘YOUR_API_KEY’ } )
configuration = lilt.Configuration( username = ‘YOUR_USERNAME’, password = ‘YOUR_PASSWORD’ )
with lilt.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = lilt.DocumentsApi(api_client) id = 56 # int | A unique Document identifier. with_segments = True # bool | Flag indicating whether full segment information should be returned. (optional)
try:
# Retrieve a Document
api_response = api_instance.get_document(id, with_segments=with_segments)
pprint(api_response)
except ApiException as e:
print("Exception when calling DocumentsApi->get_document: %s\n" % e) ```
Name | Type | Description | Notes |
---|---|---|---|
id | int | A unique Document identifier. | |
with_segments | bool | Flag indicating whether full segment information should be returned. | [optional] |
| Status code | Description | Response headers | |————-|————-|——————| 200 | A Document object. | - | 0 | Unexpected error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
list[float] mark_review_done(body)
Mark review done
Mark the review of documents as done/undone in bulk. When being marked positively as done: - Documents must not already be marked as done for review. - Documents must already be marked as done for translation. - This request will also trigger an email notification. Example curl: curl --X --request POST 'https://lilt.com/2/documents/done/review?key=API_KEY' \\ --header 'Content-Type: application/json' \\ --data-raw '{ \"documentIds\": [23921, 23922], \"isDone\": true }'
configuration = lilt.Configuration( host = “https://lilt.com/2” )
configuration = lilt.Configuration( host = “https://lilt.com/2”, api_key = { ‘key’: ‘YOUR_API_KEY’ } )
configuration = lilt.Configuration( username = ‘YOUR_USERNAME’, password = ‘YOUR_PASSWORD’ )
with lilt.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = lilt.DocumentsApi(api_client) body = lilt.DocumentDoneUpdateParameters2() # DocumentDoneUpdateParameters2 |
try:
# Mark review done
api_response = api_instance.mark_review_done(body)
pprint(api_response)
except ApiException as e:
print("Exception when calling DocumentsApi->mark_review_done: %s\n" % e) ```
configuration = lilt.Configuration( host = “https://lilt.com/2” )
configuration = lilt.Configuration( host = “https://lilt.com/2”, api_key = { ‘key’: ‘YOUR_API_KEY’ } )
configuration = lilt.Configuration( username = ‘YOUR_USERNAME’, password = ‘YOUR_PASSWORD’ )
with lilt.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = lilt.DocumentsApi(api_client) body = lilt.DocumentDoneUpdateParameters2() # DocumentDoneUpdateParameters2 |
try:
# Mark review done
api_response = api_instance.mark_review_done(body)
pprint(api_response)
except ApiException as e:
print("Exception when calling DocumentsApi->mark_review_done: %s\n" % e) ```
Name | Type | Description | Notes |
---|---|---|---|
body | DocumentDoneUpdateParameters2 |
list[float]
| Status code | Description | Response headers | |————-|————-|——————| 200 | array of updated documents | - | 0 | Unexpected error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
list[float] mark_translation_done(body)
Mark translation done
Mark the translation of documents as done/undone in bulk. When being marked positively as done: - Documents must not already be marked as done and all segments must be confirmed. - This request will also trigger an email notification to a document’s assigned reviewer that the document is ready for review. When being marked as un-done: - Documents must not be marked as complete for review. Example curl: curl --X --request POST 'https://lilt.com/2/documents/done/translation?key=API_KEY' \\ --header 'Content-Type: application/json' \\ --data-raw '{ \"documentIds\": [23921, 23922], \"isDone\": true }'
configuration = lilt.Configuration( host = “https://lilt.com/2” )
configuration = lilt.Configuration( host = “https://lilt.com/2”, api_key = { ‘key’: ‘YOUR_API_KEY’ } )
configuration = lilt.Configuration( username = ‘YOUR_USERNAME’, password = ‘YOUR_PASSWORD’ )
with lilt.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = lilt.DocumentsApi(api_client) body = lilt.DocumentDoneUpdateParameters1() # DocumentDoneUpdateParameters1 |
try:
# Mark translation done
api_response = api_instance.mark_translation_done(body)
pprint(api_response)
except ApiException as e:
print("Exception when calling DocumentsApi->mark_translation_done: %s\n" % e) ```
configuration = lilt.Configuration( host = “https://lilt.com/2” )
configuration = lilt.Configuration( host = “https://lilt.com/2”, api_key = { ‘key’: ‘YOUR_API_KEY’ } )
configuration = lilt.Configuration( username = ‘YOUR_USERNAME’, password = ‘YOUR_PASSWORD’ )
with lilt.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = lilt.DocumentsApi(api_client) body = lilt.DocumentDoneUpdateParameters1() # DocumentDoneUpdateParameters1 |
try:
# Mark translation done
api_response = api_instance.mark_translation_done(body)
pprint(api_response)
except ApiException as e:
print("Exception when calling DocumentsApi->mark_translation_done: %s\n" % e) ```
Name | Type | Description | Notes |
---|---|---|---|
body | DocumentDoneUpdateParameters1 |
list[float]
| Status code | Description | Response headers | |————-|————-|——————| 200 | array of updated documents | - | 0 | Unexpected error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DocumentPretranslateResponse pretranslate_documents(body, auto_accept=auto_accept, case_sensitive=case_sensitive, attribute_to_creator=attribute_to_creator, mode=mode)
Pretranslate a Document
Initiate pretranslation of a list of Documents. This request will mark document(s) as being pretranslated. Pretranslation in this context is: - Applying and confirming exact TM matches based on the Memory of the Project; - Translating all other segments via MT without confirming them. Example CURL command: curl -X POST https://lilt.com/2/documents/pretranslate?key=API_KEY -d '{\"id\": [123]}' -H \"Content-Type: application/json\"
Document translation is an asynchronous process that, in effect, is performed in the background. To check the status of pretranslation for a document, use the GET /documents
endpoint. When pretranslation is in progress for a document, the GET /documents
endpoint’s response will include is_pretranslating = true
as well as a more detailed status property status.pretranslation
one of idle
, pending
, or running
. Once pretranslation is finished, the document can be downloaded via GET /documents/files
.
configuration = lilt.Configuration( host = “https://lilt.com/2” )
configuration = lilt.Configuration( host = “https://lilt.com/2”, api_key = { ‘key’: ‘YOUR_API_KEY’ } )
configuration = lilt.Configuration( username = ‘YOUR_USERNAME’, password = ‘YOUR_PASSWORD’ )
with lilt.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = lilt.DocumentsApi(api_client)
body = lilt.DocumentPretranslateParameters() # DocumentPretranslateParameters |
auto_accept = True # bool | Deprecated, use body param instead. Optional parameter for auto-accepting 100% TM hits. (optional)
case_sensitive = True # bool | Deprecated, use body param instead. Optional for using case matching against TM hits. (optional)
attribute_to_creator = True # bool | Deprecated, use body param instead. Optional parameter for attributing translation authorship of exact matches to document creator. (optional)
mode = ‘mode_example’ # str | Deprecated, use body param instead. An optional parameter indicating how the document will be pretranslated. The accepted values are tm
, or tm+mt
. Default is tm
. (optional)
try:
# Pretranslate a Document
api_response = api_instance.pretranslate_documents(body, auto_accept=auto_accept, case_sensitive=case_sensitive, attribute_to_creator=attribute_to_creator, mode=mode)
pprint(api_response)
except ApiException as e:
print("Exception when calling DocumentsApi->pretranslate_documents: %s\n" % e) ```
configuration = lilt.Configuration( host = “https://lilt.com/2” )
configuration = lilt.Configuration( host = “https://lilt.com/2”, api_key = { ‘key’: ‘YOUR_API_KEY’ } )
configuration = lilt.Configuration( username = ‘YOUR_USERNAME’, password = ‘YOUR_PASSWORD’ )
with lilt.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = lilt.DocumentsApi(api_client)
body = lilt.DocumentPretranslateParameters() # DocumentPretranslateParameters |
auto_accept = True # bool | Deprecated, use body param instead. Optional parameter for auto-accepting 100% TM hits. (optional)
case_sensitive = True # bool | Deprecated, use body param instead. Optional for using case matching against TM hits. (optional)
attribute_to_creator = True # bool | Deprecated, use body param instead. Optional parameter for attributing translation authorship of exact matches to document creator. (optional)
mode = ‘mode_example’ # str | Deprecated, use body param instead. An optional parameter indicating how the document will be pretranslated. The accepted values are tm
, or tm+mt
. Default is tm
. (optional)
try:
# Pretranslate a Document
api_response = api_instance.pretranslate_documents(body, auto_accept=auto_accept, case_sensitive=case_sensitive, attribute_to_creator=attribute_to_creator, mode=mode)
pprint(api_response)
except ApiException as e:
print("Exception when calling DocumentsApi->pretranslate_documents: %s\n" % e) ```
Name | Type | Description | Notes |
---|---|---|---|
body | DocumentPretranslateParameters | ||
auto_accept | bool | Deprecated, use body param instead. Optional parameter for auto-accepting 100% TM hits. | [optional] |
case_sensitive | bool | Deprecated, use body param instead. Optional for using case matching against TM hits. | [optional] |
attribute_to_creator | bool | Deprecated, use body param instead. Optional parameter for attributing translation authorship of exact matches to document creator. | [optional] |
mode | str | Deprecated, use body param instead. An optional parameter indicating how the document will be pretranslated. The accepted values are `tm`, or `tm+mt`. Default is `tm`. | [optional] |
| Status code | Description | Response headers | |————-|————-|——————| 202 | A status object. | - | 0 | Unexpected error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
list[float] unlock_documents(body)
Unlock documents
Unlock documents for translation. Sets document "Translation Done" and "Review Done" to false. Example curl: curl --X --request POST 'https://lilt.com/2/documents/done/unlock?key=API_KEY' \\ --header 'Content-Type: application/json' \\ --data-raw '{ \"documentIds\": [23921, 23922] }'
configuration = lilt.Configuration( host = “https://lilt.com/2” )
configuration = lilt.Configuration( host = “https://lilt.com/2”, api_key = { ‘key’: ‘YOUR_API_KEY’ } )
configuration = lilt.Configuration( username = ‘YOUR_USERNAME’, password = ‘YOUR_PASSWORD’ )
with lilt.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = lilt.DocumentsApi(api_client) body = lilt.DocumentDoneUpdateParameters() # DocumentDoneUpdateParameters |
try:
# Unlock documents
api_response = api_instance.unlock_documents(body)
pprint(api_response)
except ApiException as e:
print("Exception when calling DocumentsApi->unlock_documents: %s\n" % e) ```
configuration = lilt.Configuration( host = “https://lilt.com/2” )
configuration = lilt.Configuration( host = “https://lilt.com/2”, api_key = { ‘key’: ‘YOUR_API_KEY’ } )
configuration = lilt.Configuration( username = ‘YOUR_USERNAME’, password = ‘YOUR_PASSWORD’ )
with lilt.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = lilt.DocumentsApi(api_client) body = lilt.DocumentDoneUpdateParameters() # DocumentDoneUpdateParameters |
try:
# Unlock documents
api_response = api_instance.unlock_documents(body)
pprint(api_response)
except ApiException as e:
print("Exception when calling DocumentsApi->unlock_documents: %s\n" % e) ```
Name | Type | Description | Notes |
---|---|---|---|
body | DocumentDoneUpdateParameters |
list[float]
| Status code | Description | Response headers | |————-|————-|——————| 200 | array of updated documents | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DocumentWithSegments upload_document(name, project_id, body, pretranslate=pretranslate, auto_accept=auto_accept, case_sensitive=case_sensitive, match_attribution=match_attribution, config_id=config_id)
Upload a File
Create a Document from a file in any of the formats documented in our knowledge base. Request parameters should be passed as JSON object with the header field LILT-API
. File names in the header can only contain US-ASCII characters. File names with characters outside of US-ASCII should be URI encoded or transliterated to US-ASCII strings. Example CURL command: curl -X POST https://lilt.com/2/documents/files?key=API_KEY \\ --header \"LILT-API: {\\\"name\\\": \\\"introduction.xliff\\\",\\\"pretranslate\\\": \\\"tm+mt\\\",\\\"project_id\\\": 9}\" \\ --header \"Content-Type: application/octet-stream\" \\ --data-binary @Introduction.xliff
configuration = lilt.Configuration( host = “https://lilt.com/2” )
configuration = lilt.Configuration( host = “https://lilt.com/2”, api_key = { ‘key’: ‘YOUR_API_KEY’ } )
configuration = lilt.Configuration( username = ‘YOUR_USERNAME’, password = ‘YOUR_PASSWORD’ )
with lilt.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = lilt.DocumentsApi(api_client)
name = ‘name_example’ # str | A file name.
project_id = 56 # int | A unique Project identifier.
body = ‘/path/to/file’ # file | The file contents to be uploaded. The entire POST body will be treated as the file.
pretranslate = ‘pretranslate_example’ # str | An optional parameter indicating if and how the document will be pretranslated upon being uploaded. The accepted values are TM
, or TM+MT
(optional)
auto_accept = True # bool | An optional parameter to auto-accept segments with 100% translation memory matches when the pretranslate
option is also set, or to auto-accept any target data that is present when the uploaded file is XLIFF. If omitted it will default to your organization settings for Accept and lock exact matches
, if set to false
, no segments will be auto-accepted. (optional)
case_sensitive = True # bool | An optional parameter to use case sensitive translation memory matching when the pretranslate
option is also enabled. Matches must have identical character-by-character case to qualify as matches. Default value matches your organization settings for Use case sensitive translation memory matching
setting (optional)
match_attribution = True # bool | An optional parameter to attribute translation authorship of exact matches to the author of the file when the pretranslate
option is also enabled. Default value matches your organization settings for Translation authorship
setting (optional)
config_id = 56 # int | An optional pararameter to specify an import configuration to be applied when extracting translatable content from this file. (optional)
try:
# Upload a File
api_response = api_instance.upload_document(name, project_id, body, pretranslate=pretranslate, auto_accept=auto_accept, case_sensitive=case_sensitive, match_attribution=match_attribution, config_id=config_id)
pprint(api_response)
except ApiException as e:
print("Exception when calling DocumentsApi->upload_document: %s\n" % e) ```
configuration = lilt.Configuration( host = “https://lilt.com/2” )
configuration = lilt.Configuration( host = “https://lilt.com/2”, api_key = { ‘key’: ‘YOUR_API_KEY’ } )
configuration = lilt.Configuration( username = ‘YOUR_USERNAME’, password = ‘YOUR_PASSWORD’ )
with lilt.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = lilt.DocumentsApi(api_client)
name = ‘name_example’ # str | A file name.
project_id = 56 # int | A unique Project identifier.
body = ‘/path/to/file’ # file | The file contents to be uploaded. The entire POST body will be treated as the file.
pretranslate = ‘pretranslate_example’ # str | An optional parameter indicating if and how the document will be pretranslated upon being uploaded. The accepted values are TM
, or TM+MT
(optional)
auto_accept = True # bool | An optional parameter to auto-accept segments with 100% translation memory matches when the pretranslate
option is also set, or to auto-accept any target data that is present when the uploaded file is XLIFF. If omitted it will default to your organization settings for Accept and lock exact matches
, if set to false
, no segments will be auto-accepted. (optional)
case_sensitive = True # bool | An optional parameter to use case sensitive translation memory matching when the pretranslate
option is also enabled. Matches must have identical character-by-character case to qualify as matches. Default value matches your organization settings for Use case sensitive translation memory matching
setting (optional)
match_attribution = True # bool | An optional parameter to attribute translation authorship of exact matches to the author of the file when the pretranslate
option is also enabled. Default value matches your organization settings for Translation authorship
setting (optional)
config_id = 56 # int | An optional pararameter to specify an import configuration to be applied when extracting translatable content from this file. (optional)
try:
# Upload a File
api_response = api_instance.upload_document(name, project_id, body, pretranslate=pretranslate, auto_accept=auto_accept, case_sensitive=case_sensitive, match_attribution=match_attribution, config_id=config_id)
pprint(api_response)
except ApiException as e:
print("Exception when calling DocumentsApi->upload_document: %s\n" % e) ```
Name | Type | Description | Notes |
---|---|---|---|
name | str | A file name. | |
project_id | int | A unique Project identifier. | |
body | file | The file contents to be uploaded. The entire POST body will be treated as the file. | |
pretranslate | str | An optional parameter indicating if and how the document will be pretranslated upon being uploaded. The accepted values are `TM`, or `TM+MT` | [optional] |
auto_accept | bool | An optional parameter to auto-accept segments with 100% translation memory matches when the `pretranslate` option is also set, or to auto-accept any target data that is present when the uploaded file is XLIFF. If omitted it will default to your organization settings for `Accept and lock exact matches`, if set to `false`, no segments will be auto-accepted. | [optional] |
case_sensitive | bool | An optional parameter to use case sensitive translation memory matching when the `pretranslate` option is also enabled. Matches must have identical character-by-character case to qualify as matches. Default value matches your organization settings for `Use case sensitive translation memory matching` setting | [optional] |
match_attribution | bool | An optional parameter to attribute translation authorship of exact matches to the author of the file when the `pretranslate` option is also enabled. Default value matches your organization settings for `Translation authorship` setting | [optional] |
config_id | int | An optional pararameter to specify an import configuration to be applied when extracting translatable content from this file. | [optional] |
| Status code | Description | Response headers | |————-|————-|——————| 200 | A Document object. | - | 0 | Unexpected error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]