Batch Translation

End point: [RemoteTM URL]/memories
Send a POST request with these headers:
Header Value
Session  The ticket received from Authorization Request
Content-Type application/json
Include these parameters in a JSON body:
Parameter Value
command batchTranslate
memory  ID of the memory to query
srcLang  Source language code
tgtLang  Target Language
segments  Array of JSON entries containing these fields:
  • unit: ID of the XLIFF <unit> being translated
  • file: ID of the XLIFF <file> being translated
  • segment: ID of the XLIFF <segment> being translated
  • pure: Pure text content of the segment being translated
Example:
{
  "command": "batchTranslate",
  "memory": "1619955225759",
  "srcLang": "en",
  "tgtLang": "es",
  "segments": [{
      "unit": "2",
      "file": "1",
      "segment": "2",
      "pure": "Get Auto-Translations"
    },{
      "unit": "3",
      "file": "1",
      "segment": "3",
      "pure": "Apply Auto-Translation to All Segments"
    },{
      "unit": "4",
      "file": "1",
      "segment": "4-1",
      "pure": "Yearly Subscriptions"
    }]
}
RemoteTM responds with a JSON object.
On success, field 'status' is set to 'OK' and translation results are included in 'matches' field. Example:
{
  "matches": [{
      "unit": "2",
      "file": "1",
      "segment": "2",
      "pure": "Get Auto-Translations",
      "matches": [{
          "similarity": 76,
          "origin": "1619955225759",
          "source": "<tuv xml:lang=\"en\"><seg>Auto-Translation<\/seg><\/tuv>",
          "properties": {
            "project": "swordfish.ditamap"
          },
          "target": "<tuv xml:lang=\"es\"><seg>Auto-Traducción<\/seg><\/tuv>"
        },{
          "similarity": 76,
          "origin": "1619955225759",
          "source": "<tuv xml:lang=\"en\"><seg>Auto-Translation<\/seg><\/tuv>",
          "target": "<tuv xml:lang=\"es\"><seg>Auto-Traducción<\/seg><\/tuv>"
        },{
          "similarity": 70,
          "origin": "1619955225759",
          "source": "<tuv xml:lang=\"en\"><seg>Export Translations<\/seg><\/tuv>",
          "properties": {
            "project": "swordfish.ditamap"
          },
          "target": "<tuv xml:lang=\"es\"><seg>Exportar Traducciones<\/seg><\/tuv>"
        }
      ]
    },{
      "unit": "3",
      "file": "1",
      "segment": "3",
      "pure": "Apply Auto-Translation to All Segments",
      "matches": [{
          "similarity": 100,
          "origin": "1619955225759",
          "source": "<tuv xml:lang=\"en\"><seg>Apply Auto-Translation to All Segments<\/seg><\/tuv>",
          "target": "<tuv xml:lang=\"es\"><seg>Aplicar Auto-Translation a Todos los Segmentos<\/seg><\/tuv>"
        }
      ]
    },{
      "unit": "4",
      "file": "1",
      "segment": "4-1",
      "pure": "Yearly Subscriptions",
      "matches": [{
          "similarity": 100,
          "origin": "1619955225759",
          "source": "<tuv xml:lang=\"en\"><seg>Yearly Subscriptions<\/seg><\/tuv>",
          "target": "<tuv xml:lang=\"es\"><seg>Suscripciones Anuales<\/seg><\/tuv>"
        },{
          "similarity": 72,
          "origin": "1619955225759",
          "source": "<tuv xml:lang=\"en\"><seg>Subscription Renewal<\/seg><\/tuv>",
          "properties": {
            "project": "swordfish.ditamap"
          },
          "target": "<tuv xml:lang=\"es\"><seg>Renovación de Suscripción<\/seg><\/tuv>"
        },{
          "similarity": 65,
          "origin": "1619955225759",
          "source": "<tuv xml:lang=\"en\"><seg>Subscriptions<\/seg><\/tuv>",
          "properties": {
            "project": "swordfish.ditamap"
          },
          "target": "<tuv xml:lang=\"es\"><seg>Suscripciones<\/seg><\/tuv>"
        }]
    }],
  "status": "OK"
}
On error, field 'status' is set to 'Error' and field 'reason' contains the error cause. Example:
{
    "status": "Error",
    "reason": "Access denied"
}