Translation Memory Asynchronous API v2

From Memsource
Jump to: navigation, search

Export By Query

action: api/async/v2/transMemory/exportByQuery
    token                    string
    transMemory              domain(TransMemory)
    exportTargetLang         list(locale) 
    query                    string
    queryLang                list(locale)
    createdAtMin             datetime                     O
    createdAtMax             datetime                     O
    modifiedAtMin            datetime                     O
    modifiedAtMax            datetime                     O
    createdBy                domain(User)                 O
    modifiedBy               domain(User)                 O
    filename                 string                       O
    project                  domain(Project)              O

response: JSON
{
  "asyncRequest":{
     "id":717691,
     "createdBy":{
        "id":225
     },
     "dateCreated":"2016-01-13T10:41:33+0000",
     "action":"EXPORT_TMX_BY_QUERY",
     "asyncResponse":{
     },
     "parent":null,
     "project":null
  },
  "asyncExport":{
     "transMemory":{
        "id":2782
     },
     "exportTargetLangs":[
        "en"
     ],
     "queries":[
        {
           "query":"english text",
           "lang":"en"
        }
     ],
     "asyncRequest":{
        "id":717691
     }
  }
}
Note for query (string):
* text is case insensitive
* you can use wildcards - *, ?, example: OneDriv?, OneDr*
* search specific phrase in double quotes ", example: "blue car"
* boolean operators:
   - the following word must not be present
   + the following word must be present
   AND (alternative &&) - case sensitive
   OR (alternative ||) - case sensitive
   NOT (alternative !) - case sensitive 
* grouping clauses in parentheses, example: (red OR green) AND car
* reserved characters: + - && || ! ( ) " * ? \, can be escaped with \

Download Export

action: api/async/v2/transMemory/downloadExport
    token                string
    asyncRequest         domain(AsyncRequest)
    format               enum(TransMemory.Format)     O(TMX)

response: binary

response headers
    Content-Disposition         file name