Skip to content

Instantly share code, notes, and snippets.

@simonexmachina
Last active August 14, 2020 04:37
Show Gist options
  • Save simonexmachina/4b48ae005907794dfb454bc5264cd034 to your computer and use it in GitHub Desktop.
Save simonexmachina/4b48ae005907794dfb454bc5264cd034 to your computer and use it in GitHub Desktop.

We submit a document to Lilt for translation with the following process:

  1. Create a document on Lilt and get the document_id from the response:
    POST https://lilt.com/2/documents/files
    LILT-API: {"project_id"=project_id,"name"="filename"}
    Content-Type: application/octet-stream
    
  2. Wait for the document import to complete (until the response indicates that import_in_progress is false):
    GET https://lilt.com/2/documents/files?id=document_id&with_segments=false
    
  3. Initiate pre-translation by calling
    POST https://lilt.com/2/documents/pretranslate
    Content-Type: application/json
    
    {"id": [document_id]}
    
  4. Wait for the pre-translation to complete (until the response indicates that is_pretranslating is false)
    GET https://lilt.com/2/documents/files?id=document_id&with_segments=false
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment